diff --git a/.gitattributes b/.gitattributes index 6c3ec6d..ee1486b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,8 @@ .gitattributes export-ignore .gitignore export-ignore +.github/ export-ignore vendor/ export-ignore composer.* export-ignore +phpstan.neon export-ignore README.* export-ignore +LICENSE export-ignore diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 759125a..96c7704 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,38 +15,44 @@ on: jobs: # Composer config validation composer: - name: Composer config validation - runs-on: ubuntu-latest + name: "Composer config validation" + runs-on: "ubuntu-latest" steps: - - uses: actions/checkout@v3 - - name: Validate composer.json - run: composer validate --strict + - uses: "actions/checkout@v3" + - name: "Validate composer.json" + run: "composer validate --strict" # PHP syntax validation php: - name: PHP syntax validation - runs-on: ubuntu-latest + name: "PHP syntax validation" + runs-on: "ubuntu-latest" + strategy: + matrix: + php_version: [ 8.0, 8.1, 8.2 ] steps: - - uses: actions/checkout@v3 - - name: Check PHP syntax of config/phinx.php - run: php -l Lib/ + - uses: "actions/checkout@v3" + - uses: "shivammathur/setup-php@v2" + with: + php-version: "${{ matrix.php_version }}" + - name: "Check PHP syntax of config/phinx.php" + run: "php -l Lib/" # phpstan for several php versions phpstan: - runs-on: ubuntu-latest + runs-on: "ubuntu-latest" strategy: matrix: php_version: [ 8.0, 8.1, 8.2 ] steps: - - uses: actions/checkout@v3 - - uses: php-actions/composer@v6 + - uses: "actions/checkout@v3" + - uses: "php-actions/composer@v6" with: - php_version: ${{ matrix.php_version }} - php_extensions: redis intl + php_version: "${{ matrix.php_version }}" + php_extensions: "redis intl" - - name: PHPStan Static Analysis - uses: php-actions/phpstan@v3 + - name: "PHPStan Static Analysis" + uses: "php-actions/phpstan@v3" with: - php_version: ${{ matrix.php_version }} - configuration: phpstan.neon - path: Lib/ + php_version: "${{ matrix.php_version }}" + configuration: "phpstan.neon" + path: "Lib/" diff --git a/Lib/Cache/Engine/PredisEngine.php b/Lib/Cache/Engine/PredisEngine.php index 1747522..f0298e6 100644 --- a/Lib/Cache/Engine/PredisEngine.php +++ b/Lib/Cache/Engine/PredisEngine.php @@ -150,9 +150,9 @@ protected function _connect(): bool * @param string $key Identifier for the data * @param mixed $value Data to be cached * @param int $duration How long to cache the data, in seconds - * @return bool True if the data was successfully cached, false on failure + * @return bool|string True if the data was successfully cached, false on failure */ - public function write($key, $value, $duration): bool + public function write($key, $value, $duration) { if (!is_int($value)) { $value = serialize($value);