Skip to content

Commit

Permalink
Merge pull request #124 from samsonasik/bump-php74
Browse files Browse the repository at this point in the history
[Step 1 Upgrade] Bump requirement to php 7.4
  • Loading branch information
lisachenko committed Jan 9, 2024
2 parents 1d656fa + 57d0543 commit 1966e14
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
1 change: 0 additions & 1 deletion .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:
- "lowest"
- "highest"
php-version:
- "7.3"
- "7.4"
operating-system:
- "ubuntu-latest"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/vendor/
composer.lock
/.phpunit.result.cache
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
}
},
"require": {
"php": ">=7.3",
"php": ">=7.4",
"nikic/php-parser": "^4.0"
},
"require-dev": {
"phpunit/phpunit": "^7.0"
"phpunit/phpunit": "^8.0"
},
"extra": {
"branch-alias": {
Expand Down
4 changes: 2 additions & 2 deletions tests/ReflectionClassTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ public function testSetStaticPropertyValueMethod()
$defaultProp2Value = $originalRefClass2->getStaticPropertyValue('a');
$ex = null;
try {
$this->assertEquals(M_PI, $parsedRefClass1->getStaticPropertyValue('h'), 'Close to expected value of M_PI', 0.0001);
$this->assertEquals(M_PI, $originalRefClass1->getStaticPropertyValue('h'), 'Close to expected value of M_PI', 0.0001);
$this->assertEqualsWithDelta(M_PI, $parsedRefClass1->getStaticPropertyValue('h'), 0.0001, 'Close to expected value of M_PI');
$this->assertEqualsWithDelta(M_PI, $originalRefClass1->getStaticPropertyValue('h'), 0.0001, 'Close to expected value of M_PI');
$this->assertEquals(
realpath(dirname(__DIR__ . parent::DEFAULT_STUB_FILENAME)),
realpath($parsedRefClass2->getStaticPropertyValue('a')),
Expand Down
6 changes: 3 additions & 3 deletions tests/ReflectionTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function testTypeConvertToDisplayTypeWithNativeType()
} else {
$this->assertEquals('string', $nativeTypeRef->getName());
}
$this->assertNotContains('\\', get_class($nativeTypeRef));
$this->assertStringNotContainsString('\\', get_class($nativeTypeRef));
$this->assertInstanceOf(\ReflectionType::class, $nativeTypeRef);
$this->assertEquals('string', \Go\ParserReflection\ReflectionType::convertToDisplayType($nativeTypeRef));
}
Expand All @@ -64,7 +64,7 @@ public function testTypeConvertToDisplayTypeWithNullableNativeType()
} else {
$this->assertEquals('string', $nativeTypeRef->getName());
}
$this->assertNotContains('\\', get_class($nativeTypeRef));
$this->assertStringNotContainsString('\\', get_class($nativeTypeRef));
$this->assertInstanceOf(\ReflectionType::class, $nativeTypeRef);
$this->assertEquals('string or NULL', \Go\ParserReflection\ReflectionType::convertToDisplayType($nativeTypeRef));
}
Expand All @@ -91,7 +91,7 @@ public function testTypeConvertToDisplayTypeImplicitlyNullable()
} else {
$this->assertEquals('string', $nativeTypeRef->getName());
}
$this->assertNotContains('\\', get_class($nativeTypeRef));
$this->assertStringNotContainsString('\\', get_class($nativeTypeRef));
$this->assertInstanceOf(\ReflectionType::class, $nativeTypeRef);
$this->assertEquals('string or NULL', \Go\ParserReflection\ReflectionType::convertToDisplayType($nativeTypeRef));
}
Expand Down
12 changes: 6 additions & 6 deletions tests/ValueResolver/NodeExpressionResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ public function testResolveConstFetchFromExpressionAsClass()
* Testing passing PhpParser\Node\Expr as class for constant fetch
*
* Evaluating a run-time value like a variable should throw an exception.
*
* @expectedException Go\ParserReflection\ReflectionException
* @expectedExceptionMessage Method Go\ParserReflection\ValueResolver\NodeExpressionResolver::resolveExprVariable() not found trying to resolve class constant
*/
public function testResolveConstFetchFromVariableAsClass()
{
$this->expectException(\Go\ParserReflection\ReflectionException::class);
$this->expectExceptionMessage('Method Go\ParserReflection\ValueResolver\NodeExpressionResolver::resolveExprVariable() not found trying to resolve class constant');

$expressionNodeTree = $this->parser->parse("<?php \$someVariable::FOO;");
$expressionSolver = new NodeExpressionResolver(NULL);
$expressionSolver->process($expressionNodeTree[0]);
Expand All @@ -55,12 +55,12 @@ public function testResolveConstFetchFromVariableAsClass()
* Testing passing non-expression as class for constant fetch
*
* Non-expressions should be invalid.
*
* @expectedException Go\ParserReflection\ReflectionException
* @expectedExceptionMessage Unable to resolve class constant
*/
public function testResolveConstFetchFromNonExprAsClass()
{
$this->expectException(\Go\ParserReflection\ReflectionException::class);
$this->expectExceptionMessage('Unable to resolve class constant');

$expressionNodeTree = $this->parser->parse("<?php ClassNameToReplace::Bar;");
$notAnExpressionNodeTree = $this->parser->parse("<?php if (true) { \$baz = 3; }");
// This should never happen...
Expand Down

0 comments on commit 1966e14

Please sign in to comment.