1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 05:50:42 +02:00

[ticket/17176] Update implementations to be compatible with Symfony 6.3

PHPBB3-17176
This commit is contained in:
Marc Alexander
2023-08-19 13:04:25 +02:00
parent 08160b3bc3
commit cef8aaf1a4
16 changed files with 40 additions and 34 deletions

View File

@@ -65,10 +65,10 @@ class resolver implements ControllerResolverInterface
* Load a controller callable
*
* @param Request $request Symfony Request object
* @return false|Callable Callable or false (fixme: method is returning an array)
* @return callable|false Callable or false
* @throws \phpbb\controller\exception
*/
public function getController(Request $request)
public function getController(Request $request): callable|false
{
$controller = $request->attributes->get('_controller');

View File

@@ -60,7 +60,7 @@ class config extends Extension
*
* @return string The alias
*/
public function getAlias()
public function getAlias(): string
{
return 'config';
}

View File

@@ -144,7 +144,7 @@ class core extends Extension
*
* @return string The alias
*/
public function getAlias()
public function getAlias(): string
{
return 'core';
}

View File

@@ -52,7 +52,7 @@ class tables extends Extension
*
* @return string The alias
*/
public function getAlias()
public function getAlias(): string
{
return 'tables';
}

View File

@@ -25,14 +25,14 @@ class http_exception extends runtime_exception implements HttpExceptionInterface
*
* @var integer
*/
private $status_code;
private int $status_code;
/**
* Additional headers to set in the response.
*
* @var array
*/
private $headers;
private array $headers;
/**
* Constructor
@@ -55,7 +55,7 @@ class http_exception extends runtime_exception implements HttpExceptionInterface
/**
* {@inheritdoc}
*/
public function getStatusCode()
public function getStatusCode(): int
{
return $this->status_code;
}
@@ -63,7 +63,7 @@ class http_exception extends runtime_exception implements HttpExceptionInterface
/**
* {@inheritdoc}
*/
public function getHeaders()
public function getHeaders(): array
{
return $this->headers;
}

View File

@@ -132,7 +132,7 @@ class extension_base extends Extension
*
* @return string The alias
*/
public function getAlias()
public function getAlias(): string
{
return str_replace('/', '_', $this->extension_name);
}

View File

@@ -33,7 +33,7 @@ class loader_resolver implements LoaderResolverInterface
/**
* {@inheritdoc}
*/
public function resolve($resource, $type = null)
public function resolve($resource, $type = null): false|\Symfony\Component\Config\Loader\LoaderInterface
{
/** @var \Symfony\Component\Config\Loader\LoaderInterface $loader */
foreach ($this->loaders as $loader)

View File

@@ -171,7 +171,7 @@ class router implements RouterInterface
/**
* {@inheritdoc}
*/
public function getContext()
public function getContext(): RequestContext
{
return $this->context;
}
@@ -179,7 +179,7 @@ class router implements RouterInterface
/**
* {@inheritdoc}
*/
public function generate($name, $parameters = array(), $referenceType = self::ABSOLUTE_PATH)
public function generate(string $name, array $parameters = [], int $referenceType = self::ABSOLUTE_PATH): string
{
return $this->get_generator()->generate($name, $parameters, $referenceType);
}
@@ -187,7 +187,7 @@ class router implements RouterInterface
/**
* {@inheritdoc}
*/
public function match($pathinfo)
public function match(string $pathinfo): array
{
return $this->get_matcher()->match($pathinfo);
}