@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | { |
44 | 44 | foreach ($scopes as $scope) { |
45 | 45 | if (!($scope instanceof Scope)) { |
46 | - throw new SimpleMapperException('Scopes can be only of class ' . Scope::class); |
|
46 | + throw new SimpleMapperException('Scopes can be only of class '.Scope::class); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | $this->data[$table]['scopes'][$scope->getName()] = $scope; |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | * @param string $scope |
93 | 93 | * @return Scope|null |
94 | 94 | */ |
95 | - public function getScope(string $table, string $scope): ?Scope |
|
95 | + public function getScope(string $table, string $scope): ? Scope |
|
96 | 96 | { |
97 | 97 | return isset($this->data[$table]['scopes'][$scope]) |
98 | 98 | ? $this->data[$table]['scopes'][$scope] |
@@ -39,5 +39,5 @@ |
||
39 | 39 | * @param string $scope |
40 | 40 | * @return Scope|null |
41 | 41 | */ |
42 | - public function getScope(string $table, string $scope): ?Scope; |
|
42 | + public function getScope(string $table, string $scope): ? Scope; |
|
43 | 43 | } |
@@ -61,12 +61,12 @@ |
||
61 | 61 | $scopeName = lcfirst(substr($name, 5)); |
62 | 62 | $scope = $this->structure->getScope($this->selection->getName(), $scopeName); |
63 | 63 | if (!$scope) { |
64 | - trigger_error('Scope ' . $scopeName . ' is not defined for table ' . $this->selection->getName(), E_USER_ERROR); |
|
64 | + trigger_error('Scope '.$scopeName.' is not defined for table '.$this->selection->getName(), E_USER_ERROR); |
|
65 | 65 | } |
66 | 66 | return $this->where(call_user_func_array($scope->getCallback(), $arguments)); |
67 | 67 | } |
68 | 68 | |
69 | - trigger_error('Call to undefined method ' . get_class($this) . '::' . $name . '()', E_USER_ERROR); |
|
69 | + trigger_error('Call to undefined method '.get_class($this).'::'.$name.'()', E_USER_ERROR); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | /**********************************************************************\ |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | * @param string $class |
88 | 88 | * @return Behaviour|null |
89 | 89 | */ |
90 | - public function getBehaviour($class): ?Behaviour |
|
90 | + public function getBehaviour($class): ? Behaviour |
|
91 | 91 | { |
92 | 92 | return $this->behaviours[$class] ?? null; |
93 | 93 | } |
@@ -125,14 +125,14 @@ discard block |
||
125 | 125 | $scopeName = lcfirst(substr($name, 5)); |
126 | 126 | $scope = $this->structure->getScope(static::$tableName, $scopeName); |
127 | 127 | if (!$scope) { |
128 | - trigger_error('Scope ' . $scopeName . ' is not defined for table ' . static::$tableName, E_USER_ERROR); |
|
128 | + trigger_error('Scope '.$scopeName.' is not defined for table '.static::$tableName, E_USER_ERROR); |
|
129 | 129 | } |
130 | 130 | |
131 | - $scopeNameToCall = 'scope' . ucfirst($scope->getName()); |
|
131 | + $scopeNameToCall = 'scope'.ucfirst($scope->getName()); |
|
132 | 132 | return call_user_func_array([$this->findAll(), $scopeNameToCall], $arguments); |
133 | 133 | } |
134 | 134 | |
135 | - trigger_error('Call to undefined method ' . get_class($this) . '::' . $name . '()', E_USER_ERROR); |
|
135 | + trigger_error('Call to undefined method '.get_class($this).'::'.$name.'()', E_USER_ERROR); |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | /********************************************************************\ |
@@ -186,9 +186,9 @@ discard block |
||
186 | 186 | * @return ActiveRow|null |
187 | 187 | * @throws Exception |
188 | 188 | */ |
189 | - public function insert(array $data): ?ActiveRow |
|
189 | + public function insert(array $data): ? ActiveRow |
|
190 | 190 | { |
191 | - $result = $this->transaction(function () use ($data) { |
|
191 | + $result = $this->transaction(function() use ($data) { |
|
192 | 192 | foreach ($this->behaviours as $behaviour) { |
193 | 193 | $data = $behaviour->beforeInsert($data); |
194 | 194 | } |
@@ -216,9 +216,9 @@ discard block |
||
216 | 216 | * @param array $data |
217 | 217 | * @return ActiveRow|null |
218 | 218 | */ |
219 | - public function update(ActiveRow $record, array $data): ?ActiveRow |
|
219 | + public function update(ActiveRow $record, array $data): ? ActiveRow |
|
220 | 220 | { |
221 | - $result = $this->transaction(function () use ($record, $data) { |
|
221 | + $result = $this->transaction(function() use ($record, $data) { |
|
222 | 222 | $oldRecord = clone $record; |
223 | 223 | |
224 | 224 | foreach ($this->behaviours as $behaviour) { |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | */ |
245 | 245 | public function delete(ActiveRow $record): bool |
246 | 246 | { |
247 | - $result = $this->transaction(function () use ($record): bool { |
|
247 | + $result = $this->transaction(function() use ($record): bool { |
|
248 | 248 | $oldRecord = clone $record; |
249 | 249 | |
250 | 250 | foreach ($this->behaviours as $behaviour) { |