@@ -32,7 +32,7 @@ |
||
32 | 32 | protected function addActionOnDelete(BaseAction $action) |
33 | 33 | { |
34 | 34 | // no cascade delete? treat it as a save |
35 | - if (! $this->isCascade()) { |
|
35 | + if (!$this->isCascade()) { |
|
36 | 36 | $this->addActionOnSave($action); |
37 | 37 | } else { |
38 | 38 | $nativeEntity = $action->getEntity(); |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | protected function setOptionIfMissing($name, $value) |
63 | 63 | { |
64 | - if (! isset($this->options[$name])) { |
|
64 | + if (!isset($this->options[$name])) { |
|
65 | 65 | $this->options[$name] = $value; |
66 | 66 | } |
67 | 67 | } |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | |
131 | 131 | public function addActions(BaseAction $action) |
132 | 132 | { |
133 | - if (! $this->cascadeIsAllowedForAction($action)) { |
|
133 | + if (!$this->cascadeIsAllowedForAction($action)) { |
|
134 | 134 | return; |
135 | 135 | } |
136 | 136 | |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | protected function cascadeIsAllowedForAction(BaseAction $action) |
200 | 200 | { |
201 | 201 | $relations = $action->getOption('relations'); |
202 | - if (is_array($relations) && ! in_array($this->name, $relations)) { |
|
202 | + if (is_array($relations) && !in_array($this->name, $relations)) { |
|
203 | 203 | return false; |
204 | 204 | } |
205 | 205 | |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | */ |
218 | 218 | protected function getRemainingRelations($relations) |
219 | 219 | { |
220 | - if (! is_array($relations)) { |
|
220 | + if (!is_array($relations)) { |
|
221 | 221 | return $relations; |
222 | 222 | } |
223 | 223 | |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | if (is_array($guards)) { |
234 | 234 | foreach ($guards as $col => $val) { |
235 | 235 | // guards that are strings (eg: 'deleted_at is null') can't be used as extra columns |
236 | - if (! is_int($col)) { |
|
236 | + if (!is_int($col)) { |
|
237 | 237 | $cols[$col] = $val; |
238 | 238 | } |
239 | 239 | } |
@@ -35,7 +35,7 @@ |
||
35 | 35 | |
36 | 36 | public function revert() |
37 | 37 | { |
38 | - if (! $this->hasRun) { |
|
38 | + if (!$this->hasRun) { |
|
39 | 39 | return; |
40 | 40 | } |
41 | 41 | $this->entity->setPK($this->entityId); |
@@ -98,12 +98,12 @@ discard block |
||
98 | 98 | |
99 | 99 | protected function addActionsForRelatedEntities() |
100 | 100 | { |
101 | - if ($this->getOption('relations') === false || ! $this->mapper) { |
|
101 | + if ($this->getOption('relations') === false || !$this->mapper) { |
|
102 | 102 | return; |
103 | 103 | } |
104 | 104 | |
105 | 105 | foreach ($this->getMapper()->getRelations() as $name) { |
106 | - if (! $this->mapper->hasRelation($name)) { |
|
106 | + if (!$this->mapper->hasRelation($name)) { |
|
107 | 107 | continue; |
108 | 108 | } |
109 | 109 | $this->mapper->getRelation($name)->addActions($this); |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | /** @var ActionInterface $action */ |
141 | 141 | foreach ($executed as $action) { |
142 | 142 | // if called by another action, that action will call `onSuccess` |
143 | - if (! $calledByAnotherAction || $action !== $this) { |
|
143 | + if (!$calledByAnotherAction || $action !== $this) { |
|
144 | 144 | $action->onSuccess(); |
145 | 145 | } |
146 | 146 | } |
@@ -10,7 +10,7 @@ |
||
10 | 10 | public static function new(...$args) |
11 | 11 | { |
12 | 12 | if ($args[0] instanceof Connection) { |
13 | - return new ConnectionLocator(function () use ($args) { |
|
13 | + return new ConnectionLocator(function() use ($args) { |
|
14 | 14 | return $args[0]; |
15 | 15 | }); |
16 | 16 | } |
@@ -26,7 +26,7 @@ |
||
26 | 26 | if (strpos($key, $separator)) { |
27 | 27 | $parents = static::getParents($key, $separator); |
28 | 28 | foreach ($parents as $parent) { |
29 | - if (! isset($arr[$parent])) { |
|
29 | + if (!isset($arr[$parent])) { |
|
30 | 30 | $arr[$parent] = null; |
31 | 31 | } |
32 | 32 | } |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | |
16 | 16 | public static function underscore($str) |
17 | 17 | { |
18 | - if (! isset(static::$cache['underscore'][$str])) { |
|
18 | + if (!isset(static::$cache['underscore'][$str])) { |
|
19 | 19 | $str = strtolower($str); |
20 | 20 | $str = preg_replace("/[^a-z0-9]+/", ' ', $str); |
21 | 21 | |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | public static function methodName($str, $verb) |
29 | 29 | { |
30 | 30 | $key = $verb . $str; |
31 | - if (! isset(static::$cache['methodName'][$key])) { |
|
31 | + if (!isset(static::$cache['methodName'][$key])) { |
|
32 | 32 | static::$cache['methodName'][$key] = strtolower($verb) . static::className($str); |
33 | 33 | } |
34 | 34 | |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | public static function variableName($str) |
39 | 39 | { |
40 | - if (! isset(static::$cache['variableName'][$str])) { |
|
40 | + if (!isset(static::$cache['variableName'][$str])) { |
|
41 | 41 | $class = static::className($str); |
42 | 42 | |
43 | 43 | static::$cache['variableName'][$str] = strtolower(substr($class, 0, 1)) . substr($class, 1); |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | public static function className($str) |
50 | 50 | { |
51 | - if (! isset(static::$cache['className'][$str])) { |
|
51 | + if (!isset(static::$cache['className'][$str])) { |
|
52 | 52 | $str = strtolower($str); |
53 | 53 | $str = preg_replace("/[^a-z0-9]+/", ' ', $str); |
54 | 54 | $str = ucwords($str); |
@@ -77,7 +77,7 @@ |
||
77 | 77 | /** @var ArrayCollection $changeCollection */ |
78 | 78 | $changeCollection = $this->changes[$t]; |
79 | 79 | if ($t == $type) { |
80 | - if (! $changeCollection->contains($element)) { |
|
80 | + if (!$changeCollection->contains($element)) { |
|
81 | 81 | $changeCollection->add($element); |
82 | 82 | } |
83 | 83 | } else { |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | |
46 | 46 | public function setRelation($name, Relation $relation, $callback, $overwrite = false) |
47 | 47 | { |
48 | - if ($overwrite || ! isset($this->relations[$name])) { |
|
48 | + if ($overwrite || !isset($this->relations[$name])) { |
|
49 | 49 | $this->relations[$name] = $relation; |
50 | 50 | $this->relationCallbacks[$name] = $callback; |
51 | 51 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | |
64 | 64 | public function getRelationResults($name) |
65 | 65 | { |
66 | - if (! isset($this->relations[$name])) { |
|
66 | + if (!isset($this->relations[$name])) { |
|
67 | 67 | return null; |
68 | 68 | } |
69 | 69 |