diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cff1f4c..e6fead3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to this project will be documented in this file. ## Unreleased - +- Fixed incorrect phpcs formatting for taxonomy generator templates. ## 3.4.8 - 2021-11-29 - Added `.gitattributes` file to make package smaller - Added the Pipeline feature diff --git a/src/Generators/templates/component/source.js b/src/Generators/templates/component/source.js index 457c3b06..263c8235 100644 --- a/src/Generators/templates/component/source.js +++ b/src/Generators/templates/component/source.js @@ -8,8 +8,6 @@ * @description TODO: add a description to this file */ -import * as tools from 'utils/tools'; - /** * @function init * @description Kick off this module's functions diff --git a/src/Generators/templates/taxonomies/config.php b/src/Generators/templates/taxonomies/config.php index e53e8151..8563aecc 100644 --- a/src/Generators/templates/taxonomies/config.php +++ b/src/Generators/templates/taxonomies/config.php @@ -5,18 +5,23 @@ use Tribe\Libs\Taxonomy\Taxonomy_Config; class Config extends Taxonomy_Config { - protected $taxonomy = '%4$s'; - protected $post_types = [ %5$s ]; + + protected string $taxonomy = '%4$s'; + + /** + * @var string[] + */ + protected array $post_types = [ %5$s ]; protected $version = 0; - public function get_args() { + public function get_args(): array { return [ 'hierarchical' => false, ]; } - public function get_labels() { + public function get_labels(): array { return [ 'singular' => __( '%2$s', 'tribe' ), 'plural' => __( '%3$s', 'tribe' ), @@ -24,7 +29,7 @@ public function get_labels() { ]; } - public function default_terms() { + public function default_terms(): array { return []; } } diff --git a/src/Generators/templates/taxonomies/subscriber.php b/src/Generators/templates/taxonomies/subscriber.php index ae6c5148..c9e1586d 100644 --- a/src/Generators/templates/taxonomies/subscriber.php +++ b/src/Generators/templates/taxonomies/subscriber.php @@ -6,5 +6,7 @@ use Tribe\Libs\Taxonomy\Taxonomy_Subscriber; class Subscriber extends Taxonomy_Subscriber { - protected $config_class = Config::class; + + protected string $config_class = Config::class; + } diff --git a/src/Generators/templates/taxonomies/taxonomy.php b/src/Generators/templates/taxonomies/taxonomy.php index a18fc508..2d59c7d8 100644 --- a/src/Generators/templates/taxonomies/taxonomy.php +++ b/src/Generators/templates/taxonomies/taxonomy.php @@ -5,5 +5,7 @@ use Tribe\Libs\Taxonomy\Term_Object; class %1$s extends Term_Object { + public const NAME = '%2$s'; + }