Completed
Push — develop ( f80003...852d20 )
by Stuart
02:27
created

inspectList/ExampleClasses.inc.php (12 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
class ExampleClass1
0 ignored issues
show
Comprehensibility Best Practice introduced by
The type ExampleClass1 has been defined more than once; this definition is ignored, only the first definition in doc-examples/HasClassPro.../ExampleClasses.inc.php (L3-16) is considered.

This check looks for classes that have been defined more than once.

If you can, we would recommend to use standard object-oriented programming techniques. For example, to avoid multiple types, it might make sense to create a common interface, and then multiple, different implementations for that interface.

This also has the side-effect of providing you with better IDE auto-completion, static analysis and also better OPCode caching from PHP.

Loading history...
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
4
{
5
    // HasClassProperties::check() will find these, depending on the
6
    // $filter that you pass to it
7
    public static $value1 = "I am public static value1";
8
    protected static $value2 = "I am protected static value2";
9
    private static $value3 = "I am private static value3";
0 ignored issues
show
The property $value3 is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
10
11
    // HasClassProperties::check() will not find these, because they are not
12
    // static propertes
13
    public $value4 = "I am public value4";
14
    protected $value5 = "I am protected value5";
15
    private $value6 = "I am private value6";
0 ignored issues
show
The property $value6 is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
16
}
17
18
class ExampleClass2
0 ignored issues
show
Comprehensibility Best Practice introduced by
The type ExampleClass2 has been defined more than once; this definition is ignored, only the first definition in doc-examples/HasClassPro.../ExampleClasses.inc.php (L18-31) is considered.

This check looks for classes that have been defined more than once.

If you can, we would recommend to use standard object-oriented programming techniques. For example, to avoid multiple types, it might make sense to create a common interface, and then multiple, different implementations for that interface.

This also has the side-effect of providing you with better IDE auto-completion, static analysis and also better OPCode caching from PHP.

Loading history...
Coding Style Compatibility introduced by
PSR1 recommends that each class should be in its own file to aid autoloaders.

Having each class in a dedicated file usually plays nice with PSR autoloaders and is therefore a well established practice. If you use other autoloaders, you might not want to follow this rule.

Loading history...
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
19
{
20
    // HasClassProperties::check() will find these, depending on the
21
    // $filter that you pass to it
22
    public static $value7 = "I am public static value7";
23
    protected static $value8 = "I am protected static value8";
24
    private static $value9 = "I am private static value9";
0 ignored issues
show
The property $value9 is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
25
26
    // HasClassProperties::check() will not find these, because they are not
27
    // static propertes
28
    public $value10 = "I am public value10";
29
    protected $value11 = "I am protected value11";
30
    private $value12 = "I am private value12";
0 ignored issues
show
The property $value12 is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
31
}
32
33
class ExampleClass3
0 ignored issues
show
Comprehensibility Best Practice introduced by
The type ExampleClass3 has been defined more than once; this definition is ignored, only the first definition in doc-examples/HasClassPro.../ExampleClasses.inc.php (L33-36) is considered.

This check looks for classes that have been defined more than once.

If you can, we would recommend to use standard object-oriented programming techniques. For example, to avoid multiple types, it might make sense to create a common interface, and then multiple, different implementations for that interface.

This also has the side-effect of providing you with better IDE auto-completion, static analysis and also better OPCode caching from PHP.

Loading history...
Coding Style Compatibility introduced by
PSR1 recommends that each class should be in its own file to aid autoloaders.

Having each class in a dedicated file usually plays nice with PSR autoloaders and is therefore a well established practice. If you use other autoloaders, you might not want to follow this rule.

Loading history...
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
34
{
35
    // we have no static properties!
36
}