Completed
Push — master ( 03d09a...5a221d )
by Charles
02:39
created
rest/Controller.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use app\models\User;
6 6
 use yrc\rest\Action as RestAction;
7
-
8 7
 use yii\web\HttpException;
9 8
 use Yii;
10 9
 
Please login to merge, or discard this patch.
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -47,12 +47,12 @@  discard block
 block discarded – undo
47 47
     {
48 48
         $behaviors = parent::behaviors();
49 49
 
50
-		$authenticator = false;
50
+        $authenticator = false;
51 51
 
52
-		if (isset($behaviors['authenticator'])) {
53
-			$authenticator = $behaviors['authenticator'];
54
-			unset($behaviors['authenticator']);        
55
-		}
52
+        if (isset($behaviors['authenticator'])) {
53
+            $authenticator = $behaviors['authenticator'];
54
+            unset($behaviors['authenticator']);        
55
+        }
56 56
 
57 57
         $behaviors['corsFilter'] = [
58 58
             'class' => Cors::className(),
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
                 'Access-Control-Request-Method' => $this->getHttpVerbMethodsFromClass($this->actions()[$this->action->id]),
62 62
                 'Access-Control-Request-Headers' => ['*'],
63 63
                 'Access-Control-Expose-Headers' => [
64
-					'Access-Control-Allow-Origin',
64
+                    'Access-Control-Allow-Origin',
65 65
                     'X-Pagination-Per-Page',
66 66
                     'X-Pagination-Total-Count',
67 67
                     'X-Pagination-Current-Page',
@@ -84,13 +84,13 @@  discard block
 block discarded – undo
84 84
             'enableRateLimitHeaders' => true
85 85
         ];
86 86
 
87
-		if ($authenticator != false) {
88
-			$behaviors['authenticator'] = $authenticator;
89
-			$behaviors['authenticator']['except'] = ['options'];
90
-		}
87
+        if ($authenticator != false) {
88
+            $behaviors['authenticator'] = $authenticator;
89
+            $behaviors['authenticator']['except'] = ['options'];
90
+        }
91 91
 
92
-		// Manually add the ACAO header because Yii2 is terrible at doing it
93
-		header("Access-Control-Allow-Origin: " . \implode(',', $behaviors['corsFilter']['cors']['Origin']));
92
+        // Manually add the ACAO header because Yii2 is terrible at doing it
93
+        header("Access-Control-Allow-Origin: " . \implode(',', $behaviors['corsFilter']['cors']['Origin']));
94 94
         return $behaviors;
95 95
     }
96 96
 
Please login to merge, or discard this patch.