This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | /* |
||
4 | * This file is part of Jitamin. |
||
5 | * |
||
6 | * Copyright (C) Jitamin Team |
||
7 | * |
||
8 | * For the full copyright and license information, please view the LICENSE |
||
9 | * file that was distributed with this source code. |
||
10 | */ |
||
11 | |||
12 | namespace Jitamin\Model; |
||
13 | |||
14 | use Jitamin\Foundation\Database\Model; |
||
15 | |||
16 | /** |
||
17 | * Action Model. |
||
18 | */ |
||
19 | class ActionModel extends Model |
||
20 | { |
||
21 | /** |
||
22 | * SQL table name for actions. |
||
23 | * |
||
24 | * @var string |
||
25 | */ |
||
26 | const TABLE = 'actions'; |
||
27 | |||
28 | /** |
||
29 | * Return actions and parameters for a given user. |
||
30 | * |
||
31 | * @param int $user_id |
||
32 | * |
||
33 | * @return array |
||
34 | */ |
||
35 | public function getAllByUser($user_id) |
||
36 | { |
||
37 | $project_ids = $this->projectPermissionModel->getActiveProjectIds($user_id); |
||
0 ignored issues
–
show
|
|||
38 | $actions = []; |
||
39 | |||
40 | if (!empty($project_ids)) { |
||
41 | $actions = $this->db->table(self::TABLE)->in('project_id', $project_ids)->findAll(); |
||
0 ignored issues
–
show
The property
db does not exist on object<Jitamin\Model\ActionModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \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. See also the PhpDoc documentation for @property. ![]() |
|||
42 | $params = $this->actionParameterModel->getAllByActions(array_column($actions, 'id')); |
||
0 ignored issues
–
show
The property
actionParameterModel does not exist on object<Jitamin\Model\ActionModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \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. See also the PhpDoc documentation for @property. ![]() |
|||
43 | $this->attachParamsToActions($actions, $params); |
||
44 | } |
||
45 | |||
46 | return $actions; |
||
47 | } |
||
48 | |||
49 | /** |
||
50 | * Return actions and parameters for a given project. |
||
51 | * |
||
52 | * @param int $project_id |
||
53 | * |
||
54 | * @return array |
||
55 | */ |
||
56 | View Code Duplication | public function getAllByProject($project_id) |
|
0 ignored issues
–
show
This method 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. ![]() |
|||
57 | { |
||
58 | $actions = $this->db->table(self::TABLE)->eq('project_id', $project_id)->findAll(); |
||
0 ignored issues
–
show
The property
db does not exist on object<Jitamin\Model\ActionModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \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. See also the PhpDoc documentation for @property. ![]() |
|||
59 | $params = $this->actionParameterModel->getAllByActions(array_column($actions, 'id')); |
||
0 ignored issues
–
show
The property
actionParameterModel does not exist on object<Jitamin\Model\ActionModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \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. See also the PhpDoc documentation for @property. ![]() |
|||
60 | |||
61 | return $this->attachParamsToActions($actions, $params); |
||
62 | } |
||
63 | |||
64 | /** |
||
65 | * Return all actions and parameters. |
||
66 | * |
||
67 | * @return array |
||
68 | */ |
||
69 | public function getAll() |
||
70 | { |
||
71 | $actions = $this->db->table(self::TABLE)->findAll(); |
||
0 ignored issues
–
show
The property
db does not exist on object<Jitamin\Model\ActionModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \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. See also the PhpDoc documentation for @property. ![]() |
|||
72 | $params = $this->actionParameterModel->getAll(); |
||
0 ignored issues
–
show
The property
actionParameterModel does not exist on object<Jitamin\Model\ActionModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \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. See also the PhpDoc documentation for @property. ![]() |
|||
73 | |||
74 | return $this->attachParamsToActions($actions, $params); |
||
75 | } |
||
76 | |||
77 | /** |
||
78 | * Fetch an action. |
||
79 | * |
||
80 | * @param int $action_id |
||
81 | * |
||
82 | * @return array |
||
83 | */ |
||
84 | View Code Duplication | public function getById($action_id) |
|
0 ignored issues
–
show
This method 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. ![]() |
|||
85 | { |
||
86 | $action = $this->db->table(self::TABLE)->eq('id', $action_id)->findOne(); |
||
0 ignored issues
–
show
The property
db does not exist on object<Jitamin\Model\ActionModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \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. See also the PhpDoc documentation for @property. ![]() |
|||
87 | |||
88 | if (!empty($action)) { |
||
89 | $action['params'] = $this->actionParameterModel->getAllByAction($action_id); |
||
0 ignored issues
–
show
The property
actionParameterModel does not exist on object<Jitamin\Model\ActionModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \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. See also the PhpDoc documentation for @property. ![]() |
|||
90 | } |
||
91 | |||
92 | return $action; |
||
93 | } |
||
94 | |||
95 | /** |
||
96 | * Get the projectId by the actionId. |
||
97 | * |
||
98 | * @param int $action_id |
||
99 | * |
||
100 | * @return int |
||
101 | */ |
||
102 | public function getProjectId($action_id) |
||
103 | { |
||
104 | return $this->db->table(self::TABLE)->eq('id', $action_id)->findOneColumn('project_id') ?: 0; |
||
0 ignored issues
–
show
The property
db does not exist on object<Jitamin\Model\ActionModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \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. See also the PhpDoc documentation for @property. ![]() |
|||
105 | } |
||
106 | |||
107 | /** |
||
108 | * Attach parameters to actions. |
||
109 | * |
||
110 | * @param array &$actions |
||
111 | * @param array &$params |
||
112 | * |
||
113 | * @return array |
||
114 | */ |
||
115 | private function attachParamsToActions(array &$actions, array &$params) |
||
116 | { |
||
117 | foreach ($actions as &$action) { |
||
118 | $action['params'] = isset($params[$action['id']]) ? $params[$action['id']] : []; |
||
119 | } |
||
120 | |||
121 | return $actions; |
||
122 | } |
||
123 | |||
124 | /** |
||
125 | * Remove an action. |
||
126 | * |
||
127 | * @param int $action_id |
||
128 | * |
||
129 | * @return bool |
||
130 | */ |
||
131 | public function remove($action_id) |
||
132 | { |
||
133 | return $this->db->table(self::TABLE)->eq('id', $action_id)->remove(); |
||
0 ignored issues
–
show
The property
db does not exist on object<Jitamin\Model\ActionModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \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. See also the PhpDoc documentation for @property. ![]() |
|||
134 | } |
||
135 | |||
136 | /** |
||
137 | * Create an action. |
||
138 | * |
||
139 | * @param array $values Required parameters to save an action |
||
140 | * |
||
141 | * @return bool|int |
||
142 | */ |
||
143 | public function create(array $values) |
||
144 | { |
||
145 | $this->db->startTransaction(); |
||
0 ignored issues
–
show
The property
db does not exist on object<Jitamin\Model\ActionModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \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. See also the PhpDoc documentation for @property. ![]() |
|||
146 | |||
147 | $action = [ |
||
148 | 'project_id' => $values['project_id'], |
||
149 | 'event_name' => $values['event_name'], |
||
150 | 'action_name' => $values['action_name'], |
||
151 | ]; |
||
152 | |||
153 | if (!$this->db->table(self::TABLE)->insert($action)) { |
||
0 ignored issues
–
show
The property
db does not exist on object<Jitamin\Model\ActionModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \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. See also the PhpDoc documentation for @property. ![]() |
|||
154 | $this->db->cancelTransaction(); |
||
0 ignored issues
–
show
The property
db does not exist on object<Jitamin\Model\ActionModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \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. See also the PhpDoc documentation for @property. ![]() |
|||
155 | |||
156 | return false; |
||
157 | } |
||
158 | |||
159 | $action_id = $this->db->getLastId(); |
||
0 ignored issues
–
show
The property
db does not exist on object<Jitamin\Model\ActionModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \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. See also the PhpDoc documentation for @property. ![]() |
|||
160 | |||
161 | if (!$this->actionParameterModel->create($action_id, $values)) { |
||
0 ignored issues
–
show
The property
actionParameterModel does not exist on object<Jitamin\Model\ActionModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \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. See also the PhpDoc documentation for @property. ![]() |
|||
162 | $this->db->cancelTransaction(); |
||
0 ignored issues
–
show
The property
db does not exist on object<Jitamin\Model\ActionModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \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. See also the PhpDoc documentation for @property. ![]() |
|||
163 | |||
164 | return false; |
||
165 | } |
||
166 | |||
167 | $this->db->closeTransaction(); |
||
0 ignored issues
–
show
The property
db does not exist on object<Jitamin\Model\ActionModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \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. See also the PhpDoc documentation for @property. ![]() |
|||
168 | |||
169 | return $action_id; |
||
170 | } |
||
171 | |||
172 | /** |
||
173 | * Copy actions from a project to another one (skip actions that cannot resolve parameters). |
||
174 | * |
||
175 | * @author Antonio Rabelo |
||
176 | * |
||
177 | * @param int $src_project_id Source project id |
||
178 | * @param int $dst_project_id Destination project id |
||
179 | * |
||
180 | * @return bool |
||
181 | */ |
||
182 | public function duplicate($src_project_id, $dst_project_id) |
||
183 | { |
||
184 | $actions = $this->actionModel->getAllByProject($src_project_id); |
||
0 ignored issues
–
show
The property
actionModel does not exist on object<Jitamin\Model\ActionModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \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. See also the PhpDoc documentation for @property. ![]() |
|||
185 | |||
186 | foreach ($actions as $action) { |
||
187 | $this->db->startTransaction(); |
||
0 ignored issues
–
show
The property
db does not exist on object<Jitamin\Model\ActionModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \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. See also the PhpDoc documentation for @property. ![]() |
|||
188 | |||
189 | $values = [ |
||
190 | 'project_id' => $dst_project_id, |
||
191 | 'event_name' => $action['event_name'], |
||
192 | 'action_name' => $action['action_name'], |
||
193 | ]; |
||
194 | |||
195 | if (!$this->db->table(self::TABLE)->insert($values)) { |
||
0 ignored issues
–
show
The property
db does not exist on object<Jitamin\Model\ActionModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \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. See also the PhpDoc documentation for @property. ![]() |
|||
196 | $this->db->cancelTransaction(); |
||
0 ignored issues
–
show
The property
db does not exist on object<Jitamin\Model\ActionModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \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. See also the PhpDoc documentation for @property. ![]() |
|||
197 | continue; |
||
198 | } |
||
199 | |||
200 | $action_id = $this->db->getLastId(); |
||
0 ignored issues
–
show
The property
db does not exist on object<Jitamin\Model\ActionModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \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. See also the PhpDoc documentation for @property. ![]() |
|||
201 | |||
202 | if (!$this->actionParameterModel->duplicateParameters($dst_project_id, $action_id, $action['params'])) { |
||
0 ignored issues
–
show
The property
actionParameterModel does not exist on object<Jitamin\Model\ActionModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \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. See also the PhpDoc documentation for @property. ![]() |
|||
203 | $this->logger->error('Action::duplicate => skip action '.$action['action_name'].' '.$action['id']); |
||
0 ignored issues
–
show
The property
logger does not exist on object<Jitamin\Model\ActionModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \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. See also the PhpDoc documentation for @property. ![]() |
|||
204 | $this->db->cancelTransaction(); |
||
0 ignored issues
–
show
The property
db does not exist on object<Jitamin\Model\ActionModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \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. See also the PhpDoc documentation for @property. ![]() |
|||
205 | continue; |
||
206 | } |
||
207 | |||
208 | $this->db->closeTransaction(); |
||
0 ignored issues
–
show
The property
db does not exist on object<Jitamin\Model\ActionModel> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \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. See also the PhpDoc documentation for @property. ![]() |
|||
209 | } |
||
210 | |||
211 | return true; |
||
212 | } |
||
213 | } |
||
214 |
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.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.
See also the PhpDoc documentation for @property.