1 | <?php |
||
15 | class RentbitsWidgets { |
||
16 | |||
17 | /** |
||
18 | * Widget data to be sent to JS. |
||
19 | * |
||
20 | * @var [Array] |
||
21 | */ |
||
22 | static private $rb_data; |
||
23 | |||
24 | /** |
||
25 | * __construct function. |
||
26 | * |
||
27 | * @access public |
||
28 | * @return void |
||
29 | */ |
||
30 | public function __construct() { |
||
33 | |||
34 | /** |
||
35 | * Handle multiple rb widgets js enqueues. |
||
36 | */ |
||
37 | public function rb_enqueue() { |
||
42 | |||
43 | /* Rentbits WIDGETS. */ |
||
44 | |||
45 | /** |
||
46 | * Get Rental Comparison Widget. |
||
47 | * |
||
48 | * @access public |
||
49 | * @param mixed $loc1 First Location. |
||
50 | * @param mixed $loc2 Second Location. |
||
51 | * @param mixed $loc3 Third Location. |
||
52 | * @param mixed $loc4 Fourth Location. |
||
53 | * @return void |
||
54 | */ |
||
55 | public function get_rental_comparison_widget( $loc1, $loc2, $loc3, $loc4 ) { |
||
70 | |||
71 | /** |
||
72 | * Get Average Rental Rates Widget. |
||
73 | * |
||
74 | * @access public |
||
75 | * @param mixed $loc Location. |
||
76 | * @return void |
||
77 | */ |
||
78 | public function get_average_rental_rates_widget( $loc ) { |
||
93 | } |
||
94 | } |
||
95 |
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.