Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions src/Generators/templates/component/source.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 10 additions & 5 deletions src/Generators/templates/taxonomies/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,31 @@
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 ];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The max version for tribe libs at the moment is PHP 7.2 so this should not include property types (only commented)


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' ),
'slug' => __( '%4$s', 'tribe' ),
];
}

public function default_terms() {
public function default_terms(): array {
return [];
}
}
4 changes: 3 additions & 1 deletion src/Generators/templates/taxonomies/subscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here


}
2 changes: 2 additions & 0 deletions src/Generators/templates/taxonomies/taxonomy.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
use Tribe\Libs\Taxonomy\Term_Object;

class %1$s extends Term_Object {

public const NAME = '%2$s';

}