@@ -58,7 +58,8 @@ |
||
58 | 58 | { |
59 | 59 | $dispatcher = Controller::create($router, $compiler); |
60 | 60 | |
61 | - return new Server(function (ServerRequestInterface $request) use ($router, $dispatcher, $compiler) { |
|
61 | + return new Server(function (ServerRequestInterface $request) use ($router, $dispatcher, $compiler) |
|
62 | + { |
|
62 | 63 | $httpMethod = $request->getMethod(); |
63 | 64 | $urlPath = Controller::normalizeUrl($request->getUri()->getPath()); |
64 | 65 |
@@ -9,6 +9,9 @@ discard block |
||
9 | 9 | |
10 | 10 | abstract class HtmlUtils |
11 | 11 | { |
12 | + /** |
|
13 | + * @param string $xpathQuery |
|
14 | + */ |
|
12 | 15 | public static function htmlXPath(\DOMDocument &$DOMDocument, $html, $xpathQuery) |
13 | 16 | { |
14 | 17 | $html = self::normalizeHTML($html); |
@@ -38,6 +41,9 @@ discard block |
||
38 | 41 | return $xpath->query($xpathQuery); |
39 | 42 | } |
40 | 43 | |
44 | + /** |
|
45 | + * @return string |
|
46 | + */ |
|
41 | 47 | private static function normalizeHTML($html) |
42 | 48 | { |
43 | 49 | if (strpos($html, '<body>') === false || strpos($html, '</body>') === false) |