| 1 | <?php |
||
| 13 | class InputCollection extends Collectable { |
||
| 14 | |||
| 15 | /** |
||
| 16 | * |
||
| 17 | * |
||
| 18 | * @since 0.11.0 |
||
| 19 | * @access private |
||
| 20 | * @var InspectionAgent |
||
| 21 | */ |
||
| 22 | private $guard; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * __construct |
||
| 26 | * |
||
| 27 | * @since 0.10.0 |
||
| 28 | * |
||
| 29 | * @param array $data |
||
| 30 | * @param bool $trim |
||
| 31 | */ |
||
| 32 | public function __construct( InspectionAgent $guard, $trim = true ) { |
||
| 36 | |||
| 37 | /** |
||
| 38 | * |
||
| 39 | * |
||
| 40 | * @since 0.11.0 |
||
| 41 | * |
||
| 42 | * @param bool $tokens With or without token and action attributes. |
||
| 43 | * @return array |
||
| 44 | */ |
||
| 45 | public function get_array( $tokens = true ) { |
||
| 48 | |||
| 49 | /** |
||
| 50 | * Returns input array with out token and action attributes |
||
| 51 | * |
||
| 52 | * @since 0.11.0 |
||
| 53 | * @access protected |
||
| 54 | * |
||
| 55 | * @return array |
||
| 56 | */ |
||
| 57 | protected function neat_array() { |
||
| 63 | |||
| 64 | /** |
||
| 65 | * |
||
| 66 | * |
||
| 67 | * @since 0.11.0 |
||
| 68 | * @access protected |
||
| 69 | * |
||
| 70 | */ |
||
| 71 | protected function populate( $trim ) { |
||
| 80 | } |
||
| 81 |
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.