From 7937f93f13e84ab649d4cca32453738e63c27b9a Mon Sep 17 00:00:00 2001 From: Julien Deniau Date: Thu, 7 Sep 2023 20:15:30 +0000 Subject: [PATCH 1/2] test both version of doctrine/lexer --- .github/workflows/php.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 75bf4fe..db8891b 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -15,9 +15,8 @@ jobs: strategy: matrix: - include: - - php: "8.1" - - php: "8.2" + php-versions: ['8.1', '8.2', '8.3'] + lexer-version: ['^2', 'latest'] steps: - uses: actions/checkout@v4 @@ -25,7 +24,7 @@ jobs: - name: Setup PHP with composer uses: shivammathur/setup-php@v2 with: - php-version: ${{ matrix.php }} + php-version: ${{ matrix.php-versions }} tools: composer - name: Get Composer Cache Directory @@ -42,6 +41,10 @@ jobs: - name: Install dependencies run: composer install + + - name: Install doctrine/lexer + if: ${{ matrix.lexer-version != 'latest' }} + run: composer require doctrine/lexer:${{ matrix.lexer-version }} - name: Validate composer.json and composer.lock run: composer validate --strict From 2636928dcb374380beab9c712cff4d0b25a67bec Mon Sep 17 00:00:00 2001 From: Julien Deniau Date: Thu, 7 Sep 2023 20:26:34 +0000 Subject: [PATCH 2/2] Fix issue in covariance in lexer 2 --- src/Lexer.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Lexer.php b/src/Lexer.php index 4f8f763..87ac182 100644 --- a/src/Lexer.php +++ b/src/Lexer.php @@ -32,8 +32,12 @@ protected function getNonCatchablePatterns() /** * {@inheritdoc} + * + * @param string $value + * + * @return int */ - protected function getType(string &$value): int + protected function getType(&$value): int { switch ($value) { case ',':