Passed
Push — develop ( b3bcee...34b40d )
by Elvis Henrique
03:59
created

Taxonomy   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 11
dl 0
loc 39
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A get_taxonomy() 0 2 1
A get_object_type() 0 2 1
A get_args() 0 9 1
1
<?php
2
/**
3
 * Taxonomy.
4
 *
5
 * @package App
6
 */
7
8
declare(strict_types=1);
9
10
namespace App\Providers\ExampleCategory;
11
12
use App\Entities\Example as EntityExample;
13
use App\Entities\ExampleCategory as Entity;
14
use WPSteak\Providers\AbstractTaxonomy;
15
use WPSteak\Services\Labels;
16
17
/**
18
 * Taxonomy class.
19
 */
20
class Taxonomy extends AbstractTaxonomy {
21
22
	use Labels\Taxonomy;
23
24
	/**
25
	 * Get args.
26
	 *
27
	 * @return array
28
	 */
29
	public function get_args() : array {
30
		return [
31
			'labels'       => $this->get_labels(
32
				__( 'Categoria', 'app' ),
33
				__( 'Categorias', 'app' )
34
			),
35
			'public'       => true,
36
			'show_in_rest' => true,
37
			'hierarchical' => true,
38
		];
39
	}
40
41
	/**
42
	 * Get Taxonomy.
43
	 *
44
	 * @return string
45
	 */
46
	public function get_taxonomy() : string {
47
		return Entity::TAXONOMY;
48
	}
49
50
	/**
51
	 * Get object type.
52
	 *
53
	 * Passed for $object_type param, it can be an array or a string.
54
	 *
55
	 * @return array|string
56
	 */
57
	public function get_object_type() {
58
		return EntityExample::POST_TYPE;
59
	}
60
}
61