Skip to content

Commit

Permalink
Merge pull request #24 from aerni/feature/php8
Browse files Browse the repository at this point in the history
Add PHP 8 compatibility
  • Loading branch information
aerni authored Dec 7, 2020
2 parents dfbaa81 + 4fb18a2 commit 51d3419
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 22 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/php-cs-fixer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ on: [push]

jobs:
style:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
- name: Checkout code
uses: actions/checkout@v1
uses: actions/checkout@v2

- name: Fix style
uses: docker://oskarstark/php-cs-fixer-ga
Expand All @@ -21,9 +21,9 @@ jobs:
id: extract_branch

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v2.3.0
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Fix styling
branch: ${{ steps.extract_branch.outputs.branch }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10 changes: 5 additions & 5 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ jobs:
php_tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
fail-fast: false
matrix:
os: [ubuntu-latest]
php: [7.4]
os: [ubuntu-20.04]
php: [7.4, 8.0]

name: PHP ${{ matrix.php }}

steps:
- name: Checkout code
uses: actions/checkout@v1
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v1
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
Expand Down
2 changes: 1 addition & 1 deletion .php_cs.cache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"php":"7.4.11","version":"2.16.7","indent":" ","lineEnding":"\n","rules":{"blank_line_after_namespace":true,"braces":true,"class_definition":true,"constant_case":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline","keep_multiple_spaces_after_comma":true},"no_break_comment":true,"no_closing_tag":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"visibility_required":true,"encoding":true,"full_opening_tag":true,"array_syntax":{"syntax":"short"},"ordered_imports":{"sortAlgorithm":"alpha"},"no_unused_imports":true,"not_operator_with_successor_space":true,"trailing_comma_in_multiline_array":true,"phpdoc_scalar":true,"unary_operator_spaces":true,"binary_operator_spaces":true,"blank_line_before_statement":{"statements":["break","continue","declare","return","throw","try"]},"phpdoc_single_line_var_spacing":true,"phpdoc_var_without_name":true},"hashes":{"src\/PendingRequest.php":757269890,"src\/SpotifyRequest.php":2602515359,"src\/Providers\/SpotifyClientServiceProvider.php":2689174765,"src\/Providers\/SpotifyServiceProvider.php":2681104612,"src\/SpotifyPathGenerator.php":1277430859,"src\/SpotifySeed.php":1783162979,"src\/Facades\/SpotifySeedFacade.php":468257790,"src\/Facades\/SpotifyClientFacade.php":2866882780,"src\/Facades\/SpotifyFacade.php":178166934,"src\/Exceptions\/ValidatorException.php":524884777,"src\/Exceptions\/SpotifyApiException.php":873075232,"src\/Exceptions\/SpotifyException.php":2705535835,"src\/Exceptions\/SpotifyAuthException.php":2649566835,"src\/CreateRequestAction.php":3037763929,"src\/Spotify.php":978237686,"src\/Normalizer.php":1729135958,"src\/SpotifyAuth.php":1340074250,"src\/Validator.php":2335030103,"src\/Clients\/SpotifyClient.php":998172060,"tests\/TestCase.php":2335776223,"tests\/Unit\/PlaylistsTest.php":2132639121,"tests\/Unit\/SpotifyExceptionTest.php":525193773,"tests\/Unit\/UsersTest.php":2549586760,"tests\/Unit\/TracksTest.php":1886962169,"tests\/Unit\/EpisodesTest.php":1852686008,"tests\/Unit\/ShowsTest.php":2073065307,"tests\/Unit\/ArtistsTest.php":3041136923,"tests\/Unit\/SpotifyRequestTest.php":1729765395,"tests\/Unit\/BrowseTest.php":391728472,"tests\/Unit\/SpotifySeedTest.php":4277656190,"tests\/Unit\/PendingRequestTest.php":518510177,"tests\/Unit\/SpotifyAuthTest.php":2282682399,"tests\/Unit\/SpotifyPathGeneratorTest.php":701986677,"tests\/Unit\/SearchTest.php":4118739454,"tests\/Unit\/AlbumsTest.php":1207862468}}
{"php":"7.4.13","version":"2.16.8","indent":" ","lineEnding":"\n","rules":{"blank_line_after_namespace":true,"braces":true,"class_definition":true,"constant_case":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline","keep_multiple_spaces_after_comma":true},"no_break_comment":true,"no_closing_tag":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"visibility_required":true,"encoding":true,"full_opening_tag":true,"array_syntax":{"syntax":"short"},"ordered_imports":{"sortAlgorithm":"alpha"},"no_unused_imports":true,"not_operator_with_successor_space":true,"trailing_comma_in_multiline_array":true,"phpdoc_scalar":true,"unary_operator_spaces":true,"binary_operator_spaces":true,"blank_line_before_statement":{"statements":["break","continue","declare","return","throw","try"]},"phpdoc_single_line_var_spacing":true,"phpdoc_var_without_name":true},"hashes":{"src\/CreateRequestAction.php":3037763929,"src\/SpotifyRequest.php":2602515359,"src\/Providers\/SpotifyClientServiceProvider.php":2689174765,"src\/Providers\/SpotifyServiceProvider.php":2681104612,"src\/SpotifyAuth.php":1340074250,"src\/SpotifySeed.php":1783162979,"src\/Spotify.php":978237686,"src\/SpotifyPathGenerator.php":1277430859,"src\/Normalizer.php":1729135958,"src\/Clients\/SpotifyClient.php":998172060,"src\/PendingRequest.php":757269890,"src\/Exceptions\/ValidatorException.php":524884777,"src\/Exceptions\/SpotifyAuthException.php":2649566835,"src\/Exceptions\/SpotifyApiException.php":873075232,"src\/Exceptions\/SpotifyException.php":2705535835,"src\/Facades\/SpotifySeedFacade.php":468257790,"src\/Facades\/SpotifyFacade.php":178166934,"src\/Facades\/SpotifyClientFacade.php":2866882780,"src\/Validator.php":2335030103,"tests\/Unit\/ShowsTest.php":2073065307,"tests\/Unit\/PlaylistsTest.php":2132639121,"tests\/Unit\/TracksTest.php":1886962169,"tests\/Unit\/SpotifyRequestTest.php":1729765395,"tests\/Unit\/ArtistsTest.php":3041136923,"tests\/Unit\/AlbumsTest.php":1207862468,"tests\/Unit\/SpotifyAuthTest.php":2282682399,"tests\/Unit\/SearchTest.php":4118739454,"tests\/Unit\/SpotifyPathGeneratorTest.php":701986677,"tests\/Unit\/PendingRequestTest.php":518510177,"tests\/Unit\/UsersTest.php":2549586760,"tests\/Unit\/SpotifySeedTest.php":4277656190,"tests\/Unit\/SpotifyExceptionTest.php":1688040193,"tests\/Unit\/BrowseTest.php":391728472,"tests\/Unit\/EpisodesTest.php":1852686008,"tests\/TestCase.php":2335776223}}
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,11 @@
}
],
"require": {
"php": "^7.4",
"php": "^7.4|^8.0",
"guzzlehttp/guzzle": "^6.5|^7.0",
"illuminate/support": "^7.0|^8.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.16",
"orchestra/testbench": "^5.0|^6.0",
"nunomaduro/collision": "^5.0",
"phpunit/phpunit": "^9.0"
Expand Down
16 changes: 7 additions & 9 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="vendor/autoload.php"
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
Expand All @@ -14,16 +16,12 @@
<testsuite name="Unit">
<directory suffix="Test.php">./tests/Unit</directory>
</testsuite>

<testsuite name="Feature">
<directory suffix="Test.php">./tests/Feature</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
</include>
</coverage>
<php>
<env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF"/>
</php>
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/SpotifyExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function test_can_throw_auth_exception(): void
$auth = new SpotifyAuth('123', '123');

$this->expectException(SpotifyAuthException::class);
$this->expectExceptionMessage('Invalid client');
$this->expectExceptionMessage('invalid_client');

$auth->getAccessToken();
}
Expand Down

0 comments on commit 51d3419

Please sign in to comment.