Skip to content

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 134b4d7 commit b17525c
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 35 deletions.
8 changes: 6 additions & 2 deletions .travis.yml
@@ -1,10 +1,14 @@
language: php

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

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

env:
global:
- ARCHER_PUBLISH_VERSION=5.5
- ARCHER_PUBLISH_VERSION=5.6
- secure: "f86fb/44iMq+Rf9Uz0694qKsbU6Ia2cMj3IF5Qfa7/jefYPyeZU4nGvZ5ihs9nAPHECwQT/F/cf1VBjKtVBXEypF8lJJSoL2b19qlj2Y0sxeuwV1pX5NYN9ifIqpMBR244Z9+h7oS1uMToojrONxF78JNQ6303v66TgfxrHiQIw="

install:
Expand Down
2 changes: 1 addition & 1 deletion src/Evaluator/EvaluationResult.php
Expand Up @@ -17,7 +17,7 @@ class EvaluationResult
public function __construct($isMatch, array $expressionResults)
{
$this->isMatch = $isMatch;
$this->expressionResults = new SplObjectStorage;
$this->expressionResults = new SplObjectStorage();

foreach ($expressionResults as $result) {
$this->expressionResults[$result->expression()] = $result;
Expand Down
4 changes: 2 additions & 2 deletions src/Parser/AbstractParser.php
Expand Up @@ -46,7 +46,7 @@ public function setWildcardString($wildcardString)
public function parse($expression, LexerInterface $lexer = null)
{
if (null === $lexer) {
$lexer = new Lexer;
$lexer = new Lexer();
}

return $this->parseTokens(
Expand All @@ -65,7 +65,7 @@ public function parse($expression, LexerInterface $lexer = null)
public function parseTokens(array $tokens)
{
if (!$tokens) {
return new EmptyExpression;
return new EmptyExpression();
}

$this->tokens = $tokens;
Expand Down
4 changes: 2 additions & 2 deletions src/Parser/ExpressionParser.php
Expand Up @@ -98,11 +98,11 @@ private function parsePattern()
PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY
);

$expression = new Pattern;
$expression = new Pattern();

foreach ($parts as $value) {
if ($this->wildcardString() === $value) {
$expression->add(new PatternWildcard);
$expression->add(new PatternWildcard());
} else {
$expression->add(new PatternLiteral($value));
}
Expand Down
2 changes: 1 addition & 1 deletion test/suite/AST/EmptyExpressionTest.php
Expand Up @@ -8,7 +8,7 @@ class EmptyExpressionTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
$this->expression = new EmptyExpression;
$this->expression = new EmptyExpression();
}

public function testAccept()
Expand Down
2 changes: 1 addition & 1 deletion test/suite/AST/PatternTest.php
Expand Up @@ -9,7 +9,7 @@ class PatternTest extends PHPUnit_Framework_TestCase
public function setUp()
{
$this->child1 = new PatternLiteral('foo');
$this->child2 = new PatternWildcard;
$this->child2 = new PatternWildcard();
$this->child3 = new PatternLiteral('bar');
$this->expression = new Pattern($this->child1, $this->child2);
}
Expand Down
2 changes: 1 addition & 1 deletion test/suite/AST/PatternWildcardTest.php
Expand Up @@ -8,7 +8,7 @@ class PatternWildcardTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
$this->node = new PatternWildcard;
$this->node = new PatternWildcard();
}

public function testAccept()
Expand Down
14 changes: 7 additions & 7 deletions test/suite/Evaluator/EvaluatorTest.php
Expand Up @@ -16,7 +16,7 @@ class EvaluatorTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
$this->evaluator = new Evaluator;
$this->evaluator = new Evaluator();
}

/**
Expand Down Expand Up @@ -62,7 +62,7 @@ public function testEvaluatePatternCaseSensitive()
$this->evaluator = new Evaluator(true);
$expression = new Pattern(
new PatternLiteral('foo'),
new PatternWildcard
new PatternWildcard()
);

$this->assertTrue(
Expand All @@ -86,7 +86,7 @@ public function testEvaluateEmptyExpressionEmptyAsWildcard()

$this->assertTrue(
$this->evaluator->evaluate(
new EmptyExpression,
new EmptyExpression(),
array('foo')
)->isMatch()
);
Expand Down Expand Up @@ -229,7 +229,7 @@ public function testEvaluatePattern()
{
$expression = new Pattern(
new PatternLiteral('foo'),
new PatternWildcard
new PatternWildcard()
);

$result = $this->evaluator->evaluate(
Expand All @@ -249,7 +249,7 @@ public function testEvaluatePattern()

public function testEvaluateEmptyExpression()
{
$expression = new EmptyExpression;
$expression = new EmptyExpression();

$result = $this->evaluator->evaluate(
$expression,
Expand All @@ -270,7 +270,7 @@ public function evaluateTestVectors()
{
return array(
array(
new EmptyExpression,
new EmptyExpression(),
array('foo'),
false,
),
Expand All @@ -292,7 +292,7 @@ public function evaluateTestVectors()
array(
new Pattern(
new PatternLiteral('foo'),
new PatternWildcard
new PatternWildcard()
),
array('foobar'),
true,
Expand Down
10 changes: 5 additions & 5 deletions test/suite/Parser/ExpressionParserTest.php
Expand Up @@ -21,8 +21,8 @@ class ExpressionParserTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
$this->renderer = new ExpressionRenderer;
$this->parser = new ExpressionParser;
$this->renderer = new ExpressionRenderer();
$this->parser = new ExpressionParser();
}

/**
Expand Down Expand Up @@ -65,7 +65,7 @@ public function testParseUsingLogicalOrAsDefaultOperator()

public function testParseWithSourceCapture()
{
$lexer = new Lexer;
$lexer = new Lexer();
$tokens = $lexer->lex('a AND (b OR c) AND NOT p*');
$result = $this->parser->parseTokens($tokens);

Expand Down Expand Up @@ -104,7 +104,7 @@ public function parseTestVectors()
return array(
'empty expression' => array(
'',
new EmptyExpression,
new EmptyExpression(),
),
'single tag' => array(
'a',
Expand All @@ -114,7 +114,7 @@ public function parseTestVectors()
'a*',
new Pattern(
new PatternLiteral('a'),
new PatternWildcard
new PatternWildcard()
),
),
'multiple tags' => array(
Expand Down
2 changes: 1 addition & 1 deletion test/suite/Parser/LexerTest.php
Expand Up @@ -7,7 +7,7 @@ class LexerTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
$this->lexer = new Lexer;
$this->lexer = new Lexer();
}

/**
Expand Down
8 changes: 4 additions & 4 deletions test/suite/Parser/ListParserTest.php
Expand Up @@ -16,8 +16,8 @@ class ListParserTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
$this->renderer = new ExpressionRenderer;
$this->parser = new ListParser;
$this->renderer = new ExpressionRenderer();
$this->parser = new ListParser();
}

/**
Expand Down Expand Up @@ -65,7 +65,7 @@ public function testParseFailureWithWildcardCharacter()

public function testTokens()
{
$lexer = new Lexer;
$lexer = new Lexer();
$tokens = $lexer->lex('a b c');
$result = $this->parser->parseTokens($tokens);

Expand All @@ -92,7 +92,7 @@ public function parseTestVectors()
return array(
'empty expression' => array(
'',
new EmptyExpression,
new EmptyExpression(),
array(),
),
'single tag' => array(
Expand Down
8 changes: 4 additions & 4 deletions test/suite/Renderer/ExpressionRendererTest.php
Expand Up @@ -16,7 +16,7 @@ class ExpressionRendererTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
$this->renderer = new ExpressionRenderer;
$this->renderer = new ExpressionRenderer();
}

/**
Expand Down Expand Up @@ -47,7 +47,7 @@ public function renderTestVectors()
{
return array(
'empty expression' => array(
new EmptyExpression,
new EmptyExpression(),
'NOT *',
),
'tag' => array(
Expand Down Expand Up @@ -77,14 +77,14 @@ public function renderTestVectors()
'pattern' => array(
new Pattern(
new PatternLiteral('foo'),
new PatternWildcard
new PatternWildcard()
),
'foo*',
),
'escaped pattern' => array(
new Pattern(
new PatternLiteral('foo"'),
new PatternWildcard
new PatternWildcard()
),
'"foo\\"*"',
),
Expand Down
8 changes: 4 additions & 4 deletions test/suite/Renderer/TreeRendererTest.php
Expand Up @@ -26,7 +26,7 @@ public function testConstructor()

public function testConstructorDefaults()
{
$this->renderer = new TreeRenderer;
$this->renderer = new TreeRenderer();

$this->assertSame("\n", $this->renderer->endOfLine());
}
Expand All @@ -45,7 +45,7 @@ public function renderTestVectors()
{
return array(
'empty expression' => array(
new EmptyExpression,
new EmptyExpression(),
'EMPTY',
),
'tag' => array(
Expand Down Expand Up @@ -75,7 +75,7 @@ public function renderTestVectors()
'pattern' => array(
new Pattern(
new PatternLiteral('foo'),
new PatternWildcard
new PatternWildcard()
),
'PATTERN' . "\r\n" .
' - LITERAL "foo"' . "\r\n" .
Expand All @@ -84,7 +84,7 @@ public function renderTestVectors()
'escaped pattern' => array(
new Pattern(
new PatternLiteral('foo"'),
new PatternWildcard
new PatternWildcard()
),
'PATTERN' . "\r\n" .
' - LITERAL "foo\\""' . "\r\n" .
Expand Down

0 comments on commit b17525c

Please sign in to comment.