PhpSecInfo_Test_Core::isTestable()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 20 and the first side effect is on line 12.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
/**
3
 * Skeleton Test class file for Core group
4
 * 
5
 * @package PhpSecInfo
6
 * @author Ed Finkler <[email protected]>
7
 */
8
9
/**
10
 * require the main PhpSecInfo class
11
 */
12
require_once(PHPSECINFO_BASE_DIR.'/Test/Test.php');
13
14
15
16
/**
17
 * This is a skeleton class for PhpSecInfo "Core" tests
18
 * @package PhpSecInfo
19
 */
20
class PhpSecInfo_Test_Core extends PhpSecInfo_Test
0 ignored issues
show
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...
21
{
22
	
23
	/**
24
	 * This value is used to group test results together.
25
	 * 
26
	 * For example, all tests related to the mysql lib should be grouped under "mysql."
27
	 *
28
	 * @var string
29
	 */
30
	var $test_group = 'Core';
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $test_group.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
31
	
32
	
33
	/**
34
	 * "Core" tests should pretty much be always testable, so the default is just to return true
35
	 * 
36
	 * @return boolean
37
	 */
38
	function isTestable() {
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
39
		
40
		return true;
41
	}
42
43
	
44
}