Issues (1110)

classes/class-template-redirects.php (260 issues)

1
<?php
0 ignored issues
show
Class file names should be based on the class name with "class-" prepended. Expected class-lsx-to-template-redirects.php, but found class-template-redirects.php.
Loading history...
This file is missing a doc comment.
Loading history...
2
/**
0 ignored issues
show
Missing short description in doc comment
Loading history...
3
 * @package   LSX_TO_Template_Redirects
4
 * @author    LightSpeed
5
 * @license   GPL3
6
 * @link      
7
 * @copyright 2018 LightSpeed
8
 *
9
 **/
0 ignored issues
show
Additional blank lines found at end of doc comment
Loading history...
There must be no blank lines after the class comment
Loading history...
10
11
class LSX_TO_Template_Redirects {
12
13
	/**
14
	 * Plugin Path
15
	 */
0 ignored issues
show
Coding Style Documentation introduced by
Missing @var tag in member variable comment
Loading history...
16
	public $plugin_path = false;
17
18
	/**
19
	 * Post Types
20
	 */
0 ignored issues
show
Coding Style Documentation introduced by
Missing @var tag in member variable comment
Loading history...
21
	public $post_types = false;	
0 ignored issues
show
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
22
23
	/**
24
	 * Taxonomies
25
	 */
0 ignored issues
show
Coding Style Documentation introduced by
Missing @var tag in member variable comment
Loading history...
26
	public $taxonomies = false;		
0 ignored issues
show
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
27
28
	/**
0 ignored issues
show
Coding Style Documentation introduced by
Doc comment for parameter "$plugin_path" missing
Loading history...
29
	 * Initialize the plugin by setting localization, filters, and administration functions.
30
	 *
31
	 * @param array $post_types an array of the post types to redirect.
0 ignored issues
show
Doc comment for parameter $post_types does not match actual variable name $plugin_path
Loading history...
32
	 * @param array $taxonomies an array of the taxonomies to redirect.
0 ignored issues
show
Doc comment for parameter $taxonomies does not match actual variable name $post_types
Loading history...
33
	 */
34
	public function __construct($plugin_path=false,$post_types=false,$taxonomies=false) {
0 ignored issues
show
No space after opening parenthesis is prohibited
Loading history...
Expected 2 blank lines before function; 1 found
Loading history...
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Incorrect spacing between argument "$plugin_path" and equals sign; expected 1 but found 0
Loading history...
Incorrect spacing between default value and equals sign for argument "$plugin_path"; expected 1 but found 0
Loading history...
Expected 1 space between comma and argument "$post_types"; 0 found
Loading history...
Incorrect spacing between argument "$post_types" and equals sign; expected 1 but found 0
Loading history...
Incorrect spacing between default value and equals sign for argument "$post_types"; expected 1 but found 0
Loading history...
Expected 1 space between comma and argument "$taxonomies"; 0 found
Loading history...
Incorrect spacing between argument "$taxonomies" and equals sign; expected 1 but found 0
Loading history...
Incorrect spacing between default value and equals sign for argument "$taxonomies"; expected 1 but found 0
Loading history...
No space before closing parenthesis is prohibited
Loading history...
35
		if(false !== $plugin_path){
0 ignored issues
show
Space after opening control structure is required
Loading history...
No space before opening parenthesis is prohibited
Loading history...
No space after opening parenthesis is prohibited
Loading history...
Expected 1 space(s) after IF keyword; 0 found
Loading history...
No space before closing parenthesis is prohibited
Loading history...
Space between opening control structure and closing parenthesis is required
Loading history...
36
			$this->plugin_path = $plugin_path;
37
38
			add_filter( 'lsx_to_widget_path', array( $this, 'widget_path'), 10, 2 );
0 ignored issues
show
Missing space before array closer.
Loading history...
39
			add_filter( 'lsx_to_content_path', array( $this, 'content_path'), 10, 3 );
0 ignored issues
show
Missing space before array closer.
Loading history...
40
41
			if(false !== $post_types){
0 ignored issues
show
Space after opening control structure is required
Loading history...
No space before opening parenthesis is prohibited
Loading history...
No space after opening parenthesis is prohibited
Loading history...
Expected 1 space(s) after IF keyword; 0 found
Loading history...
No space before closing parenthesis is prohibited
Loading history...
Space between opening control structure and closing parenthesis is required
Loading history...
42
				$this->post_types = $post_types;
43
				add_filter( 'template_include', array( $this, 'post_type_archive_template_include'), 99 );
0 ignored issues
show
Missing space before array closer.
Loading history...
44
				add_filter( 'template_include', array( $this, 'post_type_single_template_include'), 99 );				
0 ignored issues
show
Missing space before array closer.
Loading history...
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
45
				add_filter( 'template_include', array( $this, 'search_template_include'), 99 );				
0 ignored issues
show
Missing space before array closer.
Loading history...
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
46
			}
0 ignored issues
show
No blank line found after control structure
Loading history...
47
			if(false !== $taxonomies){
0 ignored issues
show
Space after opening control structure is required
Loading history...
No space before opening parenthesis is prohibited
Loading history...
No space after opening parenthesis is prohibited
Loading history...
Expected 1 space(s) after IF keyword; 0 found
Loading history...
No space before closing parenthesis is prohibited
Loading history...
Space between opening control structure and closing parenthesis is required
Loading history...
48
				$this->taxonomies = $taxonomies;
49
				add_filter( 'template_include', array( $this, 'taxonomy_template_include'), 99 );				
0 ignored issues
show
Missing space before array closer.
Loading history...
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
50
			}
51
		}			
0 ignored issues
show
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
52
	}
0 ignored issues
show
Expected 2 blank lines after function; 1 found
Loading history...
Expected 1 blank line before closing function brace; 0 found
Loading history...
53
54
	/**
0 ignored issues
show
Coding Style Documentation introduced by
Doc comment for parameter "$template" missing
Loading history...
55
	 * Redirect wordpress to the archive template located in the plugin
0 ignored issues
show
Please spell "WordPress" correctly. Found 1 misspelling(s): wordpress
Loading history...
56
	 *
57
	 * @param	$template
0 ignored issues
show
Missing parameter name
Loading history...
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
58
	 * @return	$template
0 ignored issues
show
Documentation Bug introduced by
The doc comment $template at position 0 could not be parsed: Unknown type name '$template' at position 0 in $template.
Loading history...
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
59
	 */
60
	public function post_type_archive_template_include( $template ) {
0 ignored issues
show
Expected 0 blank lines after opening function brace; 1 found
Loading history...
61
		
62
		if ( is_main_query() && is_post_type_archive($this->post_types)) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
No space before closing parenthesis is prohibited
Loading history...
63
			$current_post_type = get_post_type();
64
			if ( '' == locate_template( array( 'archive-'.$current_post_type.'.php' ) )	&& file_exists( $this->plugin_path.'templates/archive-'.$current_post_type.'.php' )) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Found: ==. Use strict comparisons (=== or !==).
Loading history...
Concat operator must be surrounded by a single space
Loading history...
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
No space before closing parenthesis is prohibited
Loading history...
65
				$template = $this->plugin_path.'templates/archive-'.$current_post_type.'.php';
0 ignored issues
show
Concat operator must be surrounded by a single space
Loading history...
66
			}
67
		}
0 ignored issues
show
No blank line found after control structure
Loading history...
68
		return $template;
69
	}
0 ignored issues
show
Expected 2 blank lines after function; 1 found
Loading history...
Expected 1 blank line before closing function brace; 0 found
Loading history...
70
	
71
	/**
0 ignored issues
show
Coding Style Documentation introduced by
Doc comment for parameter "$template" missing
Loading history...
72
	 * Redirect wordpress to the single template located in the plugin
0 ignored issues
show
Please spell "WordPress" correctly. Found 1 misspelling(s): wordpress
Loading history...
73
	 *
74
	 * @param	$template
0 ignored issues
show
Missing parameter name
Loading history...
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
75
	 *
76
	 * @return	$template
0 ignored issues
show
Documentation Bug introduced by
The doc comment $template at position 0 could not be parsed: Unknown type name '$template' at position 0 in $template.
Loading history...
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
77
	 */
78
	public function post_type_single_template_include($template) {
0 ignored issues
show
No space after opening parenthesis is prohibited
Loading history...
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
No space before closing parenthesis is prohibited
Loading history...
79
		if ( is_main_query() && is_singular($this->post_types) ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
80
			$current_post_type = get_post_type();
81
			
82
			if ( '' == locate_template( array( 'single-'.$current_post_type.'.php' ) )	&& file_exists( $this->plugin_path.'templates/single-'.$current_post_type.'.php') ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Found: ==. Use strict comparisons (=== or !==).
Loading history...
Concat operator must be surrounded by a single space
Loading history...
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
Expected 1 space before "&&"; 2 found
Loading history...
Expected 1 space before logical operator; 2 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
83
					$template = $this->plugin_path.'templates/single-'.$current_post_type.'.php';
0 ignored issues
show
Concat operator must be surrounded by a single space
Loading history...
84
			}
85
		}
0 ignored issues
show
No blank line found after control structure
Loading history...
86
		return $template;
87
	}
0 ignored issues
show
Expected 2 blank lines after function; 1 found
Loading history...
Expected 1 blank line before closing function brace; 0 found
Loading history...
88
	
89
	/**
0 ignored issues
show
Coding Style Documentation introduced by
Doc comment for parameter "$template" missing
Loading history...
90
	 * Redirect wordpress to the taxonomy located in the plugin
0 ignored issues
show
Please spell "WordPress" correctly. Found 1 misspelling(s): wordpress
Loading history...
91
	 *
92
	 * @param	$template
0 ignored issues
show
Missing parameter name
Loading history...
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
93
	 *
94
	 * @return	$template
0 ignored issues
show
Documentation Bug introduced by
The doc comment $template at position 0 could not be parsed: Unknown type name '$template' at position 0 in $template.
Loading history...
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
95
	 */
96
	public function taxonomy_template_include($template) {
0 ignored issues
show
No space after opening parenthesis is prohibited
Loading history...
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
No space before closing parenthesis is prohibited
Loading history...
Expected 0 blank lines after opening function brace; 1 found
Loading history...
97
98
		if ( is_main_query() && is_tax($this->taxonomies) ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
99
			$current_taxonomy = get_query_var('taxonomy');
0 ignored issues
show
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
100
	
101
			if ( '' == locate_template( array( 'taxonomy-'.$current_taxonomy.'.php' ) ) && file_exists( $this->plugin_path.'templates/taxonomy-'.$current_taxonomy.'.php') ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Found: ==. Use strict comparisons (=== or !==).
Loading history...
Concat operator must be surrounded by a single space
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
102
				$template = $this->plugin_path.'templates/taxonomy-'.$current_taxonomy.'.php';
0 ignored issues
show
Concat operator must be surrounded by a single space
Loading history...
103
			}
104
		}
0 ignored issues
show
No blank line found after control structure
Loading history...
105
		return $template;
106
	}
0 ignored issues
show
Expected 2 blank lines after function; 1 found
Loading history...
Expected 1 blank line before closing function brace; 0 found
Loading history...
107
108
	/**
0 ignored issues
show
Coding Style Documentation introduced by
Doc comment for parameter "$template" missing
Loading history...
109
	 * Redirect wordpress to the search template located in the plugin
0 ignored issues
show
Please spell "WordPress" correctly. Found 1 misspelling(s): wordpress
Loading history...
110
	 *
111
	 * @param	$template
0 ignored issues
show
Missing parameter name
Loading history...
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
112
	 *
113
	 * @return	$template
0 ignored issues
show
Documentation Bug introduced by
The doc comment $template at position 0 could not be parsed: Unknown type name '$template' at position 0 in $template.
Loading history...
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
114
	 */
115
	public function search_template_include( $template ) {
0 ignored issues
show
Expected 0 blank lines after opening function brace; 1 found
Loading history...
116
		
117
		if ( is_main_query() && is_search() ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
118
			if ( file_exists( $this->plugin_path.'templates/search.php' )) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Concat operator must be surrounded by a single space
Loading history...
No space before closing parenthesis is prohibited
Loading history...
119
				$template = $this->plugin_path.'templates/search.php';
0 ignored issues
show
Concat operator must be surrounded by a single space
Loading history...
120
			}
121
		}
0 ignored issues
show
No blank line found after control structure
Loading history...
122
		return $template;
123
	}
0 ignored issues
show
Expected 2 blank lines after function; 1 found
Loading history...
Expected 1 blank line before closing function brace; 0 found
Loading history...
124
125
	/**
0 ignored issues
show
Coding Style Documentation introduced by
Doc comment for parameter "$slug" missing
Loading history...
Coding Style Documentation introduced by
Doc comment for parameter "$name" missing
Loading history...
126
	 * Redirect wordpress to the single template located in the plugin
0 ignored issues
show
Please spell "WordPress" correctly. Found 1 misspelling(s): wordpress
Loading history...
127
	 *
128
	 * @param	$template
0 ignored issues
show
Missing parameter name
Loading history...
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
129
	 *
130
	 * @return	$template
0 ignored issues
show
Documentation Bug introduced by
The doc comment $template at position 0 could not be parsed: Unknown type name '$template' at position 0 in $template.
Loading history...
Function return type is not void, but function has no return statement
Loading history...
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
131
	 */
132
	public function content_part($slug, $name = null) {
0 ignored issues
show
No space after opening parenthesis is prohibited
Loading history...
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
No space before closing parenthesis is prohibited
Loading history...
133
		$template = array();
134
		$name = (string) $name;
0 ignored issues
show
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
135
		if ( '' !== $name ){
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
Space between opening control structure and closing parenthesis is required
Loading history...
136
			$template = "{$slug}-{$name}.php";
137
		}else{
0 ignored issues
show
Space after opening control structure is required
Loading history...
No space before opening parenthesis is prohibited
Loading history...
Expected 1 space(s) after ELSE keyword; 0 found
Loading history...
138
			$template = "{$slug}.php";
139
		}
0 ignored issues
show
No blank line found after control structure
Loading history...
140
		$original_name = $template;
141
		$path = apply_filters('lsx_to_content_path','',get_post_type());
0 ignored issues
show
Equals sign not aligned with surrounding assignments; expected 10 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
142
143
		if ( '' == locate_template( array( $template ) ) && file_exists( $path.'templates/'.$template) ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Found: ==. Use strict comparisons (=== or !==).
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
Concat operator must be surrounded by a single space
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
144
			$template = $path.'templates/'.$template;
0 ignored issues
show
Concat operator must be surrounded by a single space
Loading history...
145
		}elseif(file_exists( get_stylesheet_directory().'/'.$template)){
0 ignored issues
show
Space after opening control structure is required
Loading history...
No space before opening parenthesis is prohibited
Loading history...
No space after opening parenthesis is prohibited
Loading history...
Expected 1 space(s) after ELSEIF keyword; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
Concat operator must be surrounded by a single space
Loading history...
No space before closing parenthesis is prohibited
Loading history...
Space between opening control structure and closing parenthesis is required
Loading history...
146
			$template = get_stylesheet_directory().'/'.$template;
0 ignored issues
show
Concat operator must be surrounded by a single space
Loading history...
147
		}else{
0 ignored issues
show
Space after opening control structure is required
Loading history...
No space before opening parenthesis is prohibited
Loading history...
Expected 1 space(s) after ELSE keyword; 0 found
Loading history...
148
			$template = false;
149
		}
150
		
151
		if(false !== $template){
0 ignored issues
show
Space after opening control structure is required
Loading history...
No space before opening parenthesis is prohibited
Loading history...
No space after opening parenthesis is prohibited
Loading history...
Expected 1 space(s) after IF keyword; 0 found
Loading history...
No space before closing parenthesis is prohibited
Loading history...
Space between opening control structure and closing parenthesis is required
Loading history...
152
			load_template( $template, false );
153
		}else {
154
			echo wp_kses_post('<p>No '.$original_name.' can be found.</p>');
0 ignored issues
show
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
Concat operator must be surrounded by a single space
Loading history...
155
		}
156
	}
0 ignored issues
show
Expected 2 blank lines after function; 1 found
Loading history...
Expected 1 blank line before closing function brace; 0 found
Loading history...
157
158
	/**
0 ignored issues
show
Coding Style Documentation introduced by
Doc comment for parameter "$path" missing
Loading history...
Coding Style Documentation introduced by
Doc comment for parameter "$slug" missing
Loading history...
159
	 * Redirect wordpress to the widget template located in the plugin
0 ignored issues
show
Please spell "WordPress" correctly. Found 1 misspelling(s): wordpress
Loading history...
160
	 *
161
	 * @param	$path
0 ignored issues
show
Missing parameter name
Loading history...
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
162
	 * @param	$post_type
0 ignored issues
show
Missing parameter name
Loading history...
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
163
	 *
164
	 * @return	$path
0 ignored issues
show
Documentation Bug introduced by
The doc comment $path at position 0 could not be parsed: Unknown type name '$path' at position 0 in $path.
Loading history...
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
165
	 */
166
	public function widget_path($path,$slug) {
0 ignored issues
show
No space after opening parenthesis is prohibited
Loading history...
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 space between comma and argument "$slug"; 0 found
Loading history...
No space before closing parenthesis is prohibited
Loading history...
167
		if((false !== $this->post_types && in_array($slug,$this->post_types))
0 ignored issues
show
$this->post_types of type true is incompatible with the type array expected by parameter $haystack of in_array(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

167
		if((false !== $this->post_types && in_array($slug,/** @scrutinizer ignore-type */ $this->post_types))
Loading history...
Space after opening control structure is required
Loading history...
No space before opening parenthesis is prohibited
Loading history...
No space after opening parenthesis is prohibited
Loading history...
Expected 1 space(s) after IF keyword; 0 found
Loading history...
Expected 1 space after open parenthesis; 0 found
Loading history...
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
Not using strict comparison for in_array; supply true for third argument.
Loading history...
Expected 1 space before close parenthesis; 0 found
Loading history...
168
		 || (false !== $this->taxonomies && in_array($slug,$this->taxonomies)) || 'post' === $slug){
0 ignored issues
show
Found precision alignment of 1 spaces.
Loading history...
Expected 1 space after open parenthesis; 0 found
Loading history...
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
Not using strict comparison for in_array; supply true for third argument.
Loading history...
Expected 1 space before close parenthesis; 0 found
Loading history...
No space before closing parenthesis is prohibited
Loading history...
Space between opening control structure and closing parenthesis is required
Loading history...
169
			$path = $this->plugin_path;
170
		}
0 ignored issues
show
No blank line found after control structure
Loading history...
171
		return $path;
172
	}
0 ignored issues
show
Expected 2 blank lines after function; 1 found
Loading history...
Expected 1 blank line before closing function brace; 0 found
Loading history...
173
174
	/**
0 ignored issues
show
Coding Style Documentation introduced by
Doc comment for parameter "$path" missing
Loading history...
Coding Style Documentation introduced by
Doc comment for parameter "$slug" missing
Loading history...
175
	 * Redirect wordpress to the single template located in the plugin
0 ignored issues
show
Please spell "WordPress" correctly. Found 1 misspelling(s): wordpress
Loading history...
176
	 *
177
	 * @param	$path
0 ignored issues
show
Missing parameter name
Loading history...
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
178
	 * @param	$post_type
0 ignored issues
show
Missing parameter name
Loading history...
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
179
	 *
180
	 * @return	$path
0 ignored issues
show
Documentation Bug introduced by
The doc comment $path at position 0 could not be parsed: Unknown type name '$path' at position 0 in $path.
Loading history...
Spaces must be used for mid-line alignment; tabs are not allowed
Loading history...
181
	 */
182
	public function content_path($path,$slug) {
0 ignored issues
show
No space after opening parenthesis is prohibited
Loading history...
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 space between comma and argument "$slug"; 0 found
Loading history...
No space before closing parenthesis is prohibited
Loading history...
183
		if((false !== $this->post_types && in_array($slug,$this->post_types))
0 ignored issues
show
$this->post_types of type true is incompatible with the type array expected by parameter $haystack of in_array(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

183
		if((false !== $this->post_types && in_array($slug,/** @scrutinizer ignore-type */ $this->post_types))
Loading history...
Space after opening control structure is required
Loading history...
No space before opening parenthesis is prohibited
Loading history...
No space after opening parenthesis is prohibited
Loading history...
Expected 1 space(s) after IF keyword; 0 found
Loading history...
Expected 1 space after open parenthesis; 0 found
Loading history...
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
Not using strict comparison for in_array; supply true for third argument.
Loading history...
Expected 1 space before close parenthesis; 0 found
Loading history...
184
		 || (false !== $this->taxonomies && in_array($slug,$this->taxonomies)) || 'post' === $slug){
0 ignored issues
show
Found precision alignment of 1 spaces.
Loading history...
Expected 1 space after open parenthesis; 0 found
Loading history...
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
Not using strict comparison for in_array; supply true for third argument.
Loading history...
Expected 1 space before close parenthesis; 0 found
Loading history...
No space before closing parenthesis is prohibited
Loading history...
Space between opening control structure and closing parenthesis is required
Loading history...
185
			$path = $this->plugin_path;
186
		}
0 ignored issues
show
No blank line found after control structure
Loading history...
187
		return $path;
188
	}
0 ignored issues
show
Expected 1 blank line before closing function brace; 0 found
Loading history...
189
}