Passed
Push — master ( ef239b...4de437 )
by Arthur
03:40
created
src/Extension/BitMaskTrait.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -19,10 +19,10 @@  discard block
 block discarded – undo
19 19
     {
20 20
         $data->map(function($v) {
21 21
             $field = $this->bitMask->getField();
22
-            if(isset($v[$field])) {
22
+            if (isset($v[$field])) {
23 23
                 $flags = $this->bitMask->getFlags();
24 24
                 $mask  = $v[$field];
25
-                foreach($flags as $flag => $fVal) {
25
+                foreach ($flags as $flag => $fVal) {
26 26
                     $v[$flag] = (bool)($fVal & $mask);
27 27
                 }
28 28
             }
@@ -39,10 +39,10 @@  discard block
 block discarded – undo
39 39
     protected function setFlagsView(BaseModel $data)
40 40
     {
41 41
         $field = $this->bitMask->getField();
42
-        if(isset($data[$field])) {
42
+        if (isset($data[$field])) {
43 43
             $flags = $this->bitMask->getFlags();
44 44
             $mask  = $data[$field];
45
-            foreach($flags as $flag => $fVal) {
45
+            foreach ($flags as $flag => $fVal) {
46 46
                 $data[$flag] = ($fVal & $mask) ? true : false;
47 47
             }
48 48
         }
@@ -58,11 +58,11 @@  discard block
 block discarded – undo
58 58
     {
59 59
         $field = $this->bitMask->getField();
60 60
         $flags = $this->bitMask->getFlags();
61
-        foreach($flags as $flag => $fVal) {
61
+        foreach ($flags as $flag => $fVal) {
62 62
             if (isset($jsonProps[$flag])) {
63
-                if ((bool) $jsonProps[$flag] === true) {
63
+                if ((bool)$jsonProps[$flag] === true) {
64 64
                     $this->model->$field |= $fVal;
65
-                } else if ((bool) $jsonProps[$flag] === false) {
65
+                } else if ((bool)$jsonProps[$flag] === false) {
66 66
                     $this->model->$field &= ~$fVal;
67 67
                 }
68 68
             }
@@ -77,10 +77,10 @@  discard block
 block discarded – undo
77 77
     protected function setFlagsCreate()
78 78
     {
79 79
         $field = $this->bitMask->getField();
80
-        if(isset($this->model->$field)) {
80
+        if (isset($this->model->$field)) {
81 81
             $flags = $this->bitMask->getFlags();
82 82
             $mask  = $this->model->$field;
83
-            foreach($flags as $flag => $fVal) {
83
+            foreach ($flags as $flag => $fVal) {
84 84
                 $this->model->$flag = (bool)($fVal & $mask);
85 85
             }
86 86
         }
@@ -98,11 +98,11 @@  discard block
 block discarded – undo
98 98
     {
99 99
         $field = $this->bitMask->getField();
100 100
         $flags = $this->bitMask->getFlags();
101
-        foreach($flags as $flag => $fVal) {
101
+        foreach ($flags as $flag => $fVal) {
102 102
             if (isset($jsonProps[$flag])) {
103
-                if ((bool) $jsonProps[$flag] === true) {
103
+                if ((bool)$jsonProps[$flag] === true) {
104 104
                     $model->$field |= $fVal;
105
-                } else if ((bool) $jsonProps[$flag] === false) {
105
+                } else if ((bool)$jsonProps[$flag] === false) {
106 106
                     $model->$field &= ~$fVal;
107 107
                 }
108 108
             }
@@ -118,10 +118,10 @@  discard block
 block discarded – undo
118 118
     protected function setFlagsUpdate(&$model) : void
119 119
     {
120 120
         $field = $this->bitMask->getField();
121
-        if(isset($model[$field])) {
121
+        if (isset($model[$field])) {
122 122
             $flags = $this->bitMask->getFlags();
123 123
             $mask  = $model[$field];
124
-            foreach($flags as $flag => $fVal) {
124
+            foreach ($flags as $flag => $fVal) {
125 125
                 $model[$flag] = (bool)($fVal & $mask);
126 126
             }
127 127
         }
Please login to merge, or discard this patch.
src/Extension/OptionsTrait.php 1 patch
Spacing   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -38,17 +38,14 @@
 block discarded – undo
38 38
     private function setSqlOptions(Request $request) : SqlOptions
39 39
     {
40 40
         $sqlOptions = new SqlOptions();
41
-        $page = ($request->input(ModelsInterface::PARAM_PAGE) === null) ? $this->defaultPage :
42
-            $request->input(ModelsInterface::PARAM_PAGE);
43
-        $limit = ($request->input(ModelsInterface::PARAM_LIMIT) === null) ? $this->defaultLimit :
44
-            $request->input(ModelsInterface::PARAM_LIMIT);
41
+        $page = ($request->input(ModelsInterface::PARAM_PAGE) === null) ? $this->defaultPage : $request->input(ModelsInterface::PARAM_PAGE);
42
+        $limit = ($request->input(ModelsInterface::PARAM_LIMIT) === null) ? $this->defaultLimit : $request->input(ModelsInterface::PARAM_LIMIT);
45 43
 
46 44
         if ($limit > ModelsInterface::MAX_LIMIT) {
47 45
             throw new AttributesException(ErrorsInterface::JSON_API_ERRORS[ErrorsInterface::HTTP_PARAM_LIMIT], ErrorsInterface::HTTP_PARAM_LIMIT);
48 46
         }
49 47
 
50
-        $sort = ($request->input(ModelsInterface::PARAM_SORT) === null) ? $this->defaultSort :
51
-            $request->input(ModelsInterface::PARAM_SORT);
48
+        $sort = ($request->input(ModelsInterface::PARAM_SORT) === null) ? $this->defaultSort : $request->input(ModelsInterface::PARAM_SORT);
52 49
 
53 50
         $data = ($request->input(ModelsInterface::PARAM_DATA) === NULL) ? ModelsInterface::DEFAULT_DATA
54 51
             : Json::decode(urldecode($request->input(ModelsInterface::PARAM_DATA)));
Please login to merge, or discard this patch.
src/Helpers/SqlOptions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@
 block discarded – undo
84 84
     {
85 85
         // id must be there anyway
86 86
         $this->data = $data;
87
-        if(\in_array(ModelsInterface::ID, $this->data, true) === false)
87
+        if (\in_array(ModelsInterface::ID, $this->data, true) === false)
88 88
         {
89 89
             $this->data[] = ModelsInterface::ID;
90 90
         }
Please login to merge, or discard this patch.
src/Containers/Response.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
     {
63 63
         $resource = $this->json->setMeta($meta)->getResource($this->formRequest, $data, $this->entity);
64 64
 
65
-        return $this->getResponse(Json::prepareSerializedData($resource,  $this->sqlOptions->getData()));
65
+        return $this->getResponse(Json::prepareSerializedData($resource, $this->sqlOptions->getData()));
66 66
     }
67 67
 
68 68
     /**
Please login to merge, or discard this patch.
src/Blocks/Controllers.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
             . PhpInterface::PHP_EXT;
29 29
 
30 30
         $isCreated = FileManager::createFile($fileController, $this->sourceCode);
31
-        if($isCreated)
31
+        if ($isCreated)
32 32
         {
33 33
             Console::out($fileController . PhpInterface::SPACE . Console::CREATED, Console::COLOR_GREEN);
34 34
         }
Please login to merge, or discard this patch.
src/Blocks/FormRequest.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -168,8 +168,7 @@
 block discarded – undo
168 168
         // attrs validation
169 169
         $this->startArray();
170 170
         if (empty($relationTypes) === false) {
171
-            $rel = empty($relationTypes[ApiInterface::RAML_TYPE]) ? $relationTypes :
172
-                $relationTypes[ApiInterface::RAML_TYPE];
171
+            $rel = empty($relationTypes[ApiInterface::RAML_TYPE]) ? $relationTypes : $relationTypes[ApiInterface::RAML_TYPE];
173 172
 
174 173
             $rels = explode(PhpInterface::PIPE, str_replace('[]', '', $rel));
175 174
             foreach ($rels as $k => $rel) {
Please login to merge, or discard this patch.