Passed
Push — main ( 34042d...ebfbeb )
by Dimitri
14:02
created
src/Container/Services.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -120,17 +120,17 @@  discard block
 block discarded – undo
120 120
         return static::$instances[Cache::class] = new Cache($config);
121 121
     }
122 122
 
123
-	/**
124
-	 * La clase Config offre une api fluide por gerer les configurations de l'application
125
-	 */
126
-	public static function config(bool $shared = true): Config
127
-	{
128
-		if (true === $shared && isset(static::$instances[Config::class])) {
123
+    /**
124
+     * La clase Config offre une api fluide por gerer les configurations de l'application
125
+     */
126
+    public static function config(bool $shared = true): Config
127
+    {
128
+        if (true === $shared && isset(static::$instances[Config::class])) {
129 129
             return static::$instances[Config::class];
130 130
         }
131 131
 		
132
-		return static::$instances[Config::class] = new Config();
133
-	}
132
+        return static::$instances[Config::class] = new Config();
133
+    }
134 134
 
135 135
     /**
136 136
      * Conteneur d'injection de dependances
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
             return static::$instances[Container::class];
142 142
         }
143 143
 		
144
-		return static::$instances[Container::class] = new Container();
144
+        return static::$instances[Container::class] = new Container();
145 145
     }
146 146
 
147 147
     /**
Please login to merge, or discard this patch.
src/Router/Dispatcher.php 1 patch
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -125,8 +125,8 @@  discard block
 block discarded – undo
125 125
      * Chemin de requête à utiliser.
126 126
      *
127 127
      * @var string
128
-	 * 
129
-	 * @deprecated No longer used.
128
+     * 
129
+     * @deprecated No longer used.
130 130
      */
131 131
     protected $path;
132 132
 
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
      */
136 136
     protected int $bufferLevel = 0;
137 137
 
138
-	/**
138
+    /**
139 139
      * Mise en cache des pages Web
140 140
      */
141 141
     protected ResponseCache $pageCache;
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
         $this->startTime = microtime(true);
149 149
         $this->config    = (object) config('app');
150 150
 
151
-		$this->pageCache = Services::responsecache();
151
+        $this->pageCache = Services::responsecache();
152 152
     }
153 153
 
154 154
     /**
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
             $controller = $routes->getDefaultController();
179 179
         }
180 180
 
181
-		if (! $fullName && is_string($controller)) {
181
+        if (! $fullName && is_string($controller)) {
182 182
             $controller = str_replace($routes->getDefaultNamespace(), '', $controller);
183 183
         }
184 184
 
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 
211 211
         $this->initMiddlewareQueue();
212 212
 
213
-		try {
213
+        try {
214 214
             $this->response = $this->handleRequest($routes, config('cache'));
215 215
         } catch (ResponsableInterface|RedirectException $e) {
216 216
             $this->outputBufferingEnd();
@@ -242,17 +242,17 @@  discard block
 block discarded – undo
242 242
      */
243 243
     protected function handleRequest(?RouteCollectionInterface $routes = null, ?array $cacheConfig = null): ResponseInterface
244 244
     {
245
-		$this->forceSecureAccess();
245
+        $this->forceSecureAccess();
246 246
 
247
-		/**
247
+        /**
248 248
          * Init event manager
249 249
          */
250
-		Services::singleton(EventDiscover::class)->discove();
250
+        Services::singleton(EventDiscover::class)->discove();
251 251
 
252
-		$this->event->trigger('pre_system');
252
+        $this->event->trigger('pre_system');
253 253
 
254
-		// Check for a cached page. 
255
-		// Execution will stop if the page has been cached.
254
+        // Check for a cached page. 
255
+        // Execution will stop if the page has been cached.
256 256
         if (($response = $this->displayCache($cacheConfig)) instanceof ResponseInterface) {
257 257
             return $response;
258 258
         }
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
         $routeMiddlewares = (array) $this->dispatchRoutes($routes);
261 261
 
262 262
         // Le bootstrap dans un middleware
263
-		$this->middleware->alias('blitz', $this->bootApp());
263
+        $this->middleware->alias('blitz', $this->bootApp());
264 264
         $this->middleware->append('blitz');
265 265
 
266 266
         /**
@@ -383,13 +383,13 @@  discard block
 block discarded – undo
383 383
      */
384 384
     public function displayCache(?array $config = null)
385 385
     {
386
-		if ($cachedResponse = $this->pageCache->get($this->request, $this->response)) {
386
+        if ($cachedResponse = $this->pageCache->get($this->request, $this->response)) {
387 387
             $this->response = $cachedResponse;
388 388
 
389 389
             $this->totalTime = $this->timer->getElapsedTime('total_execution');
390 390
             $output          = $this->displayPerformanceMetrics($cachedResponse->getBody());
391 391
         
392
-			return $this->response->withBody(to_stream($output));
392
+            return $this->response->withBody(to_stream($output));
393 393
         }
394 394
 
395 395
         return false;
@@ -588,7 +588,7 @@  discard block
 block discarded – undo
588 588
 
589 589
             $this->gatherOutput($returned);
590 590
            
591
-			return $this->response;
591
+            return $this->response;
592 592
         }
593 593
 
594 594
         // Affiche l'erreur 404
@@ -658,13 +658,13 @@  discard block
 block discarded – undo
658 658
             $uri = Services::uri($uri, false);
659 659
         }
660 660
 
661
-		Services::session()->setPreviousUrl(Uri::createURIString(
662
-			$uri->getScheme(),
663
-			$uri->getAuthority(),
664
-			$uri->getPath(),
665
-			$uri->getQuery(),
666
-			$uri->getFragment()
667
-		));
661
+        Services::session()->setPreviousUrl(Uri::createURIString(
662
+            $uri->getScheme(),
663
+            $uri->getAuthority(),
664
+            $uri->getPath(),
665
+            $uri->getQuery(),
666
+            $uri->getFragment()
667
+        ));
668 668
     }
669 669
 
670 670
     /**
@@ -696,9 +696,9 @@  discard block
 block discarded – undo
696 696
             return $returned;
697 697
         }
698 698
 
699
-		if ($returned instanceof Responsable) {
700
-			return $returned->toResponse($this->request);
701
-		}
699
+        if ($returned instanceof Responsable) {
700
+            return $returned->toResponse($this->request);
701
+        }
702 702
 
703 703
         if (is_object($returned)) {
704 704
             if (method_exists($returned, '__toString')) {
@@ -743,11 +743,11 @@  discard block
 block discarded – undo
743 743
         $this->middleware->prepend($this->spoofRequestMethod());
744 744
     }
745 745
 
746
-	protected function outputBufferingStart(): void
746
+    protected function outputBufferingStart(): void
747 747
     {
748 748
         $this->bufferLevel = ob_get_level();
749 749
        
750
-		ob_start();
750
+        ob_start();
751 751
     }
752 752
 
753 753
     protected function outputBufferingEnd(): string
@@ -817,7 +817,7 @@  discard block
 block discarded – undo
817 817
                 }
818 818
 
819 819
                 if (is_string($this->controller)) {
820
-					if (strtoupper($request->getMethod()) === 'POST') {
820
+                    if (strtoupper($request->getMethod()) === 'POST') {
821 821
                         if (is_subclass_of($this->controller, RestController::class)) {
822 822
                             return $this->formatResponse($response->withStatus($code), [
823 823
                                 'success' => false,
@@ -825,7 +825,7 @@  discard block
 block discarded – undo
825 825
                                 'errors'  => $errors,
826 826
                             ]);
827 827
                         }
828
-						if (is_subclass_of($this->controller, BaseController::class)) {
828
+                        if (is_subclass_of($this->controller, BaseController::class)) {
829 829
                             return Services::redirection()->back()->withInput()->withErrors($errors)->withStatus($code);
830 830
                         }
831 831
                     }
Please login to merge, or discard this patch.