Skip to content
This repository has been archived by the owner on Nov 20, 2017. It is now read-only.

Commit

Permalink
Updated Travis configuration & code-style fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmalloc committed Sep 30, 2014
1 parent 28d0ff3 commit c0b87fa
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 36 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
@@ -1,14 +1,14 @@
language: php

php: ["5.5", "5.6", "hhvm"]
php: ["5.5", "5.6", "hhvm", "hhvm-nightly"]

matrix:
allow_failures: [{"php": "5.6"}, {"php": "hhvm"}]
allow_failures: [{"php": "hhvm"}, {"php": "hhvm-nightly"}]
fast_finish: true

env:
global:
- ARCHER_PUBLISH_VERSION=5.5
- ARCHER_PUBLISH_VERSION=5.6
- secure: "TT3JxfB6fbd21cfHoHu9N4Eh9Vly4sks1ZYiIbtNvBLx2IZUJoV1NKdx/G04hNk31730AH1tEvYS2cVDqtm07FprqXnaHwF8dVfg2ua0SjyAMJxy558DIsUGUKuSuPAkp/mDEq3qH+PlWbeUA3GkzVF7dYKgbeMFhh+8SFRZPrM="

install:
Expand Down
2 changes: 1 addition & 1 deletion src/Cache/CacheDsnParser.php
Expand Up @@ -14,6 +14,6 @@ class CacheDsnParser implements ParserInterface

public function __construct()
{
$this->addHandler(new RedisHandler);
$this->addHandler(new RedisHandler());
}
}
6 changes: 3 additions & 3 deletions src/Cache/CacheFactory.php
Expand Up @@ -16,7 +16,7 @@ class CacheFactory implements CacheFactoryInterface, CacheVisitorInterface
public function __construct(CacheDsnParser $parser = null)
{
if (null === $parser) {
$parser = new CacheDsnParser;
$parser = new CacheDsnParser();
}

$this->parser = $parser;
Expand Down Expand Up @@ -59,7 +59,7 @@ public function visitRedisHandler(RedisHandler $handler)
{
$connection = $this
->isolator()
->new(Redis::CLASS);
->new(Redis::class);

$connection->connect(
$this->connectionOptions['host'],
Expand All @@ -81,7 +81,7 @@ public function visitRedisHandler(RedisHandler $handler)

$cache = $this
->isolator()
->new(RedisCache::CLASS);
->new(RedisCache::class);

$cache->setRedis($connection);

Expand Down
6 changes: 3 additions & 3 deletions src/Database/DatabaseDsnParser.php
Expand Up @@ -14,8 +14,8 @@ class DatabaseDsnParser implements ParserInterface

public function __construct()
{
$this->addHandler(new MySqlHandler);
$this->addHandler(new PostgresHandler);
$this->addHandler(new SqliteHandler);
$this->addHandler(new MySqlHandler());
$this->addHandler(new PostgresHandler());
$this->addHandler(new SqliteHandler());
}
}
2 changes: 1 addition & 1 deletion src/ParserTrait.php
Expand Up @@ -14,7 +14,7 @@ trait ParserTrait
public function addHandler(HandlerInterface $handler)
{
if (null === $this->handlers) {
$this->handlers = new SplObjectStorage;
$this->handlers = new SplObjectStorage();
}

$this->handlers->attach($handler);
Expand Down
2 changes: 1 addition & 1 deletion test/suite/Cache/CacheDsnParserTest.php
Expand Up @@ -12,7 +12,7 @@ class CacheDsnParserTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
$this->parser = new CacheDsnParser;
$this->parser = new CacheDsnParser();
}

/**
Expand Down
24 changes: 12 additions & 12 deletions test/suite/Cache/CacheFactoryTest.php
Expand Up @@ -12,18 +12,18 @@ class CacheFactoryTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
$this->connection = Phake::mock(Redis::CLASS);
$this->cache = Phake::mock(RedisCache::CLASS);
$this->isolator = Phake::mock(Isolator::CLASS);
$this->factory = new CacheFactory;
$this->connection = Phake::mock(Redis::class);
$this->cache = Phake::mock(RedisCache::class);
$this->isolator = Phake::mock(Isolator::class);
$this->factory = new CacheFactory();
$this->factory->setIsolator($this->isolator);

Phake::when($this->isolator)
->new(Redis::CLASS)
->new(Redis::class)
->thenReturn($this->connection);

Phake::when($this->isolator)
->new(RedisCache::CLASS)
->new(RedisCache::class)
->thenReturn($this->cache);
}

Expand All @@ -37,9 +37,9 @@ public function testCreateRedis()
$cache = $this->factory->create($dsn);

Phake::inOrder(
Phake::verify($this->isolator)->new(Redis::CLASS),
Phake::verify($this->isolator)->new(Redis::class),
Phake::verify($this->connection)->connect('hostname', 6379),
Phake::verify($this->isolator)->new(RedisCache::CLASS),
Phake::verify($this->isolator)->new(RedisCache::class),
Phake::verify($this->cache)->setRedis($this->connection)
);

Expand All @@ -62,10 +62,10 @@ public function testCreateRedisWithAuth()
$cache = $this->factory->create($dsn);

Phake::inOrder(
Phake::verify($this->isolator)->new(Redis::CLASS),
Phake::verify($this->isolator)->new(Redis::class),
Phake::verify($this->connection)->connect('hostname', 1234),
Phake::verify($this->connection)->auth('password'),
Phake::verify($this->isolator)->new(RedisCache::CLASS),
Phake::verify($this->isolator)->new(RedisCache::class),
Phake::verify($this->cache)->setRedis($this->connection)
);

Expand All @@ -87,10 +87,10 @@ public function testCreateRedisWithNamespace()
$cache = $this->factory->create($dsn, 'my-namespace');

Phake::inOrder(
Phake::verify($this->isolator)->new(Redis::CLASS),
Phake::verify($this->isolator)->new(Redis::class),
Phake::verify($this->connection)->connect('hostname', 6379),
Phake::verify($this->connection)->setOption(Redis::OPT_PREFIX, 'my-namespace:'),
Phake::verify($this->isolator)->new(RedisCache::CLASS),
Phake::verify($this->isolator)->new(RedisCache::class),
Phake::verify($this->cache)->setRedis($this->connection)
);

Expand Down
4 changes: 2 additions & 2 deletions test/suite/Cache/RedisHandlerTest.php
Expand Up @@ -8,8 +8,8 @@ class RedisHandlerTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
$this->visitor = Phake::mock(CacheVisitorInterface::CLASS);
$this->handler = new RedisHandler;
$this->visitor = Phake::mock(CacheVisitorInterface::class);
$this->handler = new RedisHandler();
}

public function testAccept()
Expand Down
2 changes: 1 addition & 1 deletion test/suite/Database/DatabaseDsnParserTest.php
Expand Up @@ -15,7 +15,7 @@ class DatabaseDsnParserTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
$this->parser = new DatabaseDsnParser;
$this->parser = new DatabaseDsnParser();
}

/**
Expand Down
4 changes: 2 additions & 2 deletions test/suite/Database/MySqlHandlerTest.php
Expand Up @@ -8,8 +8,8 @@ class MySqlHandlerTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
$this->visitor = Phake::mock(DatabaseVisitorInterface::CLASS);
$this->handler = new MySqlHandler;
$this->visitor = Phake::mock(DatabaseVisitorInterface::class);
$this->handler = new MySqlHandler();
}

public function testAccept()
Expand Down
4 changes: 2 additions & 2 deletions test/suite/Database/PostgresHandlerTest.php
Expand Up @@ -8,8 +8,8 @@ class PostgresHandlerTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
$this->visitor = Phake::mock(DatabaseVisitorInterface::CLASS);
$this->handler = new PostgresHandler;
$this->visitor = Phake::mock(DatabaseVisitorInterface::class);
$this->handler = new PostgresHandler();
}

public function testAccept()
Expand Down
4 changes: 2 additions & 2 deletions test/suite/Database/SqliteHandlerTest.php
Expand Up @@ -8,8 +8,8 @@ class SqliteHandlerTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
$this->visitor = Phake::mock(DatabaseVisitorInterface::CLASS);
$this->handler = new SqliteHandler;
$this->visitor = Phake::mock(DatabaseVisitorInterface::class);
$this->handler = new SqliteHandler();
}

public function testAccept()
Expand Down
6 changes: 3 additions & 3 deletions test/suite/ParserTraitTest.php
Expand Up @@ -11,8 +11,8 @@ class ParserTraitTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
$this->handler1 = Phake::mock(HandlerInterface::CLASS);
$this->handler2 = Phake::mock(HandlerInterface::CLASS);
$this->handler1 = Phake::mock(HandlerInterface::class);
$this->handler2 = Phake::mock(HandlerInterface::class);

Phake::when($this->handler2)
->supports('<dsn>', Phake::setReference('<data>'))
Expand All @@ -22,7 +22,7 @@ public function setUp()
->parse(Phake::anyParameters())
->thenReturn('<result>');

$this->parser = $this->getObjectForTrait(ParserTrait::CLASS);
$this->parser = $this->getObjectForTrait(ParserTrait::class);
}

public function testParse()
Expand Down

0 comments on commit c0b87fa

Please sign in to comment.