Meio Upload Strict Errors

2.9k views Asked by At
Strict (2048): Declaration of MeioUploadBehavior::setup() should be compatible with ModelBehavior::setup(Model $model, $config = Array) [APP/Plugin/MeioUpload/Model/Behavior/MeioUploadBehavior.php, line 26]

Strict (2048): Declaration of MeioUploadBehavior::beforeValidate() should be compatible with ModelBehavior::beforeValidate(Model $model) [APP/Plugin/MeioUpload/Model/Behavior/MeioUploadBehavior.php, line 26]

Strict (2048): Declaration of MeioUploadBehavior::beforeSave() should be compatible with ModelBehavior::beforeSave(Model $model) [APP/Plugin/MeioUpload/Model/Behavior/MeioUploadBehavior.php, line 26]

Strict (2048): Declaration of MeioUploadBehavior::afterSave() should be compatible with ModelBehavior::afterSave(Model $model, $created) [APP/Plugin/MeioUpload/Model/Behavior/MeioUploadBehavior.php, line 26]

Strict (2048): Declaration of MeioUploadBehavior::beforeDelete() should be compatible with ModelBehavior::beforeDelete(Model $model, $cascade = true) [APP/Plugin/MeioUpload/Model/Behavior/MeioUploadBehavior.php, line 26]

Strict (2048): Declaration of MeioUploadBehavior::afterDelete() should be compatible with ModelBehavior::afterDelete(Model $model) [APP/Plugin/MeioUpload/Model/Behavior/MeioUploadBehavior.php, line 26]
2

There are 2 answers

0
dhofstet On

The method signatures of the MeioUploadBehavior must be the same as those of the ModelBehavior class.

For example, the method signature of the afterDelete method must be changed from function afterDelete(&$model) to function afterDelete(Model $model).

0
user2918013 On

Change the file MeioUploadBehavior

function beforeValidate(Model $model)
function beforeSave(Model $model)
function afterSave(Model $model, $created)

by:

function beforeValidate(Model $model, $options = array())
function beforeSave(Model $model, $options = array())
function afterSave(Model $model, $created, $options = array())

This correction is due to changes made ​​by CakePHP Version.

Greeting

@jvo_chile