@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | */ |
47 | 47 | public function __construct(WP_Term $term = null) |
48 | 48 | { |
49 | - if (! $term) { |
|
49 | + if ( ! $term) { |
|
50 | 50 | $term = new WP_Term(new stdClass); |
51 | 51 | $term->taxonomy = static::TAXONOMY; |
52 | 52 | } elseif ($term->taxonomy != static::TAXONOMY) { |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | public static function fromID($id) |
79 | 79 | { |
80 | - if (! $term = get_term_by('id', (int) $id, static::TAXONOMY)) { |
|
80 | + if ( ! $term = get_term_by('id', (int) $id, static::TAXONOMY)) { |
|
81 | 81 | throw new TermNotFoundException("No term found with ID $id."); |
82 | 82 | } |
83 | 83 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | */ |
94 | 94 | public static function fromSlug($slug) |
95 | 95 | { |
96 | - if (! $term = get_term_by('slug', $slug, static::TAXONOMY)) { |
|
96 | + if ( ! $term = get_term_by('slug', $slug, static::TAXONOMY)) { |
|
97 | 97 | throw new TermNotFoundException("No term found with slug '$slug'."); |
98 | 98 | } |
99 | 99 | |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | public function ancestors() |
220 | 220 | { |
221 | 221 | return Collection::make(get_ancestors($this->id, static::TAXONOMY, 'taxonomy')) |
222 | - ->map(function ($term_ID) { |
|
222 | + ->map(function($term_ID) { |
|
223 | 223 | return static::fromID($term_ID); |
224 | 224 | }); |
225 | 225 | } |
@@ -106,7 +106,7 @@ |
||
106 | 106 | $modelClass = get_class($this->model); |
107 | 107 | |
108 | 108 | return Collection::make($this->fetchTerms()) |
109 | - ->map(function (WP_Term $term) use ($modelClass) { |
|
109 | + ->map(function(WP_Term $term) use ($modelClass) { |
|
110 | 110 | return new $modelClass($term); |
111 | 111 | }); |
112 | 112 | } |
@@ -9,7 +9,6 @@ |
||
9 | 9 | use Silk\Query\Builder; |
10 | 10 | use Silk\Query\QueryBuilder; |
11 | 11 | use Silk\Database\ActiveRecord; |
12 | -use Silk\Exception\WP_ErrorException; |
|
13 | 12 | use Silk\Post\Exception\PostNotFoundException; |
14 | 13 | use Silk\Post\Exception\ModelPostTypeMismatchException; |
15 | 14 |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | */ |
71 | 71 | public function __construct(WP_Post $post = null) |
72 | 72 | { |
73 | - if (! $post) { |
|
73 | + if ( ! $post) { |
|
74 | 74 | $post = new WP_Post(new stdClass); |
75 | 75 | $post->post_type = static::postTypeId(); |
76 | 76 | } |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | */ |
138 | 138 | public static function fromGlobal() |
139 | 139 | { |
140 | - if (! $GLOBALS['post'] instanceof WP_Post) { |
|
140 | + if ( ! $GLOBALS['post'] instanceof WP_Post) { |
|
141 | 141 | throw new PostNotFoundException('Global $post not an instance of WP_Post'); |
142 | 142 | } |
143 | 143 |
@@ -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->post->to_array(), true); |
14 | 14 | } else { |
15 | 15 | $result = wp_update_post($this->model->post, true); |