@@ -137,7 +137,7 @@ |
||
| 137 | 137 | |
| 138 | 138 | usort( |
| 139 | 139 | $scheduledTimes, |
| 140 | - function ($time1, $time2) { |
|
| 140 | + function($time1, $time2) { |
|
| 141 | 141 | if ($time1['start'] == $time2['start']) { |
| 142 | 142 | return 0; |
| 143 | 143 | } |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | 35 | * @param array $ips |
| 36 | - * @param array $trustedProxies |
|
| 36 | + * @param string[] $trustedProxies |
|
| 37 | 37 | */ |
| 38 | 38 | public function __construct(array $ips = [], array $trustedProxies = []) |
| 39 | 39 | { |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | */ |
| 32 | 32 | public static function setUpBeforeClass() |
| 33 | 33 | { |
| 34 | - self::$tmpFile = sys_get_temp_dir() . '/maintenance'; |
|
| 34 | + self::$tmpFile = sys_get_temp_dir().'/maintenance'; |
|
| 35 | 35 | |
| 36 | 36 | touch(self::$tmpFile); |
| 37 | 37 | } |
@@ -122,12 +122,12 @@ |
||
| 122 | 122 | $endTime->add(new \DateInterval('PT1H')); |
| 123 | 123 | |
| 124 | 124 | $this->watcher->setInterval('PT1H'); |
| 125 | - $this->watcher->setExpression('* ' . $currentTime->format('H') . ' ' . $currentTime->format('d') . ' * *'); |
|
| 125 | + $this->watcher->setExpression('* '.$currentTime->format('H').' '.$currentTime->format('d').' * *'); |
|
| 126 | 126 | |
| 127 | 127 | self::assertTrue($this->watcher->isScheduled()); |
| 128 | 128 | self::assertEquals([['start' => $currentTime, 'end' => $endTime]], $this->watcher->getScheduledTimes(1)); |
| 129 | 129 | |
| 130 | - $this->watcher->setExpression('* ' . $currentTime->format('H') . ' ' . $currentTime->format('D') . ' * *'); |
|
| 130 | + $this->watcher->setExpression('* '.$currentTime->format('H').' '.$currentTime->format('D').' * *'); |
|
| 131 | 131 | self::assertEquals([], $this->watcher->getScheduledTimes()); |
| 132 | 132 | } |
| 133 | 133 | } |
@@ -30,10 +30,10 @@ |
||
| 30 | 30 | */ |
| 31 | 31 | public function testIsExcluded($username, $password) |
| 32 | 32 | { |
| 33 | - $authString = $username . ($password === null ? '' : ':' . $password); |
|
| 33 | + $authString = $username.($password === null ? '' : ':'.$password); |
|
| 34 | 34 | |
| 35 | 35 | $request = ServerRequestFactory::fromGlobals(); |
| 36 | - $request = $request->withHeader('Authorization', 'Basic ' . base64_encode($authString)); |
|
| 36 | + $request = $request->withHeader('Authorization', 'Basic '.base64_encode($authString)); |
|
| 37 | 37 | |
| 38 | 38 | $excluder = new BasicAuth(); |
| 39 | 39 | $excluder->addUser($username, $password); |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | $response = $janitor( |
| 85 | 85 | ServerRequestFactory::fromGlobals(), |
| 86 | 86 | new Response('php://temp'), |
| 87 | - function (ServerRequestInterface $request, ResponseInterface $response) { |
|
| 87 | + function(ServerRequestInterface $request, ResponseInterface $response) { |
|
| 88 | 88 | return $response->withHeader('janitor', 'tested'); |
| 89 | 89 | } |
| 90 | 90 | ); |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | $response = $janitor( |
| 107 | 107 | $request, |
| 108 | 108 | new Response('php://temp'), |
| 109 | - function () { |
|
| 109 | + function() { |
|
| 110 | 110 | } |
| 111 | 111 | ); |
| 112 | 112 | self::assertSame(strpos($response->getBody(), '{'), 0); |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | $this->janitor->addWatcher($watcher); |
| 122 | 122 | |
| 123 | 123 | $this->janitor->setHandler( |
| 124 | - function (ServerRequestInterface $request, ResponseInterface $response, $watcher) { |
|
| 124 | + function(ServerRequestInterface $request, ResponseInterface $response, $watcher) { |
|
| 125 | 125 | return $response->withHeader('active_watcher', get_class($watcher)); |
| 126 | 126 | } |
| 127 | 127 | ); |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | $response = $janitor( |
| 131 | 131 | ServerRequestFactory::fromGlobals(), |
| 132 | 132 | new Response('php://temp'), |
| 133 | - function () { |
|
| 133 | + function() { |
|
| 134 | 134 | } |
| 135 | 135 | ); |
| 136 | 136 | self::assertEquals(get_class($watcher), $response->getHeaderLine('active_watcher')); |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | $response = $janitor( |
| 157 | 157 | ServerRequestFactory::fromGlobals(), |
| 158 | 158 | new Response('php://temp'), |
| 159 | - function (ServerRequestInterface $request, ResponseInterface $response) use ($customAttributeName) { |
|
| 159 | + function(ServerRequestInterface $request, ResponseInterface $response) use ($customAttributeName) { |
|
| 160 | 160 | return $response->withHeader( |
| 161 | 161 | $customAttributeName, |
| 162 | 162 | get_class($request->getAttribute($customAttributeName)) |
@@ -9,4 +9,4 @@ |
||
| 9 | 9 | |
| 10 | 10 | session_start(); |
| 11 | 11 | |
| 12 | -require_once __DIR__ . '/../vendor/autoload.php'; |
|
| 12 | +require_once __DIR__.'/../vendor/autoload.php'; |
|
@@ -202,7 +202,7 @@ |
||
| 202 | 202 | $interval = $this->interval; |
| 203 | 203 | |
| 204 | 204 | return array_map( |
| 205 | - function (\DateTime $start) use ($interval) { |
|
| 205 | + function(\DateTime $start) use ($interval) { |
|
| 206 | 206 | $end = clone $start; |
| 207 | 207 | $end->add($interval); |
| 208 | 208 | |
@@ -83,9 +83,9 @@ discard block |
||
| 83 | 83 | $message = $this->getMaintenanceMessage($watcher); |
| 84 | 84 | |
| 85 | 85 | return sprintf( |
| 86 | - "<html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8'>" . |
|
| 87 | - "<title>%s</title><style>body{margin:0;padding:30px;font:12px/1.5 Helvetica,Arial,Verdana," . |
|
| 88 | - "sans-serif;}h1{margin:0;font-size:48px;font-weight:normal;line-height:48px;}strong{" . |
|
| 86 | + "<html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8'>". |
|
| 87 | + "<title>%s</title><style>body{margin:0;padding:30px;font:12px/1.5 Helvetica,Arial,Verdana,". |
|
| 88 | + "sans-serif;}h1{margin:0;font-size:48px;font-weight:normal;line-height:48px;}strong{". |
|
| 89 | 89 | "display:inline-block;width:65px;}</style></head><body><h1>%s</h1>%s</body></html>", |
| 90 | 90 | $title, |
| 91 | 91 | $title, |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | $message = 'Maintenance mode is not active!'; |
| 133 | 133 | if ($watcher->isActive()) { |
| 134 | 134 | $message = $watcher instanceof ScheduledWatcher |
| 135 | - ? 'Undergoing maintenance tasks until ' . $watcher->getEnd()->format('Y/m/d H:i:s') |
|
| 135 | + ? 'Undergoing maintenance tasks until '.$watcher->getEnd()->format('Y/m/d H:i:s') |
|
| 136 | 136 | : 'Undergoing maintenance tasks'; |
| 137 | 137 | } |
| 138 | 138 | |