Skip to content

Commit 24800d2

Browse files
committed
[ticket/17176] Update implementations to be compatible with Symfony 6.3
PHPBB3-17176
1 parent 02737f3 commit 24800d2

File tree

8 files changed

+14
-14
lines changed

8 files changed

+14
-14
lines changed

controller/resolver.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ public function __construct(ContainerInterface $container, $phpbb_root_path, \ph
6565
* Load a controller callable
6666
*
6767
* @param Request $request Symfony Request object
68-
* @return false|Callable Callable or false (fixme: method is returning an array)
68+
* @return callable|false Callable or false
6969
* @throws \phpbb\controller\exception
7070
*/
71-
public function getController(Request $request)
71+
public function getController(Request $request): callable|false
7272
{
7373
$controller = $request->attributes->get('_controller');
7474

di/extension/config.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function load(array $configs, ContainerBuilder $container)
6060
*
6161
* @return string The alias
6262
*/
63-
public function getAlias()
63+
public function getAlias(): string
6464
{
6565
return 'config';
6666
}

di/extension/core.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public function getConfiguration(array $config, ContainerBuilder $container)
144144
*
145145
* @return string The alias
146146
*/
147-
public function getAlias()
147+
public function getAlias(): string
148148
{
149149
return 'core';
150150
}

di/extension/tables.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function load(array $configs, ContainerBuilder $container)
5252
*
5353
* @return string The alias
5454
*/
55-
public function getAlias()
55+
public function getAlias(): string
5656
{
5757
return 'tables';
5858
}

exception/http_exception.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ class http_exception extends runtime_exception implements HttpExceptionInterface
2525
*
2626
* @var integer
2727
*/
28-
private $status_code;
28+
private int $status_code;
2929

3030
/**
3131
* Additional headers to set in the response.
3232
*
3333
* @var array
3434
*/
35-
private $headers;
35+
private array $headers;
3636

3737
/**
3838
* Constructor
@@ -55,15 +55,15 @@ public function __construct($status_code, $message = "", array $parameters = arr
5555
/**
5656
* {@inheritdoc}
5757
*/
58-
public function getStatusCode()
58+
public function getStatusCode(): int
5959
{
6060
return $this->status_code;
6161
}
6262

6363
/**
6464
* {@inheritdoc}
6565
*/
66-
public function getHeaders()
66+
public function getHeaders(): array
6767
{
6868
return $this->headers;
6969
}

extension/di/extension_base.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public function getConfiguration(array $config, ContainerBuilder $container)
132132
*
133133
* @return string The alias
134134
*/
135-
public function getAlias()
135+
public function getAlias(): string
136136
{
137137
return str_replace('/', '_', $this->extension_name);
138138
}

routing/loader_resolver.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function __construct($loaders = [])
3333
/**
3434
* {@inheritdoc}
3535
*/
36-
public function resolve($resource, $type = null)
36+
public function resolve($resource, $type = null): false|\Symfony\Component\Config\Loader\LoaderInterface
3737
{
3838
/** @var \Symfony\Component\Config\Loader\LoaderInterface $loader */
3939
foreach ($this->loaders as $loader)

routing/router.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -171,23 +171,23 @@ public function setContext(RequestContext $context)
171171
/**
172172
* {@inheritdoc}
173173
*/
174-
public function getContext()
174+
public function getContext(): RequestContext
175175
{
176176
return $this->context;
177177
}
178178

179179
/**
180180
* {@inheritdoc}
181181
*/
182-
public function generate($name, $parameters = array(), $referenceType = self::ABSOLUTE_PATH)
182+
public function generate(string $name, array $parameters = [], int $referenceType = self::ABSOLUTE_PATH): string
183183
{
184184
return $this->get_generator()->generate($name, $parameters, $referenceType);
185185
}
186186

187187
/**
188188
* {@inheritdoc}
189189
*/
190-
public function match($pathinfo)
190+
public function match(string $pathinfo): array
191191
{
192192
return $this->get_matcher()->match($pathinfo);
193193
}

0 commit comments

Comments
 (0)