Passed
Push — master ( 9b2b82...a17e37 )
by Aleksei
06:46
created
src/Config/src/Loader/PhpLoader.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,11 +36,11 @@
 block discarded – undo
36 36
      */
37 37
     public function loadFile(string $section, string $filename): array
38 38
     {
39
-        try {
39
+        try{
40 40
             return ContainerScope::runScope($this->container, function () use ($filename) {
41 41
                 return (require $filename);
42 42
             });
43
-        } catch (\Throwable $e) {
43
+        }catch (\Throwable $e){
44 44
             throw new LoaderException($e->getMessage(), $e->getCode(), $e);
45 45
         }
46 46
     }
Please login to merge, or discard this patch.
src/Encrypter/src/Encrypter.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -37,9 +37,9 @@  discard block
 block discarded – undo
37 37
      */
38 38
     public function __construct(string $key)
39 39
     {
40
-        try {
40
+        try{
41 41
             $this->key = Key::loadFromAsciiSafeString($key);
42
-        } catch (CryptoException $e) {
42
+        }catch (CryptoException $e){
43 43
             throw new EncrypterException($e->getMessage(), $e->getCode(), $e);
44 44
         }
45 45
     }
@@ -50,9 +50,9 @@  discard block
 block discarded – undo
50 50
     public function withKey(string $key): EncrypterInterface
51 51
     {
52 52
         $encrypter = clone $this;
53
-        try {
53
+        try{
54 54
             $encrypter->key = Key::loadFromAsciiSafeString($key);
55
-        } catch (CryptoException $e) {
55
+        }catch (CryptoException $e){
56 56
             throw new EncrypterException($e->getMessage(), $e->getCode(), $e);
57 57
         }
58 58
 
@@ -64,9 +64,9 @@  discard block
 block discarded – undo
64 64
      */
65 65
     public function getKey(): string
66 66
     {
67
-        try {
67
+        try{
68 68
             return $this->key->saveToAsciiSafeString();
69
-        } catch (EnvironmentIsBrokenException $e) {
69
+        }catch (EnvironmentIsBrokenException $e){
70 70
             throw new EncrypterException($e->getMessage(), $e->getCode(), $e);
71 71
         }
72 72
     }
@@ -80,9 +80,9 @@  discard block
 block discarded – undo
80 80
     {
81 81
         $packed = json_encode($data);
82 82
 
83
-        try {
83
+        try{
84 84
             return base64_encode(Crypto::Encrypt($packed, $this->key));
85
-        } catch (\Throwable $e) {
85
+        }catch (\Throwable $e){
86 86
             throw new EncryptException($e->getMessage(), $e->getCode(), $e);
87 87
         }
88 88
     }
@@ -94,14 +94,14 @@  discard block
 block discarded – undo
94 94
      */
95 95
     public function decrypt(string $payload)
96 96
     {
97
-        try {
97
+        try{
98 98
             $result = Crypto::Decrypt(
99 99
                 base64_decode($payload),
100 100
                 $this->key
101 101
             );
102 102
 
103 103
             return json_decode($result, true);
104
-        } catch (\Throwable $e) {
104
+        }catch (\Throwable $e){
105 105
             throw new DecryptException($e->getMessage(), $e->getCode(), $e);
106 106
         }
107 107
     }
Please login to merge, or discard this patch.
src/Dumper/src/Renderer/ConsoleRenderer.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
      *
24 24
      * @var string
25 25
      */
26
-    protected $element = '%s%s' . Color::RESET;
26
+    protected $element = '%s%s'.Color::RESET;
27 27
 
28 28
     /**
29 29
      * Set of styles associated with different dumping properties.
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
      */
63 63
     public function apply($element, string $type, string $context = ''): string
64 64
     {
65
-        if (!empty($style = $this->getStyle($type, $context))) {
65
+        if (!empty($style = $this->getStyle($type, $context))){
66 66
             return sprintf($this->element, $style, $element);
67 67
         }
68 68
 
@@ -87,15 +87,15 @@  discard block
 block discarded – undo
87 87
      */
88 88
     private function getStyle(string $type, string $context): string
89 89
     {
90
-        if (isset($this->styles[$type][$context])) {
90
+        if (isset($this->styles[$type][$context])){
91 91
             return $this->styles[$type][$context];
92 92
         }
93 93
 
94
-        if (isset($this->styles[$type]['common'])) {
94
+        if (isset($this->styles[$type]['common'])){
95 95
             return $this->styles[$type]['common'];
96 96
         }
97 97
 
98
-        if (isset($this->styles[$type]) && is_string($this->styles[$type])) {
98
+        if (isset($this->styles[$type]) && is_string($this->styles[$type])){
99 99
             return $this->styles[$type];
100 100
         }
101 101
 
Please login to merge, or discard this patch.
src/Exceptions/src/ValueWrapper.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -56,33 +56,33 @@
 block discarded – undo
56 56
     public function wrap(array $args): array
57 57
     {
58 58
         $result = [];
59
-        foreach ($args as $arg) {
59
+        foreach ($args as $arg){
60 60
             $display = $type = strtolower(gettype($arg));
61 61
 
62
-            if (is_numeric($arg)) {
62
+            if (is_numeric($arg)){
63 63
                 $result[] = $this->r->apply($arg, 'value', $type);
64 64
                 continue;
65
-            } elseif (is_bool($arg)) {
65
+            } elseif (is_bool($arg)){
66 66
                 $result[] = $this->r->apply($arg ? 'true' : 'false', 'value', $type);
67 67
                 continue;
68
-            } elseif (is_null($arg)) {
68
+            } elseif (is_null($arg)){
69 69
                 $result[] = $this->r->apply('null', 'value', $type);
70 70
                 continue;
71 71
             }
72 72
 
73
-            if (is_object($arg)) {
73
+            if (is_object($arg)){
74 74
                 $reflection = new \ReflectionClass($arg);
75 75
                 $display = sprintf('<span title="%s">%s</span>', $reflection->getName(), $reflection->getShortName());
76 76
             }
77 77
 
78 78
             $type = $this->r->apply($display, 'value', $type);
79 79
 
80
-            if ($this->verbosity < HandlerInterface::VERBOSITY_DEBUG) {
80
+            if ($this->verbosity < HandlerInterface::VERBOSITY_DEBUG){
81 81
                 $result[] = sprintf('<span>%s</span>', $type);
82
-            } else {
82
+            }else{
83 83
                 $hash = is_object($arg) ? spl_object_hash($arg) : md5(json_encode($arg));
84 84
 
85
-                if (!isset($this->values[$hash])) {
85
+                if (!isset($this->values[$hash])){
86 86
                     $this->values[$hash] = $this->dumper->dump($arg, Dumper::RETURN);
87 87
                 }
88 88
 
Please login to merge, or discard this patch.
src/AuthHttp/src/TransportRegistry.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
     {
50 50
         $name = $name ?? $this->default;
51 51
 
52
-        if (!isset($this->transports[$name])) {
52
+        if (!isset($this->transports[$name])){
53 53
             throw new TransportException("Undefined auth transport {$name}");
54 54
         }
55 55
 
Please login to merge, or discard this patch.
src/Tokenizer/src/Reflection/ReflectionArgument.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -21,10 +21,10 @@  discard block
 block discarded – undo
21 21
     /**
22 22
      * Argument types.
23 23
      */
24
-    public const CONSTANT   = 'constant';   //Scalar constant and not variable.
25
-    public const VARIABLE   = 'variable';   //PHP variable
24
+    public const CONSTANT   = 'constant'; //Scalar constant and not variable.
25
+    public const VARIABLE   = 'variable'; //PHP variable
26 26
     public const EXPRESSION = 'expression'; //PHP code (expression).
27
-    public const STRING     = 'string';     //Simple scalar string, can be fetched using stringValue().
27
+    public const STRING     = 'string'; //Simple scalar string, can be fetched using stringValue().
28 28
 
29 29
     /** @var string */
30 30
     private $type;
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
      */
70 70
     public function stringValue(): string
71 71
     {
72
-        if ($this->type != self::STRING) {
72
+        if ($this->type != self::STRING){
73 73
             throw new ReflectionException(
74 74
                 "Unable to represent value as string, value type is '{$this->type}'"
75 75
             );
@@ -91,19 +91,19 @@  discard block
 block discarded – undo
91 91
         $level = 0;
92 92
 
93 93
         $result = [];
94
-        foreach ($tokens as $token) {
95
-            if ($token[ReflectionFile::TOKEN_TYPE] == T_WHITESPACE) {
94
+        foreach ($tokens as $token){
95
+            if ($token[ReflectionFile::TOKEN_TYPE] == T_WHITESPACE){
96 96
                 continue;
97 97
             }
98 98
 
99
-            if (empty($definition)) {
99
+            if (empty($definition)){
100 100
                 $definition = ['type' => self::EXPRESSION, 'value' => '', 'tokens' => []];
101 101
             }
102 102
 
103 103
             if (
104 104
                 $token[ReflectionFile::TOKEN_TYPE] == '('
105 105
                 || $token[ReflectionFile::TOKEN_TYPE] == '['
106
-            ) {
106
+            ){
107 107
                 ++$level;
108 108
                 $definition['value'] .= $token[ReflectionFile::TOKEN_CODE];
109 109
                 continue;
@@ -112,18 +112,18 @@  discard block
 block discarded – undo
112 112
             if (
113 113
                 $token[ReflectionFile::TOKEN_TYPE] == ')'
114 114
                 || $token[ReflectionFile::TOKEN_TYPE] == ']'
115
-            ) {
115
+            ){
116 116
                 --$level;
117 117
                 $definition['value'] .= $token[ReflectionFile::TOKEN_CODE];
118 118
                 continue;
119 119
             }
120 120
 
121
-            if ($level) {
121
+            if ($level){
122 122
                 $definition['value'] .= $token[ReflectionFile::TOKEN_CODE];
123 123
                 continue;
124 124
             }
125 125
 
126
-            if ($token[ReflectionFile::TOKEN_TYPE] == ',') {
126
+            if ($token[ReflectionFile::TOKEN_TYPE] == ','){
127 127
                 $result[] = self::createArgument($definition);
128 128
                 $definition = null;
129 129
                 continue;
@@ -134,9 +134,9 @@  discard block
 block discarded – undo
134 134
         }
135 135
 
136 136
         //Last argument
137
-        if (is_array($definition)) {
137
+        if (is_array($definition)){
138 138
             $definition = self::createArgument($definition);
139
-            if (!empty($definition->getType())) {
139
+            if (!empty($definition->getType())){
140 140
                 $result[] = $definition;
141 141
             }
142 142
         }
@@ -155,9 +155,9 @@  discard block
 block discarded – undo
155 155
     {
156 156
         $result = new static(self::EXPRESSION, $definition['value']);
157 157
 
158
-        if (count($definition['tokens']) == 1) {
158
+        if (count($definition['tokens']) == 1){
159 159
             //If argument represent by one token we can try to resolve it's type more precisely
160
-            switch ($definition['tokens'][0][0]) {
160
+            switch ($definition['tokens'][0][0]){
161 161
                 case T_VARIABLE:
162 162
                     $result->type = self::VARIABLE;
163 163
                     break;
Please login to merge, or discard this patch.
src/Translator/src/Translator.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
         TranslatorConfig $config,
45 45
         CatalogueManagerInterface $catalogueManager,
46 46
         IdentityTranslator $identityTranslator = null
47
-    ) {
47
+    ){
48 48
         $this->config = $config;
49 49
         $this->identityTranslator = $identityTranslator ?? new IdentityTranslator();
50 50
         $this->catalogueManager = $catalogueManager;
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
      */
69 69
     public function setLocale(string $locale): void
70 70
     {
71
-        if (!$this->catalogueManager->has($locale)) {
71
+        if (!$this->catalogueManager->has($locale)){
72 72
             throw new LocaleException($locale);
73 73
         }
74 74
 
@@ -124,11 +124,11 @@  discard block
 block discarded – undo
124 124
         array $parameters = [],
125 125
         $domain = null,
126 126
         $locale = null
127
-    ) {
127
+    ){
128 128
         $domain = $domain ?? $this->config->getDefaultDomain();
129 129
         $locale = $locale ?? $this->locale;
130 130
 
131
-        try {
131
+        try{
132 132
             $message = $this->get($locale, $domain, $id);
133 133
 
134 134
             $pluralized = $this->identityTranslator->trans(
@@ -137,12 +137,12 @@  discard block
 block discarded – undo
137 137
                 null,
138 138
                 $locale
139 139
             );
140
-        } catch (\InvalidArgumentException $e) {
140
+        }catch (\InvalidArgumentException $e){
141 141
             //Wrapping into more explanatory exception
142 142
             throw new PluralizationException($e->getMessage(), $e->getCode(), $e);
143 143
         }
144 144
 
145
-        if (empty($parameters['n']) && is_numeric($number)) {
145
+        if (empty($parameters['n']) && is_numeric($number)){
146 146
             $parameters['n'] = $number;
147 147
         }
148 148
 
@@ -168,18 +168,18 @@  discard block
 block discarded – undo
168 168
         string $postfix = '}'
169 169
     ): string {
170 170
         $replaces = [];
171
-        foreach ($values as $key => $value) {
171
+        foreach ($values as $key => $value){
172 172
             $value = (is_array($value) || $value instanceof \Closure) ? '' : $value;
173 173
 
174
-            if (is_object($value)) {
175
-                if (method_exists($value, '__toString')) {
174
+            if (is_object($value)){
175
+                if (method_exists($value, '__toString')){
176 176
                     $value = $value->__toString();
177
-                } else {
177
+                }else{
178 178
                     $value = '';
179 179
                 }
180 180
             }
181 181
 
182
-            $replaces[$prefix . $key . $postfix] = $value;
182
+            $replaces[$prefix.$key.$postfix] = $value;
183 183
         }
184 184
 
185 185
         return strtr($string, $replaces);
@@ -207,18 +207,18 @@  discard block
 block discarded – undo
207 207
      */
208 208
     protected function get(string &$locale, string $domain, string $string): string
209 209
     {
210
-        if ($this->catalogueManager->get($locale)->has($domain, $string)) {
210
+        if ($this->catalogueManager->get($locale)->has($domain, $string)){
211 211
             return $this->catalogueManager->get($locale)->get($domain, $string);
212 212
         }
213 213
 
214 214
         $locale = $this->config->getFallbackLocale();
215 215
 
216
-        if ($this->catalogueManager->get($locale)->has($domain, $string)) {
216
+        if ($this->catalogueManager->get($locale)->has($domain, $string)){
217 217
             return $this->catalogueManager->get($locale)->get($domain, $string);
218 218
         }
219 219
 
220 220
         // we can automatically register message
221
-        if ($this->config->isAutoRegisterMessages()) {
221
+        if ($this->config->isAutoRegisterMessages()){
222 222
             $this->catalogueManager->get($locale)->set($domain, $string, $string);
223 223
             $this->catalogueManager->save($locale);
224 224
         }
Please login to merge, or discard this patch.
src/Security/src/Traits/GuardedTrait.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
     public function getGuard(): GuardInterface
29 29
     {
30 30
         $container = ContainerScope::getContainer();
31
-        if (empty($container) || !$container->has(GuardInterface::class)) {
31
+        if (empty($container) || !$container->has(GuardInterface::class)){
32 32
             throw new ScopeException(
33 33
                 'Unable to get `GuardInterface`, binding is missing or container scope is not set'
34 34
             );
@@ -65,9 +65,9 @@  discard block
 block discarded – undo
65 65
      */
66 66
     protected function resolvePermission(string $permission): string
67 67
     {
68
-        if (defined('static::GUARD_NAMESPACE')) {
68
+        if (defined('static::GUARD_NAMESPACE')){
69 69
             // Yay! Isolation
70
-            $permission = constant(get_called_class() . '::' . 'GUARD_NAMESPACE') . '.' . $permission;
70
+            $permission = constant(get_called_class().'::'.'GUARD_NAMESPACE').'.'.$permission;
71 71
         }
72 72
 
73 73
         return $permission;
Please login to merge, or discard this patch.
src/Reactor/src/FileDeclaration.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
     public function addElement(DeclarationInterface $element): FileDeclaration
107 107
     {
108 108
         $this->elements->add($element);
109
-        if ($element instanceof DependedInterface) {
109
+        if ($element instanceof DependedInterface){
110 110
             $this->addUses($element->getDependencies());
111 111
         }
112 112
 
@@ -132,23 +132,23 @@  discard block
 block discarded – undo
132 132
     {
133 133
         $result = "<?php\n";
134 134
 
135
-        if (!$this->docComment->isEmpty()) {
136
-            $result .= $this->docComment->render($indentLevel) . "\n";
135
+        if (!$this->docComment->isEmpty()){
136
+            $result .= $this->docComment->render($indentLevel)."\n";
137 137
         }
138 138
 
139
-        if ($this->directives !== null && !empty($this->directives->render())) {
140
-            $result .= $this->directives->render() . "\n\n";
139
+        if ($this->directives !== null && !empty($this->directives->render())){
140
+            $result .= $this->directives->render()."\n\n";
141 141
         }
142 142
 
143
-        if (!empty($this->namespace)) {
144
-            if ($this->docComment->isEmpty()) {
143
+        if (!empty($this->namespace)){
144
+            if ($this->docComment->isEmpty()){
145 145
                 $result .= "\n";
146 146
             }
147 147
             $result .= "namespace {$this->namespace};\n\n";
148 148
         }
149 149
 
150
-        if (!empty($this->uses)) {
151
-            $result .= $this->renderUses($indentLevel) . "\n\n";
150
+        if (!empty($this->uses)){
151
+            $result .= $this->renderUses($indentLevel)."\n\n";
152 152
         }
153 153
 
154 154
         $result .= $this->elements->render($indentLevel);
Please login to merge, or discard this patch.