Skip to content

Commit

Permalink
Add support for Symfony 5
Browse files Browse the repository at this point in the history
  • Loading branch information
fre5h committed Apr 12, 2020
1 parent e6918b3 commit c49b490
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 33 deletions.
64 changes: 50 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,69 @@ language: php

sudo: false

cache:
directories:
- $HOME/.composer/cache/files

php:
- '7.2'
- '7.3'
- '7.4'
- 7.3
- 7.4

env:
- SYMFONY_VERSION=4.4.*
global:
- PHPUNIT_FLAGS="-v"
jobs:
- SYMFONY_VERSION=4.4.*
- SYMFONY_VERSION=5.0.*

stages:
- composer validation
- code style
- static analyze
- test
- code coverage

jobs:
fast_finish: true
include:
# Composer validation
- stage: composer validation
php: 7.3
env: SYMFONY_VERSION=5.0.*
script:
- composer validate --strict --no-check-lock
# Code style
- stage: code style
php: 7.3
env: SYMFONY_VERSION=5.0.*
script: ./vendor/bin/phpcs ./ -p --encoding=utf-8 --extensions=php --ignore="vendor|Tests" --standard=./vendor/escapestudios/symfony2-coding-standard/Symfony
# PHPStan analyze
- stage: static analyze
php: 7.3
env: SYMFONY_VERSION=5.0.*
script: ./vendor/bin/phpstan analyse -l 8 --no-progress -c phpstan.neon ./
# Code coverage with Codecov.io
- stage: code coverage
php: 7.3
env: COVERAGE=true SYMFONY_VERSION=5.0.*
script:
- ./vendor/bin/phpunit -c phpunit.xml.dist --coverage-clover=coverage.xml
after_script:
- bash <(curl -s https://codecov.io/bash)
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover coverage.xml

before_install:
- echo "extension=redis.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- composer self-update
- composer require --no-update symfony/symfony "$SYMFONY_VERSION"
- if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi

install:
- composer install --no-interaction --prefer-dist

script:
- ./vendor/bin/phpcs ./ -p --encoding=utf-8 --extensions=php --ignore="vendor|Tests" --standard=./vendor/escapestudios/symfony2-coding-standard/Symfony
- ./vendor/bin/phpunit -c phpunit.xml.dist --coverage-clover=coverage.xml
- ./vendor/bin/phpstan analyse -l 7 --no-progress -c phpstan.neon ./

after_success:
- bash <(curl -s https://codecov.io/bash)

cache:
directories:
- $COMPOSER_CACHE_DIR
- ./vendor/bin/phpunit $PHPUNIT_FLAG -c phpunit.xml.dist

notifications:
email:
Expand Down
2 changes: 1 addition & 1 deletion Cache/PredisCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ private function getModifiedKeyWithMigrationPrefix(string $key): string
private function getModifiedKeysWithMigrationPrefix(array $keys): array
{
return \array_map(
function ($key) {
function (string $key) {
return $this->getModifiedKeyWithMigrationPrefix($key);
},
$keys
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ After that you can stop or rerun old script. And after rerun they will use a new

## Installation

```composer req stfalcon-studio/doctrine-redis-cache-bundle='~1.1'```
```composer req stfalcon-studio/doctrine-redis-cache-bundle='~1.2'```

#### Check the `config/bundles.php` file

Expand Down
29 changes: 14 additions & 15 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,27 @@
"issues": "https://github.com/stfalcon-studio/DoctrineRedisCacheBundle/issues"
},
"require": {
"php": ">=7.2.5",
"php": ">=7.3",
"ext-redis": "*",
"doctrine/cache": "^1.10",
"doctrine/doctrine-migrations-bundle": "^2.1",
"predis/predis": "^1.1",
"symfony/config": "^4.4",
"symfony/dependency-injection": "^4.4",
"symfony/framework-bundle": "^4.4",
"symfony/http-kernel": "^4.4"
"symfony/config": "^4.4 || ^5.0",
"symfony/dependency-injection": "^4.4 || ^5.0",
"symfony/framework-bundle": "^4.4 || ^5.0",
"symfony/http-kernel": "^4.4 || ^5.0"
},
"require-dev": {
"escapestudios/symfony2-coding-standard": "^3.8",
"escapestudios/symfony2-coding-standard": "^3.11",
"friendsofphp/php-cs-fixer": "^2.15",
"johnkary/phpunit-speedtrap": "^3.1",
"phpstan/phpstan": "^0.11",
"phpstan/phpstan-deprecation-rules": "^0.11",
"phpstan/phpstan-doctrine": "^0.11",
"phpstan/phpstan-phpunit": "^0.11",
"thecodingmachine/phpstan-strict-rules": "^0.11",
"phpunit/phpunit": "^8.5",
"slam/phpstan-extensions": "^3.5",
"symfony/phpunit-bridge": "^4.4"
"johnkary/phpunit-speedtrap": "^3.2",
"phpstan/phpstan": "^0.12",
"phpstan/phpstan-deprecation-rules": "^0.12",
"phpstan/phpstan-doctrine": "^0.12",
"phpstan/phpstan-phpunit": "^0.12",
"thecodingmachine/phpstan-strict-rules": "^0.12",
"phpunit/phpunit": "^9.1",
"slam/phpstan-extensions": "^4.0"
},
"autoload": {
"psr-4": {
Expand Down
5 changes: 4 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ includes:
- 'vendor/phpstan/phpstan-phpunit/extension.neon'
- 'vendor/phpstan/phpstan-phpunit/rules.neon'
- 'vendor/phpstan/phpstan-doctrine/extension.neon'
- 'vendor/slam/phpstan-extensions/conf/slam-rules.neon'
parameters:
level: 7
level: 8
excludes_analyse:
- '%rootDir%/../../../Tests/*'
- '%rootDir%/../../../tests/*'
- '%rootDir%/../../../vendor/*'
fileExtensions:
- 'php'
checkMissingIterableValueType: false
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/8.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/9.1/phpunit.xsd"
colors="true"
bootstrap="vendor/autoload.php"
>
Expand Down

0 comments on commit c49b490

Please sign in to comment.