1 | <?php |
||
20 | class View |
||
21 | { |
||
22 | use SingletonTrait; |
||
23 | |||
24 | const DIRECTORY_SEPARATOR = \DIRECTORY_SEPARATOR; |
||
25 | |||
26 | /** @var string|null the base path. */ |
||
27 | private $basePath; |
||
28 | |||
29 | /** |
||
30 | * Construct a object. |
||
31 | */ |
||
32 | 4 | protected function __construct() |
|
36 | |||
37 | /** |
||
38 | * Returns the base path. |
||
39 | * |
||
40 | * @return string the base path. |
||
|
|||
41 | */ |
||
42 | 2 | public static function getBasePath() |
|
46 | |||
47 | /** |
||
48 | * Set the base path. |
||
49 | * |
||
50 | * @param string|null $basePath = null |
||
51 | */ |
||
52 | 2 | public static function setBasePath($basePath = null) |
|
56 | |||
57 | /** |
||
58 | * Returns the view at the given path with the given data. |
||
59 | * |
||
60 | * @param string $path |
||
61 | * @param string[] $data = [] |
||
62 | * @return string a string representation of the view. |
||
63 | */ |
||
64 | 2 | public static function get($path, $data = []) |
|
93 | } |
||
94 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.