Skip to content

Commit edea70c

Browse files
derrabusnicolas-grekas
authored andcommitted
Switched to non-null defaults in exception constructors
1 parent 87529f6 commit edea70c

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Exception/MethodNotAllowedException.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ class MethodNotAllowedException extends \RuntimeException implements ExceptionIn
2222
{
2323
protected $allowedMethods = [];
2424

25-
public function __construct(array $allowedMethods, string $message = null, int $code = 0, \Throwable $previous = null)
25+
/**
26+
* @param string[] $allowedMethods
27+
*/
28+
public function __construct(array $allowedMethods, ?string $message = '', int $code = 0, \Throwable $previous = null)
2629
{
2730
$this->allowedMethods = array_map('strtoupper', $allowedMethods);
2831

@@ -32,7 +35,7 @@ public function __construct(array $allowedMethods, string $message = null, int $
3235
/**
3336
* Gets the allowed HTTP methods.
3437
*
35-
* @return array
38+
* @return string[]
3639
*/
3740
public function getAllowedMethods()
3841
{

RouteCollectionBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,11 +362,11 @@ private function load($resource, string $type = null): array
362362
}
363363

364364
if (null === $resolver = $this->loader->getResolver()) {
365-
throw new LoaderLoadException($resource, null, null, null, $type);
365+
throw new LoaderLoadException($resource, null, 0, null, $type);
366366
}
367367

368368
if (false === $loader = $resolver->resolve($resource, $type)) {
369-
throw new LoaderLoadException($resource, null, null, null, $type);
369+
throw new LoaderLoadException($resource, null, 0, null, $type);
370370
}
371371

372372
$collections = $loader->load($resource, $type);

0 commit comments

Comments
 (0)