Completed
Branch middleware (801be0)
by Julián
03:06
created
src/Handler/Render.php 1 patch
Unused Use Statements   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,10 +10,10 @@
 block discarded – undo
10 10
 namespace Janitor\Handler;
11 11
 
12 12
 use Janitor\Handler as HandlerInterface;
13
-use Janitor\Watcher;
14 13
 use Janitor\ScheduledWatcher;
15
-use Psr\Http\Message\ServerRequestInterface;
14
+use Janitor\Watcher;
16 15
 use Psr\Http\Message\ResponseInterface;
16
+use Psr\Http\Message\ServerRequestInterface;
17 17
 use Zend\Diactoros\Stream;
18 18
 
19 19
 /**
Please login to merge, or discard this patch.
src/Janitor.php 2 patches
Doc Comments   +1 added lines, -3 removed lines patch added patch discarded remove patch
@@ -46,8 +46,7 @@  discard block
 block discarded – undo
46 46
     /**
47 47
      * @param array                 $watchers
48 48
      * @param array                 $excluders
49
-     * @param \Janitor\Handler|null $handler
50
-     * @param string                $requestAttribute
49
+     * @param null|callable $handler
51 50
      */
52 51
     public function __construct(
53 52
         array $watchers = [],
@@ -153,7 +152,6 @@  discard block
 block discarded – undo
153 152
      *
154 153
      * @param \Psr\Http\Message\ServerRequestInterface $request
155 154
      * @param \Psr\Http\Message\ResponseInterface      $response
156
-     * @param \Janitor\Watcher                          $watcher
157 155
      *
158 156
      * @return \Psr\Http\Message\ResponseInterface
159 157
      */
Please login to merge, or discard this patch.
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@
 block discarded – undo
10 10
 namespace Janitor;
11 11
 
12 12
 use Janitor\Handler\Render as RenderHandler;
13
-use Psr\Http\Message\ServerRequestInterface;
14 13
 use Psr\Http\Message\ResponseInterface;
14
+use Psr\Http\Message\ServerRequestInterface;
15 15
 
16 16
 class Janitor
17 17
 {
Please login to merge, or discard this patch.
tests/Janitor/JanitorTest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
         $response = $janitor(
81 81
             ServerRequestFactory::fromGlobals(),
82 82
             new Response('php://temp'),
83
-            function ($request, $response) {
83
+            function($request, $response) {
84 84
                 return $response->withHeader('janitor', 'tested');
85 85
             }
86 86
         );
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
         $response = $janitor(
109 109
             $request,
110 110
             new Response('php://temp'),
111
-            function () {
111
+            function() {
112 112
             }
113 113
         );
114 114
         $this->assertTrue(substr($response->getBody(), 0, 1) === '{');
@@ -130,14 +130,14 @@  discard block
 block discarded – undo
130 130
         $watcher->expects($this->any())->method('isActive')->will($this->returnValue(true));
131 131
         $this->janitor->addWatcher($watcher);
132 132
 
133
-        $this->janitor->setHandler(function ($request, $response, $watcher) {
133
+        $this->janitor->setHandler(function($request, $response, $watcher) {
134 134
             return $response->withHeader('active_watcher', get_class($watcher));
135 135
         });
136 136
 
137 137
         $response = $janitor(
138 138
             ServerRequestFactory::fromGlobals(),
139 139
             new Response('php://temp'),
140
-            function () {
140
+            function() {
141 141
             }
142 142
         );
143 143
         $this->assertEquals(get_class($watcher), $response->getHeaderLine('active_watcher'));
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
         $response = $janitor(
170 170
             ServerRequestFactory::fromGlobals(),
171 171
             new Response('php://temp'),
172
-            function ($request, $response) use ($customAttributeName) {
172
+            function($request, $response) use ($customAttributeName) {
173 173
                 return $response->withHeader(
174 174
                     $customAttributeName,
175 175
                     get_class($request->getAttribute($customAttributeName))
Please login to merge, or discard this patch.