Skip to content

Commit

Permalink
Merge pull request #356 from siwinski/pr-fix-php-7-2-failure
Browse files Browse the repository at this point in the history
[Driver/Composite] Fix PHP 7.2 failure
  • Loading branch information
tedivm committed May 30, 2017
2 parents 1147617 + 33417a5 commit e9a6aaf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Stash/Driver/Composite.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,18 @@ protected function setOptions(array $options = array())
{
$options += $this->getDefaultOptions();

if (!isset($options['drivers']) || (count($options['drivers']) < 1)) {
if (!isset($options['drivers'])) {
throw new RuntimeException('One or more secondary drivers are required.');
}

if (!is_array($options['drivers'])) {
throw new InvalidArgumentException('Drivers option requires an array.');
}

if (count($options['drivers']) < 1) {
throw new RuntimeException('One or more secondary drivers are required.');
}

$this->drivers = array();
foreach ($options['drivers'] as $driver) {
if (!(is_object($driver) && $driver instanceof DriverInterface)) {
Expand Down

0 comments on commit e9a6aaf

Please sign in to comment.