1 | <?php |
||
18 | class WC_Payment_Token_eCheck extends WC_Payment_Token { |
||
19 | |||
20 | /** @protected string Token Type String */ |
||
21 | protected $type = 'eCheck'; |
||
22 | |||
23 | /** |
||
24 | * Validate eCheck payment tokens. |
||
25 | * |
||
26 | * These fields are required by all eCheck payment tokens: |
||
27 | * last4 - string Last 4 digits of the check |
||
28 | * |
||
29 | * @since 2.6.0 |
||
30 | * @return boolean True if the passed data is valid |
||
31 | */ |
||
32 | public function validate() { |
||
42 | |||
43 | /** |
||
44 | * Get type to display to user. |
||
45 | * @return string |
||
46 | */ |
||
47 | public function get_display_name() { |
||
50 | |||
51 | /** |
||
52 | * Returns the last four digits. |
||
53 | * @since 2.6.0 |
||
54 | * @return string Last 4 digits |
||
55 | */ |
||
56 | public function get_last4() { |
||
59 | |||
60 | /** |
||
61 | * Set the last four digits. |
||
62 | * @since 2.6.0 |
||
63 | * @param string $last4 |
||
64 | */ |
||
65 | public function set_last4( $last4 ) { |
||
68 | |||
69 | } |
||
70 |
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.