Test Setup Failed
Push — develop ( 67f164...d5fe8d )
by Elvis Henrique
03:02
created

Page   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 5
dl 0
loc 16
c 0
b 0
f 0
ccs 5
cts 5
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A find_one() 0 8 2
1
<?php
2
/**
3
 * Page.
4
 *
5
 * @package App
6
 */
7
8
declare(strict_types=1);
9
10
namespace App\Repositories;
11
12
use App\Entities\Page as Entity;
13
use WPSteak\Repositories\AbstractPost;
0 ignored issues
show
Bug introduced by
The type WPSteak\Repositories\AbstractPost was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
14
15
/**
16
 * Page class.
17
 */
18
class Page extends AbstractPost {
19
20
	/**
21
	 * Find one.
22
	 *
23
	 * @param \WP_Post|int $post The post object or id.
24
	 * @return Entity|null
25 2
	 */
26 2
	public function find_one( $post ) : ?Entity {
27
		$post = $this->get_post( $post );
28 2
29 1
		if ( empty( $post ) ) {
30
			return null;
31
		}
32 1
33
		return ( new Entity() )->set_post( $post );
34
	}
35
}
36