1 | <?php |
||
24 | class VartypePHP7 { |
||
|
|||
25 | |||
26 | /** |
||
27 | * The PHP7 specific tests. |
||
28 | * |
||
29 | * @var array $tests Multi-dimensional array. |
||
30 | */ |
||
31 | public static $tests = array( |
||
32 | |||
33 | /* |
||
34 | * Functions where errors have been turned into exceptions. |
||
35 | * |
||
36 | * @see class.vartype-arithmetic.php |
||
37 | */ |
||
38 | 'modulus' => array( |
||
39 | 'function' => 'VartypePHP7::do_modulus( $a, $b );', |
||
40 | ), |
||
41 | 'intdiv' => array( |
||
42 | 'function' => 'VartypePHP7::do_intdiv( $a, $b );', |
||
43 | ), |
||
44 | ); |
||
45 | |||
46 | |||
47 | /** |
||
48 | * Helper method to retrieve the static variable. |
||
49 | * Needed to prevent parse error in PHP4.. *sigh*. |
||
50 | * |
||
51 | * @return array |
||
52 | */ |
||
53 | public static function get_tests() { |
||
56 | |||
57 | |||
58 | /** |
||
59 | * PHP7 compatible version of % arithmetics. |
||
60 | * |
||
61 | * @param mixed $var1 |
||
62 | * @param mixed $var2 |
||
63 | */ |
||
64 | public static function do_modulus( $var1, $var2 ) { |
||
79 | |||
80 | |||
81 | /** |
||
82 | * Test intdiv. |
||
83 | * |
||
84 | * @param mixed $var1 |
||
85 | * @param mixed $var2 |
||
86 | */ |
||
87 | public static function do_intdiv( $var1, $var2 ) { |
||
101 | |||
102 | |||
103 | /** |
||
104 | * Helper function to handle exceptions from overloaded functions. |
||
105 | * |
||
106 | * @internal Exception handling is currently the same as for the PHP5 specific code, but added as separate |
||
107 | * method to allow for future adjustment. |
||
108 | * |
||
109 | * @param string $message The error message. |
||
110 | */ |
||
111 | public static function handle_exception( $message ) { |
||
114 | } |
||
115 |
This check examines a number of code elements and verifies that they conform to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.