1 | <?php |
||
18 | abstract class AbstractSniffMethodTestFramework extends BaseSniffTest |
||
19 | { |
||
20 | |||
21 | public $filename; |
||
22 | |||
23 | /** |
||
24 | * The PHP_CodeSniffer_File object containing parsed contents of this file. |
||
25 | * |
||
26 | * @var PHP_CodeSniffer_File |
||
27 | */ |
||
28 | protected $_phpcsFile; |
||
29 | |||
30 | /** |
||
31 | * A wrapper for the abstract PHPCompatibility sniff. |
||
32 | * |
||
33 | * @var PHPCompatibility_Sniff |
||
34 | */ |
||
35 | protected $helperClass; |
||
36 | |||
37 | |||
38 | public static function setUpBeforeClass() |
||
42 | |||
43 | protected function setUp() |
||
74 | |||
75 | /** |
||
76 | * Clean up after finished test. |
||
77 | * |
||
78 | * @return void |
||
79 | */ |
||
80 | public function tearDown() |
||
85 | |||
86 | } |
||
87 |
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.