@@ -42,7 +42,7 @@ |
||
| 42 | 42 | /** |
| 43 | 43 | * Model Constructor. |
| 44 | 44 | * |
| 45 | - * @param mixed $term WP_Term to fill data from |
|
| 45 | + * @param null|WP_Term $term WP_Term to fill data from |
|
| 46 | 46 | */ |
| 47 | 47 | public function __construct(WP_Term $term = null) |
| 48 | 48 | { |
@@ -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 | } |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | public function postTypes() |
| 104 | 104 | { |
| 105 | 105 | return Collection::make($this->object_type) |
| 106 | - ->map(function ($post_type) { |
|
| 106 | + ->map(function($post_type) { |
|
| 107 | 107 | return PostType::load($post_type); |
| 108 | 108 | }); |
| 109 | 109 | } |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | */ |
| 116 | 116 | public function unregister() |
| 117 | 117 | { |
| 118 | - if (! static::exists($this->taxonomy->name)) { |
|
| 118 | + if ( ! static::exists($this->taxonomy->name)) { |
|
| 119 | 119 | throw new Exception\NonExistentTaxonomyException; |
| 120 | 120 | } |
| 121 | 121 | |
@@ -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 | } |