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

Taxonomy::get_taxonomy()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 2
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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