Completed
Push — master ( f67993...be5511 )
by butschster
31s queued 27s
created
src/Framework/Session/Middleware/SessionMiddleware.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         CookiesConfig $cookiesConfig,
55 55
         SessionFactoryInterface $factory,
56 56
         ScopeInterface $scope
57
-    ) {
57
+    ){
58 58
         $this->config = $config;
59 59
         $this->httpConfig = $httpConfig;
60 60
         $this->cookiesConfig = $cookiesConfig;
@@ -73,14 +73,14 @@  discard block
 block discarded – undo
73 73
             $this->fetchID($request)
74 74
         );
75 75
 
76
-        try {
76
+        try{
77 77
             $response = $this->scope->runScope(
78 78
                 [SessionInterface::class => $session],
79 79
                 function () use ($handler, $request, $session) {
80 80
                     return $handler->handle($request->withAttribute(static::ATTRIBUTE, $session));
81 81
                 }
82 82
             );
83
-        } catch (\Throwable $e) {
83
+        }catch (\Throwable $e){
84 84
             $session->abort();
85 85
             throw $e;
86 86
         }
@@ -99,14 +99,14 @@  discard block
 block discarded – undo
99 99
         Request $request,
100 100
         Response $response
101 101
     ): Response {
102
-        if (!$session->isStarted()) {
102
+        if (!$session->isStarted()){
103 103
             return $response;
104 104
         }
105 105
 
106 106
         $session->commit();
107 107
 
108 108
         //SID changed
109
-        if ($this->fetchID($request) != $session->getID()) {
109
+        if ($this->fetchID($request) != $session->getID()){
110 110
             return $this->withCookie($request, $response, $session->getID());
111 111
         }
112 112
 
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
     protected function fetchID(Request $request): ?string
124 124
     {
125 125
         $cookies = $request->getCookieParams();
126
-        if (empty($cookies[$this->config->getCookie()])) {
126
+        if (empty($cookies[$this->config->getCookie()])){
127 127
             return null;
128 128
         }
129 129
 
@@ -154,8 +154,8 @@  discard block
 block discarded – undo
154 154
     protected function clientSignature(Request $request): string
155 155
     {
156 156
         $signature = '';
157
-        foreach (static::SIGNATURE_HEADERS as $header) {
158
-            $signature .= $request->getHeaderLine($header) . ';';
157
+        foreach (static::SIGNATURE_HEADERS as $header){
158
+            $signature .= $request->getHeaderLine($header).';';
159 159
         }
160 160
 
161 161
         return hash('sha256', $signature);
Please login to merge, or discard this patch.
src/Session/src/SessionFactory.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,15 +37,15 @@
 block discarded – undo
37 37
 
38 38
     public function initSession(string $clientSignature, string $id = null): SessionInterface
39 39
     {
40
-        if (session_status() === PHP_SESSION_ACTIVE) {
40
+        if (session_status() === PHP_SESSION_ACTIVE){
41 41
             throw new MultipleSessionException('Unable to initiate session, session already started');
42 42
         }
43 43
 
44 44
         // Initiating proper session handler
45
-        if ($this->config->getHandler() !== null) {
46
-            try {
45
+        if ($this->config->getHandler() !== null){
46
+            try{
47 47
                 $handler = $this->config->getHandler()->resolve($this->factory);
48
-            } catch (\Throwable | ContainerExceptionInterface $e) {
48
+            }catch (\Throwable | ContainerExceptionInterface $e){
49 49
                 throw new SessionException($e->getMessage(), $e->getCode(), $e);
50 50
             }
51 51
 
Please login to merge, or discard this patch.
Braces   +9 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,15 +37,20 @@
 block discarded – undo
37 37
 
38 38
     public function initSession(string $clientSignature, string $id = null): SessionInterface
39 39
     {
40
-        if (session_status() === PHP_SESSION_ACTIVE) {
40
+        if (session_status() === PHP_SESSION_ACTIVE)
41
+        {
41 42
             throw new MultipleSessionException('Unable to initiate session, session already started');
42 43
         }
43 44
 
44 45
         // Initiating proper session handler
45
-        if ($this->config->getHandler() !== null) {
46
-            try {
46
+        if ($this->config->getHandler() !== null)
47
+        {
48
+            try
49
+            {
47 50
                 $handler = $this->config->getHandler()->resolve($this->factory);
48
-            } catch (\Throwable | ContainerExceptionInterface $e) {
51
+            }
52
+            catch (\Throwable | ContainerExceptionInterface $e)
53
+            {
49 54
                 throw new SessionException($e->getMessage(), $e->getCode(), $e);
50 55
             }
51 56
 
Please login to merge, or discard this patch.
src/Framework/Bootloader/Http/SessionBootloader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
                 'handler' => new Autowire(
63 63
                     FileHandler::class,
64 64
                     [
65
-                        'directory' => $directories->get('runtime') . 'session',
65
+                        'directory' => $directories->get('runtime').'session',
66 66
                         'lifetime' => 86400,
67 67
                     ]
68 68
                 ),
Please login to merge, or discard this patch.