PostType   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 11
dl 0
loc 22
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get_args() 0 10 1
A get_post_type() 0 2 1
1
<?php declare(strict_types = 1);
0 ignored issues
show
introduced by
Expected 1 line before declare statement, found 0.
Loading history...
2
3
namespace App\Providers\Example;
4
5
use App\Entities\Example as Entity;
6
use WPSteak\Providers\AbstractPostType;
7
use WPSteak\Services\Labels;
8
9
class PostType extends AbstractPostType {
10
11
	use Labels\PostType;
12
13
	/**
14
	 * {@inheritDoc}
15
	 */
16
	public function get_args(): array {
17
		return [
18
			'labels' => $this->get_labels(
19
				__( 'Exemplo', 'app' ),
20
				__( 'Exemplos', 'app' ),
0 ignored issues
show
introduced by
Trailing comma after the last parameter in function call is disallowed.
Loading history...
21
			),
22
			'public' => true,
23
			'show_in_rest' => true,
24
			'menu_icon' => 'dashicons-smiley',
25
			'supports' => [ 'title', 'custom-fields' ],
26
		];
27
	}
28
29
	public function get_post_type(): string {
30
		return Entity::POST_TYPE;
31
	}
32
33
}
34