| 1 | <?php |
||
| 10 | class Scope { |
||
| 11 | |||
| 12 | protected static $common = null; |
||
| 13 | |||
| 14 | public static $folder = 'scope'; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Returns request scope. |
||
| 18 | * |
||
| 19 | * @return array |
||
| 20 | */ |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @todo: Write description here. |
||
| 24 | * |
||
| 25 | * @param string|null $view_name View's name. |
||
| 26 | * |
||
| 27 | * @return array |
||
| 28 | */ |
||
| 29 | public static function get_scope( $view_name = null ) { |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Extends Scope with scope that is defined in theme_name/scope folder. |
||
| 53 | * |
||
| 54 | * @param array $scope |
||
| 55 | * @param string $view_name View's name. |
||
| 56 | * |
||
| 57 | * @return array |
||
| 58 | */ |
||
| 59 | public static function extend_scope( $scope, $view_name ) { |
||
| 66 | |||
| 67 | /** |
||
| 68 | * Returns Common Scope. |
||
| 69 | * |
||
| 70 | * @return array |
||
| 71 | */ |
||
| 72 | public static function get_common_scope() { |
||
| 83 | |||
| 84 | /** |
||
| 85 | * Requires file's scope. |
||
| 86 | * |
||
| 87 | * @param string $filename View's file name. |
||
| 88 | * |
||
| 89 | * @return array |
||
| 90 | */ |
||
| 91 | public static function require_scope( $filename ) { |
||
| 112 | } |
||
| 113 |
This check looks for type mismatches where the missing type is
false. This is usually indicative of an error condtion.Consider the follow example
This function either returns a new
DateTimeobject or false, if there was an error. This is a typical pattern in PHP programming to show that an error has occurred without raising an exception. The calling code should check for this returnedfalsebefore passing on the value to another function or method that may not be able to handle afalse.