Skip to content

Commit 4ee2510

Browse files
authored
Merge pull request #217 from phpcr/cleanup-major
drop workarounds for symfony 2
2 parents 2e6df65 + ec608ad commit 4ee2510

File tree

102 files changed

+1134
-1668
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+1134
-1668
lines changed

.github/workflows/test-application.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,8 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
include:
20-
- php-version: '7.2'
21-
dependencies: 'lowest'
22-
- php-version: '7.3'
23-
- php-version: '7.4'
2420
- php-version: '8.0'
21+
dependencies: 'lowest'
2522
- php-version: '8.1'
2623
- php-version: '8.2'
2724
- php-version: '8.3'

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ Changelog
88
------------------
99

1010
* Support Symfony 7
11-
* Test with PHP 8.3
11+
* Drop support for Symfony 2
12+
* Remove deprecated code, clean up workarounds for Symfony 2.
13+
* Drop support for PHP 7, test with PHP 8.3
1214
* Adjusted commands to have the return type declarations.
1315

1416
1.x

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
}
2828
],
2929
"require": {
30-
"php": "^7.2 || ^8.0",
30+
"php": "^8.0",
3131
"phpcr/phpcr": "~2.1.0",
32-
"symfony/console": "^2.3 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0"
32+
"symfony/console": "^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0"
3333
},
3434
"require-dev": {
3535
"ramsey/uuid": "^3.5",

phpstan.neon.dist

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,3 @@ parameters:
22
level: 2
33
paths:
44
- src
5-
ignoreErrors:
6-
-
7-
message: "#Symfony\\\\Component\\\\Console\\\\Helper\\\\DialogHelper#"
8-
count: 3
9-
path: src/PHPCR/Util/Console/Command/BaseCommand.php

src/PHPCR/Util/CND/Exception/ParserException.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace PHPCR\Util\CND\Exception;
46

57
use PHPCR\Util\CND\Scanner\GenericToken;
@@ -12,7 +14,7 @@
1214
*/
1315
class ParserException extends \Exception
1416
{
15-
public function __construct(TokenQueue $queue, $msg)
17+
public function __construct(TokenQueue $queue, string $msg)
1618
{
1719
$token = $queue->peek();
1820
$msg = sprintf("PARSER ERROR: %s. Current token is [%s, '%s'] at line %s, column %s", $msg, GenericToken::getTypeName($token->getType()), $token->getData(), $token->getLine(), $token->getRow());

src/PHPCR/Util/CND/Exception/ScannerException.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace PHPCR\Util\CND\Exception;
46

57
use PHPCR\Util\CND\Reader\ReaderInterface;
@@ -11,7 +13,7 @@
1113
*/
1214
class ScannerException extends \Exception
1315
{
14-
public function __construct(ReaderInterface $reader, $msg)
16+
public function __construct(ReaderInterface $reader, string $msg)
1517
{
1618
$msg = sprintf(
1719
"SCANNER ERROR: %s at line %s, column %s.\nCurrent buffer \"%s\"",

src/PHPCR/Util/CND/Parser/AbstractParser.php

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace PHPCR\Util\CND\Parser;
46

57
use PHPCR\Util\CND\Exception\ParserException;
@@ -23,10 +25,8 @@ abstract class AbstractParser
2325
{
2426
/**
2527
* The token queue.
26-
*
27-
* @var TokenQueue
2828
*/
29-
protected $tokenQueue;
29+
protected TokenQueue $tokenQueue;
3030

3131
/**
3232
* Check the next token without consuming it and return true if it matches the given type and data.
@@ -36,10 +36,8 @@ abstract class AbstractParser
3636
* @param int $type The expected token type
3737
* @param string|null $data The expected data or null
3838
* @param bool $ignoreCase whether to do string comparisons case insensitive or sensitive
39-
*
40-
* @return bool
4139
*/
42-
protected function checkToken($type, $data = null, $ignoreCase = false)
40+
protected function checkToken($type, string $data = null, bool $ignoreCase = false): bool
4341
{
4442
if ($this->tokenQueue->isEof()) {
4543
return false;
@@ -65,11 +63,9 @@ protected function checkToken($type, $data = null, $ignoreCase = false)
6563
/**
6664
* Check if the token data is one of the elements of the data array.
6765
*
68-
* @param int $type
69-
*
70-
* @return bool
66+
* @param string[] $data
7167
*/
72-
protected function checkTokenIn($type, array $data, $ignoreCase = false)
68+
protected function checkTokenIn(int $type, array $data, bool $ignoreCase = false): bool
7369
{
7470
foreach ($data as $d) {
7571
if ($this->checkToken($type, $d, $ignoreCase)) {
@@ -87,11 +83,9 @@ protected function checkTokenIn($type, array $data, $ignoreCase = false)
8783
* @param int $type The expected token type
8884
* @param string|null $data The expected token data or null
8985
*
90-
* @return Token
91-
*
9286
* @throws ParserException
9387
*/
94-
protected function expectToken($type, $data = null)
88+
protected function expectToken(int $type, string $data = null): Token
9589
{
9690
$token = $this->tokenQueue->peek();
9791

@@ -110,10 +104,8 @@ protected function expectToken($type, $data = null)
110104
*
111105
* @param int $type The expected token type
112106
* @param string|null $data The expected token data or null
113-
*
114-
* @return bool|Token
115107
*/
116-
protected function checkAndExpectToken($type, $data = null)
108+
protected function checkAndExpectToken(int $type, string $data = null): bool|Token
117109
{
118110
if ($this->checkToken($type, $data)) {
119111
$token = $this->tokenQueue->peek();

0 commit comments

Comments
 (0)