From d4e27420ce1dd04905103dff2361d9ae99759248 Mon Sep 17 00:00:00 2001 From: USAMI Kenta Date: Sat, 13 Mar 2021 16:33:28 +0900 Subject: [PATCH 1/6] composer require --dev vimeo/psalm:^4.6 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 4a19c9d7..41008e5a 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ } }, "require-dev": { - "vimeo/psalm": "^4.3", + "vimeo/psalm": "^4.6", "squizlabs/php_codesniffer": "^3.5", "phpunit/phpunit": "^9.5" } From 0ce240e6481f5b4bfab818bf260c99a555414e0c Mon Sep 17 00:00:00 2001 From: USAMI Kenta Date: Sat, 13 Mar 2021 16:21:45 +0900 Subject: [PATCH 2/6] psalm --update-baseline --- psalm-baseline.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 10081529..045646be 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -704,9 +704,8 @@ - + $autoIncrementOffsets - $columns From 5d44c08be578db589a05d9adaafb754cbc54b048 Mon Sep 17 00:00:00 2001 From: USAMI Kenta Date: Sat, 13 Mar 2021 15:25:11 +0900 Subject: [PATCH 3/6] Add type for return value of preg_split() --- src/Parser/SQLLexer.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Parser/SQLLexer.php b/src/Parser/SQLLexer.php index 919b6cb4..1550698e 100644 --- a/src/Parser/SQLLexer.php +++ b/src/Parser/SQLLexer.php @@ -17,6 +17,7 @@ final class SQLLexer */ public function lex(string $sql) { + /** @var list|false $tokens */ $tokens = preg_split( self::TOKEN_SPLIT_REGEX, $sql, From 381866fe84f47f6792d8eb5351f743447e3cabc6 Mon Sep 17 00:00:00 2001 From: USAMI Kenta Date: Sat, 13 Mar 2021 16:56:31 +0900 Subject: [PATCH 4/6] Apply changes in composer.json to GitHub Actions cache --- .github/workflows/phpunit.yml | 2 +- .github/workflows/psalm.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 7bc6baa7..32f53255 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -22,7 +22,7 @@ jobs: uses: actions/cache@v2 with: path: vendor - key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.*') }} restore-keys: | ${{ runner.os }}-php- diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml index fe76aa5e..9232dd6e 100644 --- a/.github/workflows/psalm.yml +++ b/.github/workflows/psalm.yml @@ -19,7 +19,7 @@ jobs: uses: actions/cache@v2 with: path: vendor - key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.*') }} restore-keys: | ${{ runner.os }}-php- From bc7fa7cf6174d4906161da83a384e323014ff92e Mon Sep 17 00:00:00 2001 From: USAMI Kenta Date: Sat, 13 Mar 2021 16:59:48 +0900 Subject: [PATCH 5/6] Revert "Add type for return value of preg_split()" This reverts commit 5d44c08be578db589a05d9adaafb754cbc54b048. --- src/Parser/SQLLexer.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Parser/SQLLexer.php b/src/Parser/SQLLexer.php index 1550698e..919b6cb4 100644 --- a/src/Parser/SQLLexer.php +++ b/src/Parser/SQLLexer.php @@ -17,7 +17,6 @@ final class SQLLexer */ public function lex(string $sql) { - /** @var list|false $tokens */ $tokens = preg_split( self::TOKEN_SPLIT_REGEX, $sql, From 0f54308a4dfcb80acd028b7baf035a7b575bdc29 Mon Sep 17 00:00:00 2001 From: USAMI Kenta Date: Sat, 13 Mar 2021 17:22:48 +0900 Subject: [PATCH 6/6] Follows actions/cache best practice https://github.com/actions/cache/blob/main/examples.md#php---composer --- .github/workflows/phpunit.yml | 12 ++++++++---- .github/workflows/psalm.yml | 12 ++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 32f53255..a1bbf1a6 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -17,14 +17,18 @@ jobs: - name: Validate composer.json and composer.lock run: composer validate - - name: Cache Composer packages + - name: Get Composer Cache Directory id: composer-cache + run: | + echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: Cache Composer packages uses: actions/cache@v2 with: - path: vendor - key: ${{ runner.os }}-php-${{ hashFiles('**/composer.*') }} + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: | - ${{ runner.os }}-php- + ${{ runner.os }}-composer- - name: Install dependencies if: steps.composer-cache.outputs.cache-hit != 'true' diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml index 9232dd6e..93c3f94a 100644 --- a/.github/workflows/psalm.yml +++ b/.github/workflows/psalm.yml @@ -14,14 +14,18 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Cache Composer packages + - name: Get Composer Cache Directory id: composer-cache + run: | + echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: Cache Composer packages uses: actions/cache@v2 with: - path: vendor - key: ${{ runner.os }}-php-${{ hashFiles('**/composer.*') }} + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: | - ${{ runner.os }}-php- + ${{ runner.os }}-composer- - name: Install dependencies if: steps.composer-cache.outputs.cache-hit != 'true'