1 | <?php |
||
13 | class ConsoleObserver implements SiteCheckObserver |
||
14 | { |
||
15 | |||
16 | /** |
||
17 | * @var LoggerInterface |
||
18 | */ |
||
19 | protected $logger; |
||
20 | |||
21 | /** |
||
22 | * @var Config |
||
23 | */ |
||
24 | protected $config; |
||
25 | |||
26 | /** |
||
27 | * @param Config $config |
||
28 | */ |
||
29 | public function setConfig($config) |
||
33 | |||
34 | /** |
||
35 | * SiteChecker constructor. |
||
36 | * @param \Psr\Log\LoggerInterface|null $logger |
||
37 | */ |
||
38 | public function __construct(LoggerInterface $logger = null) |
||
42 | |||
43 | /** |
||
44 | * No additional checks here for now. |
||
45 | * |
||
46 | * @param \SiteChecker\Asset $url |
||
47 | * @return bool |
||
48 | */ |
||
49 | public function pageToCheck(Asset $url) |
||
53 | |||
54 | |||
55 | /** |
||
56 | * Log page to console. |
||
57 | * |
||
58 | * @param \SiteChecker\Asset $asset |
||
59 | * @param $response |
||
60 | * @return mixed |
||
61 | */ |
||
62 | public function pageChecked( |
||
68 | |||
69 | |||
70 | /** |
||
71 | * Show results. |
||
72 | * |
||
73 | * @param Asset[] $assets |
||
74 | */ |
||
75 | public function receiveResults(array $assets) |
||
80 | |||
81 | /** |
||
82 | * Show results. |
||
83 | * |
||
84 | * @param Asset[] $assets |
||
85 | */ |
||
86 | protected function sendEmailResults($assets) |
||
131 | |||
132 | /** |
||
133 | * Called when the checker has checked the given page. |
||
134 | * |
||
135 | * @param Asset $asset |
||
136 | */ |
||
137 | public function logResult($asset) |
||
159 | |||
160 | /** |
||
161 | * Called when the check was ended. |
||
162 | * |
||
163 | * @param Asset[] $assets |
||
164 | */ |
||
165 | public function showResults(array $assets) |
||
185 | } |
||
186 |