Skip to content

Commit

Permalink
Merge pull request #126 from MaksTech/php8
Browse files Browse the repository at this point in the history
PHP 8 support
  • Loading branch information
mariushoch committed Jul 20, 2021
2 parents 8c265b9 + 9b50c25 commit 16db1b4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ php:
- 7.2
- 7.3
- 7.4
- 8.0

sudo: false

Expand All @@ -12,7 +13,7 @@ install: travis_retry composer install --prefer-source
script: composer ci

after_success:
- if [[ "`phpenv version-name`" != "7.4" ]]; then exit 0; fi
- if [[ "`phpenv version-name`" != "8.0" ]]; then exit 0; fi
- vendor/bin/phpunit --coverage-clover coverage.clover
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"require-dev": {
"phpunit/phpunit": "~8.5.0",
"squizlabs/php_codesniffer": "~3.4.0",
"squizlabs/php_codesniffer": "~3.6.0",
"ockcyp/covers-validator": "~1.0"
},
"autoload": {
Expand Down
5 changes: 4 additions & 1 deletion phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@
</properties>
</rule>

<rule ref="Generic.NamingConventions" />
<rule ref="Generic.NamingConventions">
<exclude name="Generic.NamingConventions.AbstractClassNamePrefix"/>
<exclude name="Generic.NamingConventions.InterfaceNameSuffix"/>
</rule>
<rule ref="Generic.NamingConventions.CamelCapsFunctionName.ScopeNotCamelCaps">
<!-- Exclude test methods like "testGivenInvalidInput_methodThrowsException". -->
<exclude-pattern>tests.unit*Test\.php</exclude-pattern>
Expand Down
2 changes: 1 addition & 1 deletion src/Comparer/ComparableComparer.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
class ComparableComparer implements ValueComparer {

public function valuesAreEqual( $firstValue, $secondValue ): bool {
if ( method_exists( $firstValue, 'equals' ) ) {
if ( $firstValue && method_exists( $firstValue, 'equals' ) ) {
return $firstValue->equals( $secondValue );
}

Expand Down

0 comments on commit 16db1b4

Please sign in to comment.