1 | <?php namespace Cornford\Alerter; |
||
9 | class AlertDisplay implements DisplayableInterface { |
||
10 | |||
11 | const VIEW_SIMPLE = 'simple'; |
||
12 | const VIEW_LIST = 'list'; |
||
13 | const VIEW_BOOTSTRAP = 'bootstrap'; |
||
14 | const VIEW_BOOTSTRAP_CLOSABLE = 'bootstrap-closeable'; |
||
15 | const VIEW_FOUNDATION = 'foundation'; |
||
16 | const VIEW_FOUNDATION_CLOSABLE = 'foundation-closable'; |
||
17 | const VIEW_PURE = 'pure'; |
||
18 | const VIEW_PURE_CLOSABLE = 'pure-closable'; |
||
19 | |||
20 | /** |
||
21 | * The views base folder. |
||
22 | * |
||
23 | * @var string |
||
24 | */ |
||
25 | protected $viewPath; |
||
26 | |||
27 | /** |
||
28 | * The Alert object. |
||
29 | * |
||
30 | * @var Alert |
||
31 | */ |
||
32 | private $alert; |
||
33 | |||
34 | /** |
||
35 | * The view name. |
||
36 | * |
||
37 | * @var string |
||
38 | */ |
||
39 | private $view; |
||
40 | |||
41 | /** |
||
42 | * Construct class with an alert object, a display view, and a view path. |
||
43 | * |
||
44 | * @param Alert $alert |
||
45 | * @param string $view |
||
46 | * @param string $viewPath |
||
47 | * |
||
48 | * @return self |
||
|
|||
49 | * |
||
50 | * @throws \Cornford\Alerter\Exceptions\AlertDisplayViewPathException |
||
51 | */ |
||
52 | public function __construct(Alert $alert, $viewPath, $view) |
||
65 | |||
66 | /** |
||
67 | * Get the directory iterator. |
||
68 | * |
||
69 | * @return RecursiveIteratorIterator |
||
70 | */ |
||
71 | protected function getDirectoryIterator() |
||
77 | |||
78 | /** |
||
79 | * Track down the display view file. |
||
80 | * |
||
81 | * @return string |
||
82 | * |
||
83 | * @throws \Cornford\Alerter\Exceptions\AlertDisplayViewException |
||
84 | */ |
||
85 | protected function findDisplayViewFile() |
||
97 | |||
98 | /** |
||
99 | * Is the given file a display view file? |
||
100 | * |
||
101 | * @param string $name |
||
102 | * |
||
103 | * @return bool |
||
104 | */ |
||
105 | protected function isDisplayViewFile($name) |
||
109 | |||
110 | /** |
||
111 | * Return a compiled alert display view. |
||
112 | * |
||
113 | * @return string |
||
114 | */ |
||
115 | public function display() |
||
122 | |||
123 | } |
||
124 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.