This class seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
The property id does not exist on object<Taskforcedev\Lara...orum\Models\ForumReply>. Since you implemented __set, maybe consider adding a @property annotation.
Since your code implements the magic setter _set, this function will be called for any write access on an
undefined variable. You can add the @property annotation to your class or interface to document
the existence of this variable.
<?php/** * @property int $x * @property int $y * @property string $text */classMyLabel{private$properties;private$allowedProperties=array('x','y','text');publicfunction__get($name){if(isset($properties[$name])&&in_array($name,$this->allowedProperties)){return$properties[$name];}else{returnnull;}}publicfunction__set($name,$value){if(in_array($name,$this->allowedProperties)){$properties[$name]=$value;}else{thrownew\LogicException("Property $name is not defined.");}}}
Since the property has write access only, you can use the @property-write annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.