@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | |
110 | 110 | // check the if the requester has the `create` |
111 | 111 | // permission before creating |
112 | - static::creating(function (ModelEvent $event) { |
|
112 | + static::creating(function(ModelEvent $event) { |
|
113 | 113 | $model = $event->getModel(); |
114 | 114 | |
115 | 115 | if (!$model->can('create', ACLModel::getRequester())) { |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | |
122 | 122 | // check the if the requester has the `edit` |
123 | 123 | // permission before updating |
124 | - static::updating(function (ModelEvent $event) { |
|
124 | + static::updating(function(ModelEvent $event) { |
|
125 | 125 | $model = $event->getModel(); |
126 | 126 | |
127 | 127 | if (!$model->can('edit', ACLModel::getRequester())) { |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | |
134 | 134 | // check the if the requester has the `delete` |
135 | 135 | // permission before deleting |
136 | - static::deleting(function (ModelEvent $event) { |
|
136 | + static::deleting(function(ModelEvent $event) { |
|
137 | 137 | $model = $event->getModel(); |
138 | 138 | |
139 | 139 | if (!$model->can('delete', ACLModel::getRequester())) { |
@@ -272,7 +272,6 @@ discard block |
||
272 | 272 | /** |
273 | 273 | * Returns a prefixed where statement. |
274 | 274 | * |
275 | - * @param string $columns |
|
276 | 275 | * @param string $tablename |
277 | 276 | * |
278 | 277 | * @return array |
@@ -300,7 +299,6 @@ discard block |
||
300 | 299 | /** |
301 | 300 | * Returns a prefixed sort statement. |
302 | 301 | * |
303 | - * @param string $columns |
|
304 | 302 | * @param string $tablename |
305 | 303 | * |
306 | 304 | * @return array |
@@ -45,8 +45,8 @@ discard block |
||
45 | 45 | |
46 | 46 | try { |
47 | 47 | return $db->insert($values) |
48 | - ->into($tablename) |
|
49 | - ->execute() instanceof PDOStatement; |
|
48 | + ->into($tablename) |
|
49 | + ->execute() instanceof PDOStatement; |
|
50 | 50 | } catch (PDOException $original) { |
51 | 51 | $e = new DriverException('An error occurred in the database driver when creating the '.$model::modelName().': '.$original->getMessage()); |
52 | 52 | $e->setException($original); |
@@ -74,9 +74,9 @@ discard block |
||
74 | 74 | |
75 | 75 | try { |
76 | 76 | $row = $db->select('*') |
77 | - ->from($tablename) |
|
78 | - ->where($model->ids()) |
|
79 | - ->one(); |
|
77 | + ->from($tablename) |
|
78 | + ->where($model->ids()) |
|
79 | + ->one(); |
|
80 | 80 | } catch (PDOException $original) { |
81 | 81 | $e = new DriverException('An error occurred in the database driver when loading an instance of '.$model::modelName().': '.$original->getMessage()); |
82 | 82 | $e->setException($original); |
@@ -102,9 +102,9 @@ discard block |
||
102 | 102 | |
103 | 103 | try { |
104 | 104 | return $db->update($tablename) |
105 | - ->values($values) |
|
106 | - ->where($model->ids()) |
|
107 | - ->execute() instanceof PDOStatement; |
|
105 | + ->values($values) |
|
106 | + ->where($model->ids()) |
|
107 | + ->execute() instanceof PDOStatement; |
|
108 | 108 | } catch (PDOException $original) { |
109 | 109 | $e = new DriverException('An error occurred in the database driver when updating the '.$model::modelName().': '.$original->getMessage()); |
110 | 110 | $e->setException($original); |
@@ -119,8 +119,8 @@ discard block |
||
119 | 119 | |
120 | 120 | try { |
121 | 121 | return $db->delete($tablename) |
122 | - ->where($model->ids()) |
|
123 | - ->execute() instanceof PDOStatement; |
|
122 | + ->where($model->ids()) |
|
123 | + ->execute() instanceof PDOStatement; |
|
124 | 124 | } catch (PDOException $original) { |
125 | 125 | $e = new DriverException('An error occurred in the database driver while deleting the '.$model::modelName().': '.$original->getMessage()); |
126 | 126 | $e->setException($original); |
@@ -260,13 +260,13 @@ |
||
260 | 260 | { |
261 | 261 | static::$properties = array_replace(self::$timestampProperties, static::$properties); |
262 | 262 | |
263 | - self::creating(function (ModelEvent $event) { |
|
263 | + self::creating(function(ModelEvent $event) { |
|
264 | 264 | $model = $event->getModel(); |
265 | 265 | $model->created_at = time(); |
266 | 266 | $model->updated_at = time(); |
267 | 267 | }); |
268 | 268 | |
269 | - self::updating(function (ModelEvent $event) { |
|
269 | + self::updating(function(ModelEvent $event) { |
|
270 | 270 | $event->getModel()->updated_at = time(); |
271 | 271 | }); |
272 | 272 | } |
@@ -181,7 +181,6 @@ discard block |
||
181 | 181 | /** |
182 | 182 | * Validates an e-mail address. |
183 | 183 | * |
184 | - * @param string $email e-mail address |
|
185 | 184 | * @param array $parameters parameters for validation |
186 | 185 | * |
187 | 186 | * @return bool success |
@@ -213,7 +212,7 @@ discard block |
||
213 | 212 | * |
214 | 213 | * @param mixed $value |
215 | 214 | * |
216 | - * @return bool |
|
215 | + * @return integer |
|
217 | 216 | */ |
218 | 217 | private function date(&$value) |
219 | 218 | { |
@@ -487,7 +487,7 @@ |
||
487 | 487 | |
488 | 488 | $in = $foreignKey.' IN ('.implode(',', $uniqueIds).')'; |
489 | 489 | $models = $modelClass::where($in) |
490 | - ->first(self::MAX_LIMIT); |
|
490 | + ->first(self::MAX_LIMIT); |
|
491 | 491 | |
492 | 492 | $result = []; |
493 | 493 | foreach ($models as $model) { |