Skip to content

Commit

Permalink
Merge pull request #12645 from ADmad/travis-config
Browse files Browse the repository at this point in the history
Travis config
  • Loading branch information
ADmad committed Oct 17, 2018
2 parents 9b484db + d7541b2 commit e653392
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
13 changes: 4 additions & 9 deletions .travis.yml
Expand Up @@ -5,11 +5,9 @@ php:
- 5.6
- 7.1
- 7.2
- 7.3.0RC1
- 7.3

sudo: required

dist: xenial
dist: trusty

env:
matrix:
Expand All @@ -26,9 +24,6 @@ services:
- mysql

addons:
apt:
packages:
- libzip4
postgresql: "9.4"

cache:
Expand All @@ -48,7 +43,7 @@ matrix:

before_install:
- echo cakephp version && tail -1 VERSION.txt
- if [[ ${TRAVIS_PHP_VERSION} != "7.3.0RC1" ]]; then phpenv config-rm xdebug.ini; fi
- if [[ ${TRAVIS_PHP_VERSION} != "7.3" ]]; then phpenv config-rm xdebug.ini; fi

- if [ $DB = 'mysql' ]; then mysql -u root -e 'CREATE DATABASE cakephp_test;'; fi
- if [ $DB = 'mysql' ]; then mysql -u root -e 'CREATE DATABASE cakephp_test2;'; fi
Expand All @@ -60,7 +55,7 @@ before_install:

- if [[ $DEFAULT = 1 || $PHPSTAN = 1 ]] ; then pecl channel-update pecl.php.net; fi;
- |
if [[ ${TRAVIS_PHP_VERSION} != "7.3.0RC1" && ${TRAVIS_PHP_VERSION} != "5.6" && ($DEFAULT = 1 || $PHPSTAN = 1) ]]; then
if [[ ${TRAVIS_PHP_VERSION} != "7.3" && ${TRAVIS_PHP_VERSION} != "5.6" && ($DEFAULT = 1 || $PHPSTAN = 1) ]]; then
echo 'extension = memcached.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini;
fi
- if [[ $DEFAULT = 1 || $PHPSTAN = 1 ]] ; then echo 'extension = redis.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi
Expand Down
2 changes: 2 additions & 0 deletions phpstan.neon
Expand Up @@ -26,6 +26,8 @@ parameters:
- '#Call to an undefined method Cake\\Auth\\Storage\\StorageInterface::setConfig\(\)#'
- '#Variable \$_SESSION in isset\(\) always exists and is not nullable#'
- '#PHPDoc tag @throws with type PHPUnit\\Exception is not subtype of Throwable#'
- '#Method Redis::setex\(\) invoked with 3 parameters, 0 required#'
- '#Method Redis::setnx\(\) invoked with 2 parameters, 0 required#'
earlyTerminatingMethodCalls:
Cake\Console\Shell:
- abort
Expand Down
6 changes: 3 additions & 3 deletions src/Cache/Engine/RedisEngine.php
Expand Up @@ -140,7 +140,7 @@ public function write($key, $value)
return $this->_Redis->set($key, $value);
}

return $this->_Redis->setex($key, $duration, $value);
return $this->_Redis->setEx($key, $duration, $value);
}

/**
Expand Down Expand Up @@ -256,8 +256,8 @@ public function add($key, $value)
$value = serialize($value);
}

// setnx() doesn't have an expiry option, so follow up with an expiry
if ($this->_Redis->setnx($key, $value)) {
// setNx() doesn't have an expiry option, so follow up with an expiry
if ($this->_Redis->setNx($key, $value)) {
return $this->_Redis->setTimeout($key, $duration);
}

Expand Down

0 comments on commit e653392

Please sign in to comment.