@@ -89,7 +89,7 @@ |
||
| 89 | 89 | { |
| 90 | 90 | $cachedPath = $this->getCachedFilePath($name); |
| 91 | 91 | |
| 92 | - if ($this->isDebug || ! is_file($cachedPath)) { |
|
| 92 | + if ($this->isDebug || !is_file($cachedPath)) { |
|
| 93 | 93 | $contents = $this->parseContent(file_get_contents($this->getFullPath($name))); |
| 94 | 94 | |
| 95 | 95 | file_put_contents($cachedPath, $contents); |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | public function required($subject): void |
| 39 | 39 | { |
| 40 | - if (! $subject) { |
|
| 40 | + if (!$subject) { |
|
| 41 | 41 | throw new ValidationException("{$subject} is required"); |
| 42 | 42 | } |
| 43 | 43 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | */ |
| 71 | 71 | public function empty(string $subject = null): void |
| 72 | 72 | { |
| 73 | - if ($subject || ! empty($subject)) { |
|
| 73 | + if ($subject || !empty($subject)) { |
|
| 74 | 74 | throw new ValidationException("{$subject} must be empty"); |
| 75 | 75 | } |
| 76 | 76 | } |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | public function notEmpty(string $subject): void |
| 88 | 88 | { |
| 89 | - if (! $subject) { |
|
| 89 | + if (!$subject) { |
|
| 90 | 90 | throw new ValidationException("{$subject} must not be empty"); |
| 91 | 91 | } |
| 92 | 92 | } |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | */ |
| 104 | 104 | public function min(string $subject, int $min = 0): void |
| 105 | 105 | { |
| 106 | - if (! Str::min($subject, $min)) { |
|
| 106 | + if (!Str::min($subject, $min)) { |
|
| 107 | 107 | throw new ValidationException("{$subject} must be longer than {$min}"); |
| 108 | 108 | } |
| 109 | 109 | } |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | */ |
| 121 | 121 | public function max(string $subject, int $max = 255): void |
| 122 | 122 | { |
| 123 | - if (! Str::max($subject, $max)) { |
|
| 123 | + if (!Str::max($subject, $max)) { |
|
| 124 | 124 | throw new ValidationException("{$subject} must not be longer than {$max}"); |
| 125 | 125 | } |
| 126 | 126 | } |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | */ |
| 138 | 138 | public function startsWith(string $subject, string $needle): void |
| 139 | 139 | { |
| 140 | - if (! Str::startsWith($subject, $needle)) { |
|
| 140 | + if (!Str::startsWith($subject, $needle)) { |
|
| 141 | 141 | throw new ValidationException("{$subject} must start with {$needle}"); |
| 142 | 142 | } |
| 143 | 143 | } |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | */ |
| 155 | 155 | public function endsWith(string $subject, string $needle): void |
| 156 | 156 | { |
| 157 | - if (! Str::endsWith($subject, $needle)) { |
|
| 157 | + if (!Str::endsWith($subject, $needle)) { |
|
| 158 | 158 | throw new ValidationException("{$subject} must end with {$needle}"); |
| 159 | 159 | } |
| 160 | 160 | } |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | public function contains(string $subject, ...$needles): void |
| 173 | 173 | { |
| 174 | 174 | foreach ($needles as $needle) { |
| 175 | - if (! Str::contains($subject, $needle)) { |
|
| 175 | + if (!Str::contains($subject, $needle)) { |
|
| 176 | 176 | throw new ValidationException("{$subject} must contain {$needle}"); |
| 177 | 177 | } |
| 178 | 178 | } |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | */ |
| 213 | 213 | public function email(string $subject): void |
| 214 | 214 | { |
| 215 | - if (! Str::isEmail($subject)) { |
|
| 215 | + if (!Str::isEmail($subject)) { |
|
| 216 | 216 | throw new ValidationException("{$subject} is not a valid email"); |
| 217 | 217 | } |
| 218 | 218 | } |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | */ |
| 229 | 229 | public function numeric($subject): void |
| 230 | 230 | { |
| 231 | - if (! is_numeric($subject)) { |
|
| 231 | + if (!is_numeric($subject)) { |
|
| 232 | 232 | throw new ValidationException("{$subject} must be numeric"); |
| 233 | 233 | } |
| 234 | 234 | } |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | */ |
| 246 | 246 | public function lessThan(int $subject, int $max = 0): void |
| 247 | 247 | { |
| 248 | - if (! Integer::lessThan($subject, $max)) { |
|
| 248 | + if (!Integer::lessThan($subject, $max)) { |
|
| 249 | 249 | throw new ValidationException("{$subject} must be less than {$max}"); |
| 250 | 250 | } |
| 251 | 251 | } |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | */ |
| 263 | 263 | public function greaterThan(int $subject, int $min = 0): void |
| 264 | 264 | { |
| 265 | - if (! Integer::greaterThan($subject, $min)) { |
|
| 265 | + if (!Integer::greaterThan($subject, $min)) { |
|
| 266 | 266 | throw new ValidationException("{$subject} must be greater than {$min}"); |
| 267 | 267 | } |
| 268 | 268 | } |
@@ -155,7 +155,7 @@ |
||
| 155 | 155 | */ |
| 156 | 156 | public function getFirstErrorMessage(): ?string |
| 157 | 157 | { |
| 158 | - if (! empty($errorMessages = $this->errorMessages)) { |
|
| 158 | + if (!empty($errorMessages = $this->errorMessages)) { |
|
| 159 | 159 | return $errorMessages[array_key_first($errorMessages)]; |
| 160 | 160 | } |
| 161 | 161 | |
@@ -236,7 +236,7 @@ |
||
| 236 | 236 | { |
| 237 | 237 | $container->setClosure( |
| 238 | 238 | Message::class, |
| 239 | - static function () { |
|
| 239 | + static function() { |
|
| 240 | 240 | return new Message(); |
| 241 | 241 | } |
| 242 | 242 | ); |
@@ -240,7 +240,7 @@ |
||
| 240 | 240 | */ |
| 241 | 241 | protected function setGuzzleFormParams(Request $request, array &$options): void |
| 242 | 242 | { |
| 243 | - if (($body = $request->getParsedBody()) && ! $request->getParsedJson()) { |
|
| 243 | + if (($body = $request->getParsedBody()) && !$request->getParsedJson()) { |
|
| 244 | 244 | $options['form_params'] = $body; |
| 245 | 245 | } |
| 246 | 246 | } |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | { |
| 106 | 106 | $container->setClosure( |
| 107 | 107 | Driver::class, |
| 108 | - static function (array $config, string $adapter) use ($container): Driver { |
|
| 108 | + static function(array $config, string $adapter) use ($container): Driver { |
|
| 109 | 109 | return new Driver( |
| 110 | 110 | $container->get( |
| 111 | 111 | $adapter, |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | $container->setClosure( |
| 134 | 134 | GuzzleAdapter::class, |
| 135 | - static function (array $config) use ($responseFactory): GuzzleAdapter { |
|
| 135 | + static function(array $config) use ($responseFactory): GuzzleAdapter { |
|
| 136 | 136 | return new GuzzleAdapter( |
| 137 | 137 | new Guzzle(), |
| 138 | 138 | $responseFactory, |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | |
| 159 | 159 | $container->setClosure( |
| 160 | 160 | LogAdapter::class, |
| 161 | - static function (array $config) use ($logger, $responseFactory): LogAdapter { |
|
| 161 | + static function(array $config) use ($logger, $responseFactory): LogAdapter { |
|
| 162 | 162 | return new LogAdapter( |
| 163 | 163 | $logger, |
| 164 | 164 | $responseFactory, |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | |
| 183 | 183 | $container->setClosure( |
| 184 | 184 | NullAdapter::class, |
| 185 | - static function (array $config) use ($responseFactory): NullAdapter { |
|
| 185 | + static function(array $config) use ($responseFactory): NullAdapter { |
|
| 186 | 186 | return new NullAdapter( |
| 187 | 187 | $responseFactory, |
| 188 | 188 | $config |
@@ -76,7 +76,7 @@ |
||
| 76 | 76 | |
| 77 | 77 | // If the service provider is deferred |
| 78 | 78 | // and its defined what services it provides |
| 79 | - if (! $force && $provider::deferred() && $provides = $provider::provides()) { |
|
| 79 | + if (!$force && $provider::deferred() && $provides = $provider::provides()) { |
|
| 80 | 80 | $this->registerDeferred($provider, ...$provides); |
| 81 | 81 | |
| 82 | 82 | return; |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | * |
| 40 | 40 | * @var array|null |
| 41 | 41 | */ |
| 42 | - protected static ?array $VALUES = null; |
|
| 42 | + protected static ? array $VALUES = null; |
|
| 43 | 43 | |
| 44 | 44 | /** |
| 45 | 45 | * The enum cache to avoid more than one reflection class per enum. |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | |
| 123 | 123 | // If the called enum isn't yet cached |
| 124 | 124 | // and the values aren't already set (to avoid a reflection class) |
| 125 | - if (! array_key_exists($className, self::$cache)) { |
|
| 125 | + if (!array_key_exists($className, self::$cache)) { |
|
| 126 | 126 | // Set the cache to avoid a reflection class creation on each new |
| 127 | 127 | // instance of the enum |
| 128 | 128 | self::$cache[$className] = static::reflectionValidValues(); |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | public function setValue($value): void |
| 154 | 154 | { |
| 155 | 155 | // If the value is not valid |
| 156 | - if (! static::isValid($value)) { |
|
| 156 | + if (!static::isValid($value)) { |
|
| 157 | 157 | // Throw an exception |
| 158 | 158 | throw new InvalidArgumentException(sprintf('Invalid enumeration %s for Enum %s', $value, get_class($this))); |
| 159 | 159 | } |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | */ |
| 72 | 72 | public static function getInstance(): object |
| 73 | 73 | { |
| 74 | - if (! isset(self::$instances[static::class])) { |
|
| 74 | + if (!isset(self::$instances[static::class])) { |
|
| 75 | 75 | static::setInstance(static::instance()); |
| 76 | 76 | } |
| 77 | 77 | |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | { |
| 113 | 113 | $instance = static::getInstance(); |
| 114 | 114 | |
| 115 | - if (! is_object($instance)) { |
|
| 115 | + if (!is_object($instance)) { |
|
| 116 | 116 | throw new RuntimeException('A facade instance has not been set.'); |
| 117 | 117 | } |
| 118 | 118 | |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | { |
| 145 | 145 | $staticMethods = static::getStaticMethods(); |
| 146 | 146 | |
| 147 | - return ! empty($staticMethods) && (isset($staticMethods[$method]) || in_array($method, $staticMethods, true)); |
|
| 147 | + return !empty($staticMethods) && (isset($staticMethods[$method]) || in_array($method, $staticMethods, true)); |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | /** |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | */ |
| 157 | 157 | protected static function verifyInstance($instance): void |
| 158 | 158 | { |
| 159 | - if (! is_string($instance) && ! is_object($instance)) { |
|
| 159 | + if (!is_string($instance) && !is_object($instance)) { |
|
| 160 | 160 | throw new InvalidArgumentException('Instance must be a string or an object.'); |
| 161 | 161 | } |
| 162 | 162 | } |