Skip to content

Commit 08835fb

Browse files
OkspenAndrii Krasnoholovets
andauthored
AC-282: Fix deprecation messages for Symfony 6 (#16)
* AC-282: add void typehint * AC-282: route loading error fix * AC-282: extra check removed * AC-282: remove Reader check --------- Co-authored-by: Andrii Krasnoholovets <andrii.krasnoholovets@paysera.net>
1 parent dc7601c commit 08835fb

File tree

5 files changed

+15
-2
lines changed

5 files changed

+15
-2
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
- '8.0'
2626
- '8.1'
2727
- '8.2'
28+
- '8.3'
2829
symfony:
2930
- '3.*'
3031
- '4.*'
@@ -38,6 +39,7 @@ jobs:
3839
- { php: '8.0', symfony: '3.*' }
3940
- { php: '8.1', symfony: '3.*' }
4041
- { php: '8.2', symfony: '3.*' }
42+
- { php: '8.3', symfony: '3.*' }
4143
- { php: '7.1', symfony: '5.*' }
4244
- { php: '7.1', symfony: '6.*' }
4345
- { php: '7.2', symfony: '6.*' }

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [1.8.1]
8+
### Added
9+
- `void` typehint to `PayseraApiBundle::build` method to fix the deprecation message
10+
- PHP 8.3 to CI
11+
### Fixed
12+
- `Call to a member function getClassAnnotations() on null` error in `RoutingAttributeLoader` on Symfony 6
13+
714
## [1.8.0]
815
### Added
916
- Support for PHP 8 attributes

src/Listener/RestResponseListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ private function normalizeResult(Request $request, RestRequestOptions $options,
6565
{
6666
$includedFields = [];
6767
$fields = $request->query->get('fields');
68-
if ($fields !== null && is_string($fields) && $fields !== '') {
68+
if (is_string($fields) && $fields !== '') {
6969
$includedFields = explode(',', $fields);
7070
}
7171

src/PayseraApiBundle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
class PayseraApiBundle extends Bundle
1111
{
12-
public function build(ContainerBuilder $container)
12+
public function build(ContainerBuilder $container): void
1313
{
1414
parent::build($container);
1515

src/Service/RoutingLoader/RoutingAttributeLoader.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ protected function configureRoute(
6161

6262
private function loadAnnotations(Route $route, ReflectionClass $class, ReflectionMethod $method): void
6363
{
64+
if (!isset($this->reader)) {
65+
return;
66+
}
67+
6468
$annotations = [];
6569
foreach ($this->reader->getClassAnnotations($class) as $annotation) {
6670
if ($annotation instanceof RestAnnotationInterface) {

0 commit comments

Comments
 (0)