1 | <?php |
||
10 | class OpcacheResetCommandHelper |
||
11 | { |
||
12 | const FILE_NAME_MODEL = 'opcache-reset-%s.php'; |
||
13 | |||
14 | /** |
||
15 | * @var KernelInterface |
||
16 | */ |
||
17 | protected $kernel; |
||
18 | |||
19 | public function __construct(KernelInterface $kernel) |
||
23 | |||
24 | /** |
||
25 | * Return generated file name. |
||
26 | * |
||
27 | * @param string $replacement |
||
28 | * |
||
29 | * @return string |
||
30 | */ |
||
31 | public function getFileName($replacement) |
||
35 | |||
36 | /** |
||
37 | * Return generated file path. |
||
38 | * |
||
39 | * @param string $dir |
||
40 | * @param string $replacement |
||
41 | * |
||
42 | * @return string |
||
43 | */ |
||
44 | public function getFilePath($dir, $replacement) |
||
48 | |||
49 | /** |
||
50 | * Generate url with given host and token. |
||
51 | * |
||
52 | * @param string $host |
||
53 | * @param string $token |
||
54 | * |
||
55 | * @return string |
||
56 | */ |
||
57 | public function generateUrl($host, $token) |
||
61 | |||
62 | /** |
||
63 | * Create file in given directory. |
||
64 | * |
||
65 | * @param string $dir |
||
66 | * @param string $token |
||
67 | * |
||
68 | * @return OpcacheResetCommandHelper |
||
69 | */ |
||
70 | public function createFile($dir, $token) |
||
87 | |||
88 | /** |
||
89 | * Remove all opcache reset files. |
||
90 | * |
||
91 | * @param string $dir |
||
92 | * |
||
93 | * @return OpcacheResetCommandHelper |
||
94 | */ |
||
95 | public function clean($dir) |
||
101 | |||
102 | /** |
||
103 | * Handle given response and return message from it. |
||
104 | * |
||
105 | * @param HttpResponse $response |
||
106 | * |
||
107 | * @return string |
||
108 | */ |
||
109 | public function handleResponse(HttpResponse $response) |
||
135 | } |
||
136 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.