Skip to content

Commit 83b6765

Browse files
authored
Symfony 8 Support (#68)
1 parent 7a06457 commit 83b6765

25 files changed

Lines changed: 92 additions & 46 deletions

.github/workflows/analysis.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
os:
1414
- ubuntu-latest
1515
php:
16-
- "8.1"
16+
- "8.5"
1717
steps:
1818
-
1919
name: Checkout

.github/workflows/cs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
os:
1414
- ubuntu-latest
1515
php:
16-
- "8.0"
16+
- "8.5"
1717
steps:
1818
-
1919
name: Checkout

.github/workflows/tests.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
- "8.2"
1919
- "8.3"
2020
- "8.4"
21+
- "8.5"
2122
deps:
2223
- latest
2324
- lowest
@@ -49,6 +50,10 @@ jobs:
4950
name: Update composer
5051
run: composer self-update
5152

53+
-
54+
name: Remote tools
55+
run: composer remove psalm/plugin-symfony vimeo/psalm friendsofphp/php-cs-fixer --dev
56+
5257
-
5358
name: Install dependencies with composer
5459
if: matrix.deps == 'latest'

.php-cs-fixer.dist.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@
5454
'yoda_style' => false,
5555
'declare_strict_types' => false,
5656
'void_return' => false,
57-
'phpdoc_align' => [],
57+
'phpdoc_align' => [
58+
'align' => 'left',
59+
],
5860
'phpdoc_to_comment' => false,
5961
'single_line_comment_spacing' => false,
6062
'nullable_type_declaration_for_default_null_value' => true,

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
CHANGELOG
22
=========
33

4+
6.0.2 (2025-12-15)
5+
------------------
6+
7+
* Add Symfony 8 support
8+
* Add php 8.5 support
9+
10+
6.0.1 (2025-07-10)
11+
------------------
12+
13+
* Add php 8.4 support
14+
415
6.0.0 (2024-09-27)
516
------------------
617

composer.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,20 @@
2727
"php": "^8.0",
2828
"ext-curl": "*",
2929
"ext-json": "*",
30-
"symfony/console": "^5.4 || ^6.0 || ^7.0",
31-
"symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0",
32-
"symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0",
30+
"symfony/console": "^5.4 || ^6.0 || ^7.0 || ^8.0",
31+
"symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0 || ^8.0",
32+
"symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0 || ^8.0",
3333
"telegram-bot/api": "^2.3.14"
3434
},
3535
"require-dev": {
36-
"friendsofphp/php-cs-fixer": "~3.23.0",
36+
"friendsofphp/php-cs-fixer": "~3.92.0",
3737
"symfony/phpunit-bridge": "^7.0.1",
38-
"symfony/security-http": "^5.4 || ^6.0 || ^7.0",
39-
"symfony/http-client": "^5.4 || ^6.0 || ^7.0",
40-
"symfony/messenger": "^5.4 || ^6.0 || ^7.0",
41-
"symfony/yaml": "^5.4 || ^6.0 || ^7.0",
42-
"vimeo/psalm": "~4.30.0",
43-
"psalm/plugin-symfony": "^4.0"
38+
"symfony/security-http": "^5.4 || ^6.0 || ^7.0 || ^8.0",
39+
"symfony/http-client": "^5.4 || ^6.0 || ^7.0 || ^8.0",
40+
"symfony/messenger": "^5.4 || ^6.0 || ^7.0 || ^8.0",
41+
"symfony/yaml": "^5.4 || ^6.0 || ^7.0 || ^8.0",
42+
"vimeo/psalm": "~6.14.2",
43+
"psalm/plugin-symfony": "^5.2.7"
4444
},
4545
"suggest": {
4646
"symfony/security-guard": "Required to implement user authentication through Telegram",

psalm.xml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,10 @@
1313
</ignoreFiles>
1414
</projectFiles>
1515
<issueHandlers>
16-
<!-- Workaround for https://github.com/vimeo/psalm/issues/7026 -->
17-
<ReservedWord>
18-
<errorLevel type="suppress">
19-
<directory name="src"/>
20-
<directory name="tests"/>
21-
</errorLevel>
22-
</ReservedWord>
16+
<UnusedClass errorLevel="suppress" />
17+
<PossiblyUnusedMethod errorLevel="suppress" />
2318
</issueHandlers>
19+
2420
<plugins>
2521
<pluginClass class="Psalm\SymfonyPsalmPlugin\Plugin"/>
2622
</plugins>

src/Authenticator/TelegramAuthenticator.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,15 @@ public function __construct(
3939
) {
4040
}
4141

42+
#[\Override]
4243
public function supports(Request $request): ?bool
4344
{
4445
$route = $request->attributes->get('_route');
4546

4647
return $route === $this->guardRoute;
4748
}
4849

50+
#[\Override]
4951
public function authenticate(Request $request): Passport
5052
{
5153
$credentials = $request->query->all();
@@ -66,6 +68,7 @@ public function authenticate(Request $request): Passport
6668
}));
6769
}
6870

71+
#[\Override]
6972
public function onAuthenticationSuccess(Request $request, TokenInterface $token, string $firewallName): ?Response
7073
{
7174
if ($targetPath = $this->getTargetPath($request->getSession(), $firewallName)) {
@@ -75,6 +78,7 @@ public function onAuthenticationSuccess(Request $request, TokenInterface $token,
7578
return new RedirectResponse($this->urlGenerator->generate($this->defaultTargetRoute));
7679
}
7780

81+
#[\Override]
7882
public function onAuthenticationFailure(Request $request, AuthenticationException $exception): ?Response
7983
{
8084
if ($this->loginRoute) {

src/BoShurikTelegramBotBundle.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,21 @@
1919

2020
final class BoShurikTelegramBotBundle extends Bundle
2121
{
22+
#[\Override]
2223
public function build(ContainerBuilder $container): void
2324
{
2425
parent::build($container);
2526

2627
$container->addCompilerPass(new CommandCompilerPass());
2728
}
2829

30+
#[\Override]
2931
public function getContainerExtension(): ?ExtensionInterface
3032
{
3133
if (null === $this->extension) {
3234
$this->extension = new BoShurikTelegramBotExtension();
3335
}
3436

35-
return $this->extension;
37+
return $this->extension ?: null;
3638
}
3739
}

src/Command/UpdatesCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public function __construct(private Telegram $telegram)
2424
parent::__construct();
2525
}
2626

27+
#[\Override]
2728
protected function configure(): void
2829
{
2930
$this
@@ -33,9 +34,9 @@ protected function configure(): void
3334
;
3435
}
3536

37+
#[\Override]
3638
protected function execute(InputInterface $input, OutputInterface $output): int
3739
{
38-
/** @var string|null $bot */
3940
$bot = $input->getArgument('bot');
4041
if ($bot) {
4142
$this->telegram->processUpdates($bot);

0 commit comments

Comments
 (0)