@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | |
| 115 | 115 | /** |
| 116 | 116 | * [onlyXtimes description] |
| 117 | - * @param [type] $times [description] |
|
| 117 | + * @param integer $times [description] |
|
| 118 | 118 | * @return [type] [description] |
| 119 | 119 | */ |
| 120 | 120 | public function onlyXtimes($times) |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | |
| 138 | 138 | /** |
| 139 | 139 | * [withPriority description] |
| 140 | - * @param [type] $priority [description] |
|
| 140 | + * @param integer $priority [description] |
|
| 141 | 141 | * @return [type] [description] |
| 142 | 142 | */ |
| 143 | 143 | public function withPriority($priority) |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | namespace Silk\Models\Exceptions; |
| 4 | 4 | |
| 5 | 5 | use WP_Post; |
| 6 | -use Silk\Models\Post; |
|
| 7 | 6 | |
| 8 | 7 | class ModelPostTypeMismatchException extends \RuntimeException |
| 9 | 8 | { |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | ], [ |
| 26 | 26 | $this->modelClass, |
| 27 | 27 | $this->post->post_type, |
| 28 | - constant($this->modelClass . '::POST_TYPE') |
|
| 28 | + constant($this->modelClass.'::POST_TYPE') |
|
| 29 | 29 | ], static::MESSAGE_FORMAT); |
| 30 | 30 | } |
| 31 | 31 | } |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | * |
| 151 | 151 | * If trash is disabled, the post or page is permanently deleted. |
| 152 | 152 | * |
| 153 | - * @return false|array|WP_Post|null Post data array, otherwise false. |
|
| 153 | + * @return Post Post data array, otherwise false. |
|
| 154 | 154 | */ |
| 155 | 155 | public function trash() |
| 156 | 156 | { |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | /** |
| 165 | 165 | * Restore a post or page from the Trash |
| 166 | 166 | * |
| 167 | - * @return WP_Post|false WP_Post object. False on failure. |
|
| 167 | + * @return Post WP_Post object. False on failure. |
|
| 168 | 168 | */ |
| 169 | 169 | public function untrash() |
| 170 | 170 | { |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | */ |
| 39 | 39 | public function __construct(WP_Post $post = null) |
| 40 | 40 | { |
| 41 | - if (! $post) { |
|
| 41 | + if ( ! $post) { |
|
| 42 | 42 | $post = new WP_Post(new stdClass); |
| 43 | 43 | $post->post_type = static::POST_TYPE; |
| 44 | 44 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | 'posts_per_page' => 1 |
| 91 | 91 | ]); |
| 92 | 92 | |
| 93 | - if (! $post = reset($posts)) { |
|
| 93 | + if ( ! $post = reset($posts)) { |
|
| 94 | 94 | throw new PostNotFoundException("No post found with slug {$slug}"); |
| 95 | 95 | } |
| 96 | 96 | |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | { |
| 107 | 107 | $post = get_post(); |
| 108 | 108 | |
| 109 | - if (! $post instanceof WP_Post) { |
|
| 109 | + if ( ! $post instanceof WP_Post) { |
|
| 110 | 110 | throw new PostNotFoundException('Global $post not an instance of WP_Post'); |
| 111 | 111 | } |
| 112 | 112 | |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | */ |
| 215 | 215 | public function save() |
| 216 | 216 | { |
| 217 | - if (! $this->id) { |
|
| 217 | + if ( ! $this->id) { |
|
| 218 | 218 | $result = wp_insert_post($this->post->to_array(), true); |
| 219 | 219 | } else { |
| 220 | 220 | $result = wp_update_post($this->post, true); |
@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | use Silk\Hook; |
| 4 | 4 | |
| 5 | -if (! function_exists('on')) : |
|
| 5 | +if ( ! function_exists('on')) : |
|
| 6 | 6 | /** |
| 7 | 7 | * Create and set a new event listener |
| 8 | 8 | * |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | } |
| 20 | 20 | endif; |
| 21 | 21 | |
| 22 | -if (! function_exists('off')) : |
|
| 22 | +if ( ! function_exists('off')) : |
|
| 23 | 23 | /** |
| 24 | 24 | * Remove an event listener |
| 25 | 25 | * |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | return $removed; |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | - return on($handle, function ($given = null) use ($handle, $callback, $priority) { |
|
| 38 | + return on($handle, function($given = null) use ($handle, $callback, $priority) { |
|
| 39 | 39 | remove_filter($handle, $callback, $priority); |
| 40 | 40 | return $given; |
| 41 | 41 | })->withPriority($priority - 1); |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | 20 | * @param string $type Meta type |
| 21 | - * @param int|string $object_id ID of the object metadata is for |
|
| 21 | + * @param integer $object_id ID of the object metadata is for |
|
| 22 | 22 | * @param string $key Meta key |
| 23 | 23 | */ |
| 24 | 24 | public function __construct($type, $object_id, $key) |