@@ -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 | { |
@@ -2,9 +2,7 @@ |
||
2 | 2 | |
3 | 3 | namespace Silk\Models; |
4 | 4 | |
5 | -use stdClass; |
|
6 | 5 | use WP_Post; |
7 | -use Illuminate\Support\Collection; |
|
8 | 6 | use Silk\WP_ErrorException; |
9 | 7 | use Silk\Meta\ObjectMeta; |
10 | 8 | use Silk\Models\Exceptions\PostNotFoundException; |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public function __construct(WP_Post $post = null) |
39 | 39 | { |
40 | - if (! $post) { |
|
40 | + if ( ! $post) { |
|
41 | 41 | $post = new WP_Post(new StdClass); |
42 | 42 | $post->post_type = static::POST_TYPE; |
43 | 43 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | 'posts_per_page' => 1 |
90 | 90 | ]); |
91 | 91 | |
92 | - if (! $post = reset($posts)) { |
|
92 | + if ( ! $post = reset($posts)) { |
|
93 | 93 | throw new PostNotFoundException("No post found with slug {$slug}"); |
94 | 94 | } |
95 | 95 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | { |
106 | 106 | $post = get_post(); |
107 | 107 | |
108 | - if (! $post instanceof WP_Post) { |
|
108 | + if ( ! $post instanceof WP_Post) { |
|
109 | 109 | throw new PostNotFoundException('Global $post not an instance of WP_Post'); |
110 | 110 | } |
111 | 111 | |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | */ |
213 | 213 | public function save() |
214 | 214 | { |
215 | - if (! $this->id) { |
|
215 | + if ( ! $this->id) { |
|
216 | 216 | $result = wp_insert_post($this->post->to_array(), true); |
217 | 217 | } else { |
218 | 218 | $result = wp_update_post($this->post, true); |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | return $this->post->$property; |
247 | 247 | } |
248 | 248 | |
249 | - throw new \InvalidArgumentException(static::class . " has no property: {$property}"); |
|
249 | + throw new \InvalidArgumentException(static::class." has no property: {$property}"); |
|
250 | 250 | } |
251 | 251 | |
252 | 252 | /** |
@@ -35,7 +35,7 @@ |
||
35 | 35 | */ |
36 | 36 | public function get($key = '') |
37 | 37 | { |
38 | - if (! $this->key && $key) { |
|
38 | + if ( ! $this->key && $key) { |
|
39 | 39 | return new static($this->type, $this->object_id, $key); |
40 | 40 | } |
41 | 41 |
@@ -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); |