Issues (1223)

classes/class-lsx-team-schema.php (17 issues)

1
<?php
2
/**
3
 * The Team Schema for LSX Team
4
 *
5
 * @package lsx-team
6
 */
0 ignored issues
show
There must be exactly one blank line after the file comment
Loading history...
7
/**
8
 * Returns schema Review data.
9
 *
10
 * @since 10.2
11
 */
12
class LSX_Team_Schema extends LSX_Schema_Graph_Piece {
13
	/**
14
	 * Constructor.
15
	 *
16
	 * @param \WPSEO_Schema_Context $context A value object with context variables.
17
	 */
18
	public function __construct( WPSEO_Schema_Context $context ) {
0 ignored issues
show
The type WPSEO_Schema_Context 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...
Expected 2 blank lines before function; 0 found
Loading history...
19
		$this->post_type = 'team';
20
		parent::__construct( $context );
21
	}
0 ignored issues
show
Expected 2 blank lines after function; 0 found
Loading history...
Expected 1 blank line before closing function brace; 0 found
Loading history...
22
	/**
23
	 * Returns Review data.
24
	 *
25
	 * @return array $data Review data.
26
	 */
27
	public function generate() {
28
		$data = array(
29
			'@type'            => array(
30
				'Person',
31
			),
32
			'@id'              => $this->context->canonical . '#person',
33
			'name'             => $this->post->post_title,
34
			'description'      => wp_strip_all_tags( $this->post->post_content ),
35
			'url'              => $this->post_url,
36
			'mainEntityOfPage' => array(
37
				'@id' => $this->context->canonical . WPSEO_Schema_IDs::WEBPAGE_HASH,
0 ignored issues
show
The type WPSEO_Schema_IDs 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...
38
			),
39
		);
40
		if ( $this->context->site_represents_reference ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
41
			$data['worksFor'] = $this->context->site_represents_reference;
42
			$data['memberOf'] = $this->context->site_represents_reference;
43
		}
0 ignored issues
show
No blank line found after control structure
Loading history...
44
		$data = $this->add_custom_field( $data, 'jobTitle', 'lsx_job_title' );
45
		$data = $this->add_custom_field( $data, 'email', 'lsx_email_contact' );
46
		$data = $this->add_custom_field( $data, 'telephone', 'lsx_tel' );
47
		$data = LSX_Schema_Utils::add_image( $data, $this->context );
48
		return $data;
49
	}
0 ignored issues
show
Expected 2 blank lines after function; 0 found
Loading history...
Expected 1 blank line before closing function brace; 0 found
Loading history...
50
	/**
51
	 * Adds the projects and testimonials under the 'owns' parameter
52
	 *
53
	 * @param array $data
0 ignored issues
show
Coding Style Documentation introduced by
Missing parameter comment
Loading history...
54
	 * @return array
55
	 */
56
	public function add_products( $data ) {
57
		$connections_array = array();
58
		$connections_array = $this->add_project( $connections_array );
59
		$connections_array = $this->add_testimonial( $connections_array );
60
		if ( ! empty( $connections_array ) ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
61
			$data['owns'] = $connections_array;
62
		}
0 ignored issues
show
No blank line found after control structure
Loading history...
63
		return $data;
64
	}
0 ignored issues
show
Expected 2 blank lines after function; 0 found
Loading history...
Expected 1 blank line before closing function brace; 0 found
Loading history...
65
}
66