Passed
Push — purged ( 1a7250...44fe4e )
by Jacques
04:42
created

functions.php (9 issues)

1
<?php
0 ignored issues
show
This file is missing a doc comment.
Loading history...
2
use function Aws\serialize;
0 ignored issues
show
The function Aws\serialize was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
This use statement conflicts with another class in this namespace, serialize. Consider defining an alias.

Let?s assume that you have a directory layout like this:

.
|-- OtherDir
|   |-- Bar.php
|   `-- Foo.php
`-- SomeDir
    `-- Foo.php

and let?s assume the following content of Bar.php:

// Bar.php
namespace OtherDir;

use SomeDir\Foo; // This now conflicts the class OtherDir\Foo

If both files OtherDir/Foo.php and SomeDir/Foo.php are loaded in the same runtime, you will see a PHP error such as the following:

PHP Fatal error:  Cannot use SomeDir\Foo as Foo because the name is already in use in OtherDir/Foo.php

However, as OtherDir/Foo.php does not necessarily have to be loaded and the error is only triggered if it is loaded before OtherDir/Bar.php, this problem might go unnoticed for a while. In order to prevent this error from surfacing, you must import the namespace with a different alias:

// Bar.php
namespace OtherDir;

use SomeDir\Foo as SomeDirFoo; // There is no conflict anymore.
Loading history...
3
4
/**
5
 * LSX functions and definitions.
6
 *
7
 * @package lsx
8
 */
9
10
if ( ! defined( 'ABSPATH' ) ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
11
	exit;
12
}
13
14
define( 'LSX_VERSION', '2.9' );
15
16
if ( in_array( 'wordpress-seo/wp-seo.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) || in_array( 'wordpress-seo-premium/wp-seo-premium.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
0 ignored issues
show
It seems like apply_filters('active_pl...tion('active_plugins')) can also be of type false; however, parameter $haystack of in_array() does only seem to accept array, maybe add an additional type check? ( Ignorable by Annotation )

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

16
if ( in_array( 'wordpress-seo/wp-seo.php', /** @scrutinizer ignore-type */ apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) || in_array( 'wordpress-seo-premium/wp-seo-premium.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
Loading history...
Expected 0 spaces after opening bracket; 1 found
Loading history...
Not using strict comparison for in_array; supply true for third argument.
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
17
	require get_template_directory() . '/includes/yoast/class-lsx-yoast.php';
18
}
19
20
require get_template_directory() . '/includes/config.php';
21
require get_template_directory() . '/includes/deprecated.php';
22
require get_template_directory() . '/includes/classes/class-lsx-theme-customizer.php';
23
require get_template_directory() . '/includes/customizer.php';
24
require get_template_directory() . '/includes/sanitize.php';
25
require get_template_directory() . '/includes/layout.php';
26
require get_template_directory() . '/includes/hooks.php';
27
require get_template_directory() . '/includes/widgets.php';
28
require get_template_directory() . '/includes/scripts.php';
29
require get_template_directory() . '/includes/classes/class-lsx-nav-walker.php';
30
require get_template_directory() . '/includes/nav-navwalker.php';
31
require get_template_directory() . '/includes/classes/class-lsx-bootstrap-navwalker.php';
32
require get_template_directory() . '/includes/nav-bootstrap-navwalker.php';
33
require get_template_directory() . '/includes/classes/class-lsx-walker-comment.php';
34
require get_template_directory() . '/includes/walker-comment.php';
35
require get_template_directory() . '/includes/template-tags.php';
36
require get_template_directory() . '/includes/extras.php';
37
require get_template_directory() . '/includes/welcome.php';
38
require get_template_directory() . '/includes/404-widget.php';
39
require get_template_directory() . '/includes/gutenberg.php';
40
require get_template_directory() . '/includes/classes/class-lsx-schema-utils.php';
41
require get_template_directory() . '/includes/classes/class-lsx-schema-graph-piece.php';
42
require get_template_directory() . '/includes/classes/class-lsx-optimisation.php';
43
require get_template_directory() . '/includes/classes/class-lsx-rest-helper.php';
44