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.
Loading history...
18
{
19
/**
20
* Get automatic action description.
21
*
22
* @return string
23
*/
24
public function getDescription()
25
{
26
return t('Close a task');
27
}
28
29
/**
30
* Get the list of compatible events.
31
*
32
* @return array
33
*/
34
public function getCompatibleEvents()
35
{
36
return [];
37
}
38
39
/**
40
* Get the required parameter for the action (defined by the user).
41
*
42
* @return array
43
*/
44
public function getActionRequiredParameters()
45
{
46
return [];
47
}
48
49
/**
50
* Get the required parameter for the event.
51
*
52
* @return string[]
53
*/
54
public function getEventRequiredParameters()
55
{
56
return ['task_id'];
57
}
58
59
/**
60
* Execute the action (close the task).
61
*
62
* @param array $data Event data dictionary
63
*
64
* @return bool True if the action was executed or false when not executed
The property taskStatusModel does not exist on object<Jitamin\Action\TaskClose>. Since you implemented __get, maybe consider adding a @property annotation.
Since your code implements the magic getter _get, this function will be called for any read 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.");}}}
If the property has read access only, you can use the @property-read 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.