Passed
Pull Request — master (#407)
by Kirill
06:33
created
src/storage/tests/Traits/LocalFsBuilderTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
         return [
62 62
             LocalInfo::ADAPTER_KEY => LocalFilesystemAdapter::class,
63 63
             LocalInfo::OPTIONS_KEY => [
64
-                LocalInfo::ROOT_DIR_KEY => $prefix . self::ROOT_DIR,
64
+                LocalInfo::ROOT_DIR_KEY => $prefix.self::ROOT_DIR,
65 65
                 LocalInfo::HOST_KEY => self::CONFIG_HOST,
66 66
             ],
67 67
         ];
Please login to merge, or discard this patch.
src/storage/tests/Traits/StorageConfigTrait.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
      */
25 25
     protected function buildStorageConfig(?array $servers = null, ?array $buckets = null): StorageConfig
26 26
     {
27
-        if (empty($servers)) {
27
+        if (empty($servers)){
28 28
             $servers[self::SERVER_NAME] = [
29 29
                 LocalInfo::ADAPTER_KEY => LocalFilesystemAdapter::class,
30 30
                 LocalInfo::OPTIONS_KEY => [
@@ -34,9 +34,9 @@  discard block
 block discarded – undo
34 34
             ];
35 35
         }
36 36
 
37
-        if (!empty($servers) && empty($buckets)) {
37
+        if (!empty($servers) && empty($buckets)){
38 38
             $buckets = [];
39
-            foreach ($servers as $server => $serverInfo) {
39
+            foreach ($servers as $server => $serverInfo){
40 40
                 $buckets[$this->buildBucketNameByServer($server)] = $this->buildServerBucketInfoDesc($server);
41 41
             }
42 42
         }
@@ -57,6 +57,6 @@  discard block
 block discarded – undo
57 57
 
58 58
     protected function buildBucketNameByServer(string $server): string
59 59
     {
60
-        return $server . 'Bucket';
60
+        return $server.'Bucket';
61 61
     }
62 62
 }
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,7 +24,8 @@  discard block
 block discarded – undo
24 24
      */
25 25
     protected function buildStorageConfig(?array $servers = null, ?array $buckets = null): StorageConfig
26 26
     {
27
-        if (empty($servers)) {
27
+        if (empty($servers))
28
+        {
28 29
             $servers[self::SERVER_NAME] = [
29 30
                 LocalInfo::ADAPTER_KEY => LocalFilesystemAdapter::class,
30 31
                 LocalInfo::OPTIONS_KEY => [
@@ -34,9 +35,11 @@  discard block
 block discarded – undo
34 35
             ];
35 36
         }
36 37
 
37
-        if (!empty($servers) && empty($buckets)) {
38
+        if (!empty($servers) && empty($buckets))
39
+        {
38 40
             $buckets = [];
39
-            foreach ($servers as $server => $serverInfo) {
41
+            foreach ($servers as $server => $serverInfo)
42
+            {
40 43
                 $buckets[$this->buildBucketNameByServer($server)] = $this->buildServerBucketInfoDesc($server);
41 44
             }
42 45
         }
Please login to merge, or discard this patch.
src/storage/tests/Traits/AwsS3FsBuilderTrait.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
         return [
52 52
             AwsS3Info::CLASS_KEY => PortableVisibilityConverter::class,
53 53
             AwsS3Info::OPTIONS_KEY => [
54
-                AwsS3Info::VISIBILITY_KEY => Visibility::PUBLIC,
54
+                AwsS3Info::VISIBILITY_KEY => Visibility::public,
55 55
             ]
56 56
         ];
57 57
     }
Please login to merge, or discard this patch.
src/storage/tests/TestCase.php 2 patches
Spacing   +3 added lines, -3 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 const ROOT_DIR = __DIR__ . '/storage/testRoot';
26
+    protected const ROOT_DIR = __DIR__.'/storage/testRoot';
27 27
 
28 28
     /**
29 29
      * @var string
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
      */
41 41
     protected function getUriParser(): UriParserInterface
42 42
     {
43
-        if (!$this->uriParser instanceof UriParserInterface) {
43
+        if (!$this->uriParser instanceof UriParserInterface){
44 44
             $this->uriParser = new UriParser();
45 45
         }
46 46
 
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
      */
53 53
     protected function notice(string $message): void
54 54
     {
55
-        if (\method_exists($this, 'addWarning')) {
55
+        if (\method_exists($this, 'addWarning')){
56 56
             /** @psalm-suppress InternalMethod */
57 57
             $this->addWarning($message);
58 58
         }
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,7 +40,8 @@  discard block
 block discarded – undo
40 40
      */
41 41
     protected function getUriParser(): UriParserInterface
42 42
     {
43
-        if (!$this->uriParser instanceof UriParserInterface) {
43
+        if (!$this->uriParser instanceof UriParserInterface)
44
+        {
44 45
             $this->uriParser = new UriParser();
45 46
         }
46 47
 
@@ -52,7 +53,8 @@  discard block
 block discarded – undo
52 53
      */
53 54
     protected function notice(string $message): void
54 55
     {
55
-        if (\method_exists($this, 'addWarning')) {
56
+        if (\method_exists($this, 'addWarning'))
57
+        {
56 58
             /** @psalm-suppress InternalMethod */
57 59
             $this->addWarning($message);
58 60
         }
Please login to merge, or discard this patch.
src/storage/src/Config/DTO/BucketInfo.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
         $this->name = $name;
44 44
         $this->server = $server;
45 45
 
46
-        if (array_key_exists(static::OPTIONS_KEY, $info)) {
46
+        if (array_key_exists(static::OPTIONS_KEY, $info)){
47 47
             $this->options = $info[static::OPTIONS_KEY];
48 48
         }
49 49
     }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,8 @@
 block discarded – undo
43 43
         $this->name = $name;
44 44
         $this->server = $server;
45 45
 
46
-        if (array_key_exists(static::OPTIONS_KEY, $info)) {
46
+        if (array_key_exists(static::OPTIONS_KEY, $info))
47
+        {
47 48
             $this->options = $info[static::OPTIONS_KEY];
48 49
         }
49 50
     }
Please login to merge, or discard this patch.
src/storage/src/Config/DTO/Traits/ClassBasedTrait.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
      */
58 58
     protected function checkClass(string $class, string $errorPostfix): void
59 59
     {
60
-        if (!class_exists($class)) {
60
+        if (!class_exists($class)){
61 61
             throw new StorageException(
62 62
                 \sprintf('Class `%s` not exists. %s', $class, $errorPostfix)
63 63
             );
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,8 @@
 block discarded – undo
57 57
      */
58 58
     protected function checkClass(string $class, string $errorPostfix): void
59 59
     {
60
-        if (!class_exists($class)) {
60
+        if (!class_exists($class))
61
+        {
61 62
             throw new StorageException(
62 63
                 \sprintf('Class `%s` not exists. %s', $class, $errorPostfix)
63 64
             );
Please login to merge, or discard this patch.
src/storage/src/Config/DTO/Traits/OptionsTrait.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
      */
62 62
     protected function isOptionHasRequiredType(string $optionLabel, $optionVal, string $type): bool
63 63
     {
64
-        switch ($type) {
64
+        switch ($type){
65 65
             case OptionsBasedInterface::INT_TYPE:
66 66
             case OptionsBasedInterface::FLOAT_TYPE:
67 67
                 return is_numeric($optionVal);
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
      */
95 95
     protected function processOptionByType($optionVal, string $type)
96 96
     {
97
-        switch ($type) {
97
+        switch ($type){
98 98
             case OptionsBasedInterface::INT_TYPE:
99 99
                 return (int)$optionVal;
100 100
             case OptionsBasedInterface::FLOAT_TYPE:
@@ -119,8 +119,8 @@  discard block
 block discarded – undo
119 119
      */
120 120
     protected function validateRequiredOptions(array $requiredOptions, array $options, string $msgPostfix = ''): void
121 121
     {
122
-        foreach ($requiredOptions as $requiredOption) {
123
-            if (!array_key_exists($requiredOption, $options)) {
122
+        foreach ($requiredOptions as $requiredOption){
123
+            if (!array_key_exists($requiredOption, $options)){
124 124
                 throw new ConfigException(
125 125
                     \sprintf('Option `%s` not detected%s', $requiredOption, $msgPostfix)
126 126
                 );
Please login to merge, or discard this patch.
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -61,7 +61,8 @@  discard block
 block discarded – undo
61 61
      */
62 62
     protected function isOptionHasRequiredType(string $optionLabel, $optionVal, string $type): bool
63 63
     {
64
-        switch ($type) {
64
+        switch ($type)
65
+        {
65 66
             case OptionsBasedInterface::INT_TYPE:
66 67
             case OptionsBasedInterface::FLOAT_TYPE:
67 68
                 return is_numeric($optionVal);
@@ -94,7 +95,8 @@  discard block
 block discarded – undo
94 95
      */
95 96
     protected function processOptionByType($optionVal, string $type)
96 97
     {
97
-        switch ($type) {
98
+        switch ($type)
99
+        {
98 100
             case OptionsBasedInterface::INT_TYPE:
99 101
                 return (int)$optionVal;
100 102
             case OptionsBasedInterface::FLOAT_TYPE:
@@ -119,8 +121,10 @@  discard block
 block discarded – undo
119 121
      */
120 122
     protected function validateRequiredOptions(array $requiredOptions, array $options, string $msgPostfix = ''): void
121 123
     {
122
-        foreach ($requiredOptions as $requiredOption) {
123
-            if (!array_key_exists($requiredOption, $options)) {
124
+        foreach ($requiredOptions as $requiredOption)
125
+        {
126
+            if (!array_key_exists($requiredOption, $options))
127
+            {
124 128
                 throw new ConfigException(
125 129
                     \sprintf('Option `%s` not detected%s', $requiredOption, $msgPostfix)
126 130
                 );
Please login to merge, or discard this patch.
src/storage/src/Config/DTO/FileSystemInfo/LocalInfo.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,12 +43,12 @@
 block discarded – undo
43 43
      */
44 44
     public function isAdvancedUsage(): bool
45 45
     {
46
-        foreach (static::ADDITIONAL_OPTIONS as $optionalOption => $type) {
47
-            if ($optionalOption === static::HOST_KEY) {
46
+        foreach (static::ADDITIONAL_OPTIONS as $optionalOption => $type){
47
+            if ($optionalOption === static::HOST_KEY){
48 48
                 continue;
49 49
             }
50 50
 
51
-            if ($this->hasOption($optionalOption)) {
51
+            if ($this->hasOption($optionalOption)){
52 52
                 return true;
53 53
             }
54 54
         }
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,12 +43,15 @@
 block discarded – undo
43 43
      */
44 44
     public function isAdvancedUsage(): bool
45 45
     {
46
-        foreach (static::ADDITIONAL_OPTIONS as $optionalOption => $type) {
47
-            if ($optionalOption === static::HOST_KEY) {
46
+        foreach (static::ADDITIONAL_OPTIONS as $optionalOption => $type)
47
+        {
48
+            if ($optionalOption === static::HOST_KEY)
49
+            {
48 50
                 continue;
49 51
             }
50 52
 
51
-            if ($this->hasOption($optionalOption)) {
53
+            if ($this->hasOption($optionalOption))
54
+            {
52 55
                 return true;
53 56
             }
54 57
         }
Please login to merge, or discard this patch.
src/storage/src/Config/DTO/FileSystemInfo/Aws/AwsS3Info.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
      */
49 49
     public function constructSpecific(array $info): void
50 50
     {
51
-        if ($this->hasOption(static::VISIBILITY_KEY)) {
51
+        if ($this->hasOption(static::VISIBILITY_KEY)){
52 52
             $this->visibilityConverter = new AwsVisibilityConverter($this->getOption(static::VISIBILITY_KEY));
53 53
         }
54 54
     }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,8 @@
 block discarded – undo
48 48
      */
49 49
     public function constructSpecific(array $info): void
50 50
     {
51
-        if ($this->hasOption(static::VISIBILITY_KEY)) {
51
+        if ($this->hasOption(static::VISIBILITY_KEY))
52
+        {
52 53
             $this->visibilityConverter = new AwsVisibilityConverter($this->getOption(static::VISIBILITY_KEY));
53 54
         }
54 55
     }
Please login to merge, or discard this patch.