@@ -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) |
@@ -47,10 +47,10 @@ |
||
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
50 | - * Render the shortcode to string |
|
51 | - * |
|
52 | - * @return string |
|
53 | - */ |
|
50 | + * Render the shortcode to string |
|
51 | + * |
|
52 | + * @return string |
|
53 | + */ |
|
54 | 54 | public function render() |
55 | 55 | { |
56 | 56 | $dedicated_method = "{$this->tag}_handler"; |
@@ -69,7 +69,7 @@ |
||
69 | 69 | */ |
70 | 70 | protected function handler() |
71 | 71 | { |
72 | - return ''; // Override this in a sub-class |
|
72 | + return ''; // Override this in a sub-class |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |
@@ -73,7 +73,7 @@ |
||
73 | 73 | $modelClass = $this->model ? get_class($this->model) : Post::class; |
74 | 74 | |
75 | 75 | return Collection::make($this->query->get_posts()) |
76 | - ->map(function ($post) use ($modelClass) { |
|
76 | + ->map(function($post) use ($modelClass) { |
|
77 | 77 | return new $modelClass($post); |
78 | 78 | }); |
79 | 79 | } |
@@ -80,7 +80,7 @@ |
||
80 | 80 | */ |
81 | 81 | public function mediateCallback($given = null) |
82 | 82 | { |
83 | - if (! $this->shouldInvoke(func_get_args())) { |
|
83 | + if ( ! $this->shouldInvoke(func_get_args())) { |
|
84 | 84 | return $given; |
85 | 85 | } |
86 | 86 |
@@ -172,7 +172,7 @@ |
||
172 | 172 | /** |
173 | 173 | * Set the priority the callback should be registered with |
174 | 174 | * |
175 | - * @param string|int $priority |
|
175 | + * @param integer $priority |
|
176 | 176 | * |
177 | 177 | * @return $this |
178 | 178 | */ |
@@ -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 | } |
@@ -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); |