From 0add9ef47b35d1faf8a3917ae6767f17d799d882 Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Fri, 18 Feb 2022 17:05:54 +0900 Subject: [PATCH] =?UTF-8?q?GitHub=20Actions=20=E3=81=AE=E3=83=9F=E3=83=89?= =?UTF-8?q?=E3=83=AB=E3=82=A6=E3=82=A7=E3=82=A2=E3=83=90=E3=83=BC=E3=82=B8?= =?UTF-8?q?=E3=83=A7=E3=83=B3=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - PHP8.1 を追加 - PHPStan のエラー修正 > Return type mixed of method php_user_filter_lf2crlf::filter() is not covariant with tentative return type int of method php_user_filter::filter(). - auto_detect_line_endings はPHP8.1.0以降非推奨 --- .github/workflows/main.yml | 3 ++- .github/workflows/phpstan.yml | 2 +- data/class/SC_Initial.php | 4 +++- data/class/helper/SC_Helper_CSV.php | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7a867533d8..c6f850ad53 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,7 +20,7 @@ jobs: fail-fast: false matrix: operating-system: [ ubuntu-18.04 ] - php: [ '5.4', '5.5', '5.6', '7.1', '7.2', '7.3', '7.4', '8.0' ] + php: [ '5.4', '5.5', '5.6', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1' ] db: [ mysql, pgsql ] include: - db: mysql @@ -33,6 +33,7 @@ jobs: dbuser: 'postgres' dbpass: 'password' dbname: 'eccube_db' + services: mysql: image: mysql:5.7 diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index e94b56e888..ec8e8b909a 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -35,7 +35,7 @@ jobs: - name: Setup PHP uses: nanasess/setup-php@master with: - php-version: '8.0' + php-version: '8.1' - name: composer install env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # 暫定対応 diff --git a/data/class/SC_Initial.php b/data/class/SC_Initial.php index 83c5aa204e..f4de21a1f4 100644 --- a/data/class/SC_Initial.php +++ b/data/class/SC_Initial.php @@ -147,7 +147,9 @@ public function phpconfigInit() ini_set('mbstring.http_input', CHAR_CODE); ini_set('mbstring.http_output', CHAR_CODE); } - ini_set('auto_detect_line_endings', 1); + if (PHP_VERSION_ID < 80100) { + ini_set('auto_detect_line_endings', 1); + } ini_set('default_charset', CHAR_CODE); ini_set('mbstring.detect_order', 'auto'); ini_set('mbstring.substitute_character', 'none'); diff --git a/data/class/helper/SC_Helper_CSV.php b/data/class/helper/SC_Helper_CSV.php index a7742414b1..7a2d0a7c77 100644 --- a/data/class/helper/SC_Helper_CSV.php +++ b/data/class/helper/SC_Helper_CSV.php @@ -386,7 +386,8 @@ public static function &fopen_for_output_csv($filename = 'php://output') */ class php_user_filter_lf2crlf extends php_user_filter { - function filter($in, $out, &$consumed, $closing) + #[\ReturnTypeWillChange] + public function filter($in, $out, &$consumed, $closing) { while ($bucket = stream_bucket_make_writeable($in)) { $bucket->data = preg_replace("/[\r\n]+$/", "\r\n", $bucket->data);