@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public function __construct($taxonomy) |
46 | 46 | { |
47 | - if (empty($taxonomy->name) || ! static::exists($taxonomy->name)) { |
|
47 | + if (empty($taxonomy->name) || !static::exists($taxonomy->name)) { |
|
48 | 48 | throw new NonExistentTaxonomyException; |
49 | 49 | } |
50 | 50 | |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | return static::load($identifier); |
67 | 67 | } |
68 | 68 | |
69 | - if (! $identifier || strlen($identifier) > 32) { |
|
69 | + if (!$identifier || strlen($identifier) > 32) { |
|
70 | 70 | throw new InvalidTaxonomyNameException('Taxonomy names must be between 1 and 32 characters in length.'); |
71 | 71 | } |
72 | 72 | |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | */ |
85 | 85 | public static function load($identifier) |
86 | 86 | { |
87 | - if (! $object = get_taxonomy($identifier)) { |
|
87 | + if (!$object = get_taxonomy($identifier)) { |
|
88 | 88 | throw new NonExistentTaxonomyException("No taxonomy exists with name '$identifier'."); |
89 | 89 | } |
90 | 90 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | public function postTypes() |
122 | 122 | { |
123 | 123 | return Collection::make($this->object_type) |
124 | - ->map(function ($post_type) { |
|
124 | + ->map(function($post_type) { |
|
125 | 125 | return PostType::load($post_type); |
126 | 126 | }); |
127 | 127 | } |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | */ |
137 | 137 | public function unregister() |
138 | 138 | { |
139 | - if (! $this->exists($this->id)) { |
|
139 | + if (!$this->exists($this->id)) { |
|
140 | 140 | throw new NonExistentTaxonomyException; |
141 | 141 | } |
142 | 142 |
@@ -67,7 +67,7 @@ |
||
67 | 67 | */ |
68 | 68 | public function register() |
69 | 69 | { |
70 | - if (! $this->id || strlen($this->id) > 32) { |
|
70 | + if (!$this->id || strlen($this->id) > 32) { |
|
71 | 71 | throw new InvalidTaxonomyNameException('Taxonomy names must be between 1 and 32 characters in length.'); |
72 | 72 | } |
73 | 73 |
@@ -49,7 +49,7 @@ |
||
49 | 49 | * Adapted from Str::snake() |
50 | 50 | * @link https://github.com/laravel/framework/blob/5.2/src/Illuminate/Support/Str.php |
51 | 51 | */ |
52 | - if (! ctype_lower($name)) { |
|
52 | + if (!ctype_lower($name)) { |
|
53 | 53 | $name = strtolower(preg_replace('/(.)(?=[A-Z])/u', '$1_', $name)); |
54 | 54 | } |
55 | 55 |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | */ |
67 | 67 | public function __construct(WP_Post $post = null) |
68 | 68 | { |
69 | - if (! $post) { |
|
69 | + if (!$post) { |
|
70 | 70 | $post = new WP_Post(new stdClass); |
71 | 71 | $post->post_type = static::postTypeId(); |
72 | 72 | } |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | */ |
134 | 134 | public static function fromGlobal() |
135 | 135 | { |
136 | - if (! $GLOBALS['post'] instanceof WP_Post) { |
|
136 | + if (!$GLOBALS['post'] instanceof WP_Post) { |
|
137 | 137 | throw new PostNotFoundException('Global $post not an instance of WP_Post'); |
138 | 138 | } |
139 | 139 |
@@ -9,7 +9,7 @@ |
||
9 | 9 | { |
10 | 10 | public function execute() |
11 | 11 | { |
12 | - if (! $this->model->id) { |
|
12 | + if (!$this->model->id) { |
|
13 | 13 | $result = wp_insert_post($this->model->object->to_array(), true); |
14 | 14 | } else { |
15 | 15 | $result = wp_update_post($this->model->object, true); |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function supports($features) |
45 | 45 | { |
46 | - if (! is_array($features)) { |
|
46 | + if (!is_array($features)) { |
|
47 | 47 | $features = func_get_args(); |
48 | 48 | } |
49 | 49 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | */ |
98 | 98 | public function register() |
99 | 99 | { |
100 | - if (! $this->id || strlen($this->id) > 20) { |
|
100 | + if (!$this->id || strlen($this->id) > 20) { |
|
101 | 101 | throw new InvalidPostTypeNameException('Post type names must be between 1 and 20 characters in length.'); |
102 | 102 | } |
103 | 103 |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | */ |
21 | 21 | public function __construct($object) |
22 | 22 | { |
23 | - if (! is_object($object) || ! in_array(get_class($object), ['stdClass', 'WP_Post_Type'])) { |
|
23 | + if (!is_object($object) || !in_array(get_class($object), ['stdClass', 'WP_Post_Type'])) { |
|
24 | 24 | throw new \InvalidArgumentException(static::class . ' can only be constructed with a Post Type object.'); |
25 | 25 | } |
26 | 26 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public static function load($slug) |
57 | 57 | { |
58 | - if (! $object = get_post_type_object($slug)) { |
|
58 | + if (!$object = get_post_type_object($slug)) { |
|
59 | 59 | throw new NonExistentPostTypeException("No post type exists with name '$slug'."); |
60 | 60 | } |
61 | 61 | |
@@ -84,13 +84,13 @@ discard block |
||
84 | 84 | */ |
85 | 85 | public function supports($features) |
86 | 86 | { |
87 | - if (! is_array($features)) { |
|
87 | + if (!is_array($features)) { |
|
88 | 88 | $features = func_get_args(); |
89 | 89 | } |
90 | 90 | |
91 | - return ! Collection::make($features) |
|
92 | - ->contains(function ($key, $feature) { |
|
93 | - return ! post_type_supports($this->slug, $feature); |
|
91 | + return !Collection::make($features) |
|
92 | + ->contains(function($key, $feature) { |
|
93 | + return !post_type_supports($this->slug, $feature); |
|
94 | 94 | }); |
95 | 95 | } |
96 | 96 | |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | public function removeSupportFor($features) |
117 | 117 | { |
118 | 118 | Collection::make(is_array($features) ? $features : func_get_args()) |
119 | - ->each(function ($features) { |
|
119 | + ->each(function($features) { |
|
120 | 120 | remove_post_type_support($this->slug, $features); |
121 | 121 | }); |
122 | 122 | |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | */ |
131 | 131 | public function unregister() |
132 | 132 | { |
133 | - if (! static::exists($this->slug)) { |
|
133 | + if (!static::exists($this->slug)) { |
|
134 | 134 | throw new NonExistentPostTypeException("No post type exists with name '{$this->slug}'."); |
135 | 135 | } |
136 | 136 |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public function __construct(WP_Term $term = null) |
53 | 53 | { |
54 | - if (! $term) { |
|
54 | + if (!$term) { |
|
55 | 55 | $term = new WP_Term(new stdClass); |
56 | 56 | $term->taxonomy = static::TAXONOMY; |
57 | 57 | } elseif ($term->taxonomy != static::TAXONOMY) { |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | */ |
85 | 85 | public static function fromID($id) |
86 | 86 | { |
87 | - if (! $term = get_term_by('id', (int) $id, static::TAXONOMY)) { |
|
87 | + if (!$term = get_term_by('id', (int) $id, static::TAXONOMY)) { |
|
88 | 88 | throw new TermNotFoundException("No term found with ID $id."); |
89 | 89 | } |
90 | 90 | |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public static function fromSlug($slug) |
104 | 104 | { |
105 | - if (! $term = get_term_by('slug', $slug, static::TAXONOMY)) { |
|
105 | + if (!$term = get_term_by('slug', $slug, static::TAXONOMY)) { |
|
106 | 106 | throw new TermNotFoundException("No term found with slug '$slug'."); |
107 | 107 | } |
108 | 108 | |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | public function ancestors() |
190 | 190 | { |
191 | 191 | return Collection::make(get_ancestors($this->id, static::TAXONOMY, 'taxonomy')) |
192 | - ->map(function ($term_ID) { |
|
192 | + ->map(function($term_ID) { |
|
193 | 193 | return static::fromID($term_ID); |
194 | 194 | }); |
195 | 195 | } |