Skip to content

Commit

Permalink
Fix E_STRICT error messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
nrk committed Dec 11, 2011
1 parent 71aad42 commit 4e0c09a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/Predis/Commands/PrefixHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class PrefixHelpers
* @param ICommand $command Command instance.
* @param string $prefix Prefix string.
*/
public function first(ICommand $command, $prefix)
public static function first(ICommand $command, $prefix)
{
if ($arguments = $command->getArguments()) {
$arguments[0] = "$prefix{$arguments[0]}";
Expand Down
8 changes: 5 additions & 3 deletions tests/PHPUnit/ArrayHasSameValuesConstraint.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ public function __construct($array)
/**
* {@inheritdoc}
*/
public function evaluate($other)
public function evaluate($other, $description = '', $returnResult = FALSE)
{
$description = $description ?: 'Failed asserting that two arrays have the same elements.';

if (count($this->array) !== count($other)) {
throw new PHPUnit_Framework_ExpectationFailedException('Failed asserting that two arrays have the same elements.');
throw new PHPUnit_Framework_ExpectationFailedException($description);
}
if (array_diff($this->array, $other)) {
throw new PHPUnit_Framework_ExpectationFailedException('Failed asserting that two arrays have the same elements.');
throw new PHPUnit_Framework_ExpectationFailedException($description);
}

return true;
Expand Down
3 changes: 2 additions & 1 deletion tests/Predis/Commands/ServerSlowlogTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ public function testReturnsAnArrayOfLoggedCommands()
{
$redis = $this->getClient();

$threshold = array_pop($redis->config('get', 'slowlog-log-slower-than'));
$config = $redis->config('get', 'slowlog-log-slower-than');
$threshold = array_pop($config);

$redis->config('set', 'slowlog-log-slower-than', 0);
$redis->set('foo', 'bar');
Expand Down

0 comments on commit 4e0c09a

Please sign in to comment.