Passed
Push — latest ( 03f783...d7ba96 )
by Mark
02:37
created
src/Configuration.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
              *
76 76
              * @return string[]
77 77
              */
78
-                static function (Options $options, $value): array {
79
-                    if (! $value) {
78
+                static function(Options $options, $value): array {
79
+                    if (!$value) {
80 80
                         return $value;
81 81
                     }
82 82
 
@@ -89,11 +89,11 @@  discard block
 block discarded – undo
89 89
     {
90 90
         $resolver->define('locale')
91 91
             ->allowedTypes('string')
92
-            ->allowedValues(static function (string $value): bool {
93
-                return ! ! Normalize::locale($value);
92
+            ->allowedValues(static function(string $value): bool {
93
+                return !!Normalize::locale($value);
94 94
             })
95 95
             ->default('en')
96
-            ->normalize(static function (Options $options, string $value): string {
96
+            ->normalize(static function(Options $options, string $value): string {
97 97
                 return Normalize::locale($value);
98 98
             });
99 99
     }
@@ -102,10 +102,10 @@  discard block
 block discarded – undo
102 102
     {
103 103
         $resolver->define('native')
104 104
             ->allowedTypes('bool')
105
-            ->default(static function (Options $options): bool {
105
+            ->default(static function(Options $options): bool {
106 106
                 return \in_array($options['locale'], DatasetInterface::NON_LATIN_LOCALES, true);
107 107
             })
108
-            ->normalize(static function (Options $options, bool $value) {
108
+            ->normalize(static function(Options $options, bool $value) {
109 109
                 return $value && \in_array($options['locale'], DatasetInterface::NON_LATIN_LOCALES, true);
110 110
             });
111 111
     }
@@ -126,13 +126,13 @@  discard block
 block discarded – undo
126 126
                 /**
127 127
                  * @param mixed $value
128 128
                  */
129
-                static function ($value): bool {
129
+                static function($value): bool {
130 130
                     foreach ((array) $value as $v) {
131
-                        if (! \in_array($v, ShortcodeInterface::SUPPORTED_PRESETS, true)) {
131
+                        if (!\in_array($v, ShortcodeInterface::SUPPORTED_PRESETS, true)) {
132 132
                             throw new InvalidOptionsException(\sprintf(
133 133
                                 'The option "preset" with value "%s" is invalid. Accepted values are: %s.',
134 134
                                 $v,
135
-                                \implode(', ', \array_map(static function ($s) {
135
+                                \implode(', ', \array_map(static function($s) {
136 136
                                     return \sprintf('"%s"', $s);
137 137
                                 }, ShortcodeInterface::SUPPORTED_PRESETS))
138 138
                             ));
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
                  *
150 150
                  * @return string[]
151 151
                  */
152
-                static function (Options $options, $value): array {
152
+                static function(Options $options, $value): array {
153 153
                     // Presets.
154 154
                     $presets = [];
155 155
                     foreach ((array) $value as $preset) {
Please login to merge, or discard this patch.
src/Dataset.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -27,13 +27,13 @@  discard block
 block discarded – undo
27 27
 
28 28
     public static function unarchive(string $filename): self
29 29
     {
30
-        if (! \file_exists($filename)) {
30
+        if (!\file_exists($filename)) {
31 31
             throw new FileNotFoundException($filename);
32 32
         }
33 33
 
34 34
         if (
35
-            ! ($contents = \file_get_contents($filename)) ||
36
-            ! ($decoded = \gzdecode($contents))
35
+            !($contents = \file_get_contents($filename)) ||
36
+            !($decoded = \gzdecode($contents))
37 37
         ) {
38 38
             throw new UnarchiveException($filename);
39 39
         }
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
             throw new MalformedArchiveException($filename, $throwable);
45 45
         }
46 46
 
47
-        if (! $dataset instanceof Dataset) {
47
+        if (!$dataset instanceof Dataset) {
48 48
             throw new MalformedArchiveException($filename);
49 49
         }
50 50
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 
75 75
     public function indexBy(string $index = 'hexcode'): Dataset
76 76
     {
77
-        if (! isset($this->indices[$index])) {
77
+        if (!isset($this->indices[$index])) {
78 78
             $this->indices[$index] = new self($this, $index);
79 79
         }
80 80
 
Please login to merge, or discard this patch.
src/Util/Normalize.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
                 $emoji = new Emoji($emoji);
59 59
             }
60 60
 
61
-            if (! $emoji instanceof Emoji) {
61
+            if (!$emoji instanceof Emoji) {
62 62
                 throw new \RuntimeException(\sprintf('Passed array item must be an instance of %s.', Emoji::class));
63 63
             }
64 64
         }
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
         ];
131 131
 
132 132
         // Immediately return if not a valid type.
133
-        if (! isset($methods[$type])) {
133
+        if (!isset($methods[$type])) {
134 134
             $value = null;
135 135
 
136 136
             return false;
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
             $normalized = \array_values(\array_unique(\array_merge(
155 155
                 $normalized,
156 156
                 \array_map(
157
-                    static function ($shortcode) {
157
+                    static function($shortcode) {
158 158
                         return \preg_replace('/[^a-z0-9-]/', '-', \strtolower(\trim($shortcode, ':(){}[]')));
159 159
                     },
160 160
                     (array) $shortcodes
Please login to merge, or discard this patch.
src/Util/Property.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
         \preg_match(self::REGEX, $type, $matches, PREG_UNMATCHED_AS_NULL);
37 37
         $this->callback      = $matches['callback'] ?? null;
38 38
         $this->customType    = $matches['customType'] ?? null;
39
-        $this->emptyNullable = ! ! ($matches['emptyNullable'] ?? false);
40
-        $this->iterable      = ! ! ($matches['iterable'] ?? false);
41
-        $this->nullable      = ! ! ($this->emptyNullable || ($matches['nullable'] ?? false));
39
+        $this->emptyNullable = !!($matches['emptyNullable'] ?? false);
40
+        $this->iterable      = !!($matches['iterable'] ?? false);
41
+        $this->nullable      = !!($this->emptyNullable || ($matches['nullable'] ?? false));
42 42
         $this->type          = $matches['type'] ?? 'mixed';
43 43
         $this->isPhpType     = \in_array($this->type, self::TYPES, true);
44 44
     }
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
     public function castValue($value)
78 78
     {
79 79
         // Immediately return if nullable or empty.
80
-        if (($this->nullable && $value === null) || ($this->emptyNullable && ! $value)) {
80
+        if (($this->nullable && $value === null) || ($this->emptyNullable && !$value)) {
81 81
             return null;
82 82
         }
83 83
 
@@ -117,6 +117,6 @@  discard block
 block discarded – undo
117 117
             Normalize::setType($value, $this->type);
118 118
         }
119 119
 
120
-        return $this->emptyNullable && ! $value ? null : $value;
120
+        return $this->emptyNullable && !$value ? null : $value;
121 121
     }
122 122
 }
Please login to merge, or discard this patch.