@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | * Set the object's URL slug pattern. |
| 88 | 88 | * |
| 89 | 89 | * @param mixed $pattern The slug pattern. |
| 90 | - * @return RoutableInterface Chainable |
|
| 90 | + * @return RoutableTrait Chainable |
|
| 91 | 91 | */ |
| 92 | 92 | public function setSlugPattern($pattern) |
| 93 | 93 | { |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | * Set the object's URL slug. |
| 194 | 194 | * |
| 195 | 195 | * @param mixed $slug The slug. |
| 196 | - * @return RoutableInterface Chainable |
|
| 196 | + * @return RoutableTrait Chainable |
|
| 197 | 197 | */ |
| 198 | 198 | public function setSlug($slug) |
| 199 | 199 | { |
@@ -677,7 +677,7 @@ discard block |
||
| 677 | 677 | * |
| 678 | 678 | * @param string $className The class name of the object route model. |
| 679 | 679 | * @throws InvalidArgumentException If the class name is not a string. |
| 680 | - * @return AbstractPropertyDisplay Chainable |
|
| 680 | + * @return RoutableTrait Chainable |
|
| 681 | 681 | */ |
| 682 | 682 | protected function setObjectRouteClass($className) |
| 683 | 683 | { |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | if ($this instanceof ViewableInterface && $this->view() !== null) { |
| 284 | 284 | $route = $this->view()->render($pattern, $this->viewController()); |
| 285 | 285 | } else { |
| 286 | - $route = preg_replace_callback('~\{\{\s*(.*?)\s*\}\}~i', [ $this, 'parseRouteToken' ], $pattern); |
|
| 286 | + $route = preg_replace_callback('~\{\{\s*(.*?)\s*\}\}~i', [$this, 'parseRouteToken'], $pattern); |
|
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 | return $this->slugify($route); |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | $token = trim($token); |
| 309 | - $method = [ $this, $token ]; |
|
| 309 | + $method = [$this, $token]; |
|
| 310 | 310 | |
| 311 | 311 | if (is_callable($method)) { |
| 312 | 312 | $value = call_user_func($method); |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | 'route_options' => $newData['route_options'], |
| 424 | 424 | 'route_options_ident' => $newData['route_options_ident'], |
| 425 | 425 | ]); |
| 426 | - $oldRoute->update([ 'route_template', 'route_options' ]); |
|
| 426 | + $oldRoute->update(['route_template', 'route_options']); |
|
| 427 | 427 | |
| 428 | 428 | continue; |
| 429 | 429 | } |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | /** |
| 288 | 288 | * Set the route's last creation date. |
| 289 | 289 | * |
| 290 | - * @param string|DateTimeInterface|null $time The date/time value. |
|
| 290 | + * @param string $time The date/time value. |
|
| 291 | 291 | * @throws InvalidArgumentException If the date/time value is invalid. |
| 292 | 292 | * @return self |
| 293 | 293 | */ |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | /** |
| 324 | 324 | * Set the route's last modification date. |
| 325 | 325 | * |
| 326 | - * @param string|DateTimeInterface|null $time The date/time value. |
|
| 326 | + * @param string $time The date/time value. |
|
| 327 | 327 | * @throws InvalidArgumentException If the date/time value is invalid. |
| 328 | 328 | * @return self |
| 329 | 329 | */ |
@@ -4,7 +4,6 @@ discard block |
||
| 4 | 4 | use DateTime; |
| 5 | 5 | use DateTimeInterface; |
| 6 | 6 | use InvalidArgumentException; |
| 7 | -use RuntimeException; |
|
| 8 | 7 | use Exception; |
| 9 | 8 | |
| 10 | 9 | // From Pimple |
@@ -12,13 +11,10 @@ discard block |
||
| 12 | 11 | |
| 13 | 12 | // From 'charcoal-core' |
| 14 | 13 | use Charcoal\Model\AbstractModel; |
| 15 | -use Charcoal\Loader\CollectionLoader; |
|
| 16 | - |
|
| 17 | 14 | use Charcoal\Model\ModelFactoryTrait; |
| 18 | 15 | use Charcoal\Loader\CollectionLoaderAwareTrait; |
| 19 | 16 | |
| 20 | 17 | // From 'charcoal-factory' |
| 21 | -use Charcoal\Factory\FactoryInterface; |
|
| 22 | 18 | |
| 23 | 19 | // From 'charcoal-object' |
| 24 | 20 | use Charcoal\Object\ObjectRouteInterface; |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | /** |
| 282 | 282 | * @param integer $page The current page. Start at 0. |
| 283 | 283 | * @throws InvalidArgumentException If the parameter is not numeric or < 0. |
| 284 | - * @return Pagination (Chainable) |
|
| 284 | + * @return HierarchicalCollection (Chainable) |
|
| 285 | 285 | */ |
| 286 | 286 | public function setPage($page) |
| 287 | 287 | { |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | /** |
| 315 | 315 | * @param integer $num The number of results to retrieve, per page. |
| 316 | 316 | * @throws InvalidArgumentException If the parameter is not numeric or < 0. |
| 317 | - * @return Pagination (Chainable) |
|
| 317 | + * @return HierarchicalCollection (Chainable) |
|
| 318 | 318 | */ |
| 319 | 319 | public function setNumPerPage($num) |
| 320 | 320 | { |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | // Repair bad hierarchy. |
| 74 | 74 | if ($object->hasMaster() && $object->getMaster() === $object->id()) { |
| 75 | 75 | $object->setMaster(0); |
| 76 | - $object->update([ 'master' ]); |
|
| 76 | + $object->update(['master']); |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | if ($object->hasMaster()) { |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | 114 | } else { |
| 115 | - $start = (( $pageNum - 1 ) * $perPage); |
|
| 115 | + $start = (($pageNum - 1) * $perPage); |
|
| 116 | 116 | $end = ($start + $perPage); |
| 117 | 117 | |
| 118 | 118 | foreach ($this->objects as $object) { |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | } |
| 226 | 226 | } |
| 227 | 227 | } else { |
| 228 | - $start = (( $pageNum - 1 ) * $perPage); |
|
| 228 | + $start = (($pageNum - 1) * $perPage); |
|
| 229 | 229 | $end = ($start + $perPage); |
| 230 | 230 | |
| 231 | 231 | foreach ($childObjects[$parentObj->id()] as $object) { |
@@ -259,7 +259,7 @@ |
||
| 259 | 259 | /** |
| 260 | 260 | * Set the date/time the item was processed at. |
| 261 | 261 | * |
| 262 | - * @param null|string|DateTimeInterface $ts A date/time string or object. |
|
| 262 | + * @param string $ts A date/time string or object. |
|
| 263 | 263 | * @throws InvalidArgumentException If the date/time is invalid. |
| 264 | 264 | * @return ObjectScheduleInterface Chainable |
| 265 | 265 | */ |
@@ -371,7 +371,7 @@ |
||
| 371 | 371 | if ($update) { |
| 372 | 372 | $this->setProcessed(true); |
| 373 | 373 | $this->setProcessedDate('now'); |
| 374 | - $this->update([ 'processed', 'processed_date' ]); |
|
| 374 | + $this->update(['processed', 'processed_date']); |
|
| 375 | 375 | |
| 376 | 376 | if ($successCallback !== null) { |
| 377 | 377 | $successCallback($this); |
@@ -195,7 +195,7 @@ |
||
| 195 | 195 | /** |
| 196 | 196 | * Set when the object was created. |
| 197 | 197 | * |
| 198 | - * @param DateTimeInterface|string|null $timestamp The timestamp at object's creation. |
|
| 198 | + * @param string $timestamp The timestamp at object's creation. |
|
| 199 | 199 | * NULL is accepted and instances of DateTimeInterface are recommended; |
| 200 | 200 | * any other value will be converted (if possible) into one. |
| 201 | 201 | * @throws InvalidArgumentException If the timestamp is invalid. |
@@ -197,7 +197,7 @@ |
||
| 197 | 197 | $now = new DateTime(); |
| 198 | 198 | $publish = $this->getPublishDate(); |
| 199 | 199 | $expiry = $this->getExpiryDate(); |
| 200 | - $status = $this->getPublishStatus() ; |
|
| 200 | + $status = $this->getPublishStatus(); |
|
| 201 | 201 | |
| 202 | 202 | if ($status !== static::STATUS_PUBLISHED) { |
| 203 | 203 | return $status; |
@@ -158,7 +158,7 @@ |
||
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | /** |
| 161 | - * @param mixed $revTs The revision's timestamp. |
|
| 161 | + * @param string $revTs The revision's timestamp. |
|
| 162 | 162 | * @throws InvalidArgumentException If the timestamp is invalid. |
| 163 | 163 | * @return ObjectRevision Chainable |
| 164 | 164 | */ |
@@ -10,7 +10,6 @@ |
||
| 10 | 10 | use Pimple\Container; |
| 11 | 11 | |
| 12 | 12 | // From 'charcoal-factory' |
| 13 | -use Charcoal\Factory\FactoryInterface; |
|
| 14 | 13 | |
| 15 | 14 | // From 'charcoal-core' |
| 16 | 15 | use Charcoal\Model\AbstractModel; |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | 35 | * @param boolean $enabled The (revision) enabled flag. |
| 36 | - * @return RevisionableInterface Chainable |
|
| 36 | + * @return RevisionableTrait Chainable |
|
| 37 | 37 | */ |
| 38 | 38 | public function setRevisionEnabled($enabled) |
| 39 | 39 | { |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | * |
| 67 | 67 | * @param string $className The class name of the object revision model. |
| 68 | 68 | * @throws InvalidArgumentException If the class name is not a string. |
| 69 | - * @return AbstractPropertyDisplay Chainable |
|
| 69 | + * @return RevisionableTrait Chainable |
|
| 70 | 70 | */ |
| 71 | 71 | protected function setObjectRevisionClass($className) |
| 72 | 72 | { |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | * |
| 61 | 61 | * The object's hierarchy can be rebuilt with {@see self::hierarchy()}. |
| 62 | 62 | * |
| 63 | - * @return HierarchicalInterface Chainable |
|
| 63 | + * @return HierarchicalTrait Chainable |
|
| 64 | 64 | */ |
| 65 | 65 | public function resetHierarchy() |
| 66 | 66 | { |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | * Set this object's immediate parent. |
| 74 | 74 | * |
| 75 | 75 | * @param mixed $master The object's parent (or master). |
| 76 | - * @return HierarchicalInterface Chainable |
|
| 76 | + * @return HierarchicalTrait Chainable |
|
| 77 | 77 | */ |
| 78 | 78 | public function setMaster($master) |
| 79 | 79 | { |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | |
| 293 | 293 | /** |
| 294 | 294 | * @param array $children The children to set. |
| 295 | - * @return HierarchicalInterface Chainable |
|
| 295 | + * @return HierarchicalTrait Chainable |
|
| 296 | 296 | */ |
| 297 | 297 | public function setChildren(array $children) |
| 298 | 298 | { |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | |
| 307 | 307 | /** |
| 308 | 308 | * @param mixed $child The child object (or ident) to add. |
| 309 | - * @return HierarchicalInterface Chainable |
|
| 309 | + * @return HierarchicalTrait Chainable |
|
| 310 | 310 | * @throws UnexpectedValueException The current object cannot be its own child. |
| 311 | 311 | */ |
| 312 | 312 | public function addChild($child) |
@@ -511,7 +511,7 @@ discard block |
||
| 511 | 511 | * Add an object to the cache store. |
| 512 | 512 | * |
| 513 | 513 | * @param ModelInterface $obj The object to store. |
| 514 | - * @return HierarchicalInterface Chainable |
|
| 514 | + * @return HierarchicalTrait Chainable |
|
| 515 | 515 | */ |
| 516 | 516 | private function addObjectToCache(ModelInterface $obj) |
| 517 | 517 | { |