1 | <?php |
||
12 | class Form_Collection extends Collection { |
||
13 | /** |
||
14 | * Add a \GV\Form to this collection. |
||
15 | * |
||
16 | * @param \GV\Form $form The form to add to the internal array. |
||
17 | * |
||
18 | * @throws \InvalidArgumentException if $form is not of type \GV\Form. |
||
19 | * |
||
20 | * @api |
||
21 | * @since future |
||
22 | * @return void |
||
23 | */ |
||
24 | 1 | public function add( $form ) { |
|
30 | |||
31 | /** |
||
32 | * Get a \GV\Form from this list. |
||
33 | * |
||
34 | * @param int $form_id The ID of the form to get. |
||
35 | * @param string $backend The form backend identifier, allows for multiple form backends in the future. Unused until then. |
||
36 | * |
||
37 | * @api |
||
38 | * @since future |
||
39 | * |
||
40 | * @return \GV\Form|null The \GV\Form with the $form_id as the ID, or null if not found. |
||
41 | */ |
||
42 | 1 | public function get( $form_id, $backend = 'gravityforms' ) { |
|
50 | } |
||
51 |
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.