-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: Upgrade to PHP ^8.1, add support for Symfony ^7.1 #39
Open
DominicLuidold
wants to merge
7
commits into
fusonic:master
Choose a base branch
from
DominicLuidold:full-upgrade
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
4bbea50
Update supported PHP, Symfony version constraints
DominicLuidold 1a3a5a5
Upgrade to PHPUnit 11.4
DominicLuidold dc9daa7
Install, apply PHP-CS-Fixer and type properties
DominicLuidold ab8f604
Install PHPStan and fix code
DominicLuidold 8e4f9cf
Update version constraints for nyholm/psr7
DominicLuidold d39c0ef
Update documentation
DominicLuidold 9656d1f
Switch to GitHub Actions for testing
DominicLuidold File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
test: | ||
name: Test with PHP ${{ matrix.php-versions }} | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php-versions: [8.1, 8.2, 8.3] # TODO - Add 8.4 once all tools/dependencies support it | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-versions }} | ||
|
||
- name: Install dependencies | ||
uses: ramsey/composer-install@v3 | ||
|
||
- name: Run PHP-CS-Fixer | ||
run: composer phpcs:check | ||
|
||
- name: Run PHPStan | ||
run: composer phpstan | ||
|
||
- name: Run PHPUnit | ||
run: composer test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
.idea/ | ||
composer.lock | ||
vendor/ | ||
|
||
###> friendsofphp/php-cs-fixer ### | ||
/.php-cs-fixer.cache | ||
###< friendsofphp/php-cs-fixer ### | ||
|
||
###> phpunit/phpunit ### | ||
/phpunit.xml | ||
/.phpunit.cache | ||
###< phpunit/phpunit ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
/* | ||
* Copyright (c) Fusonic GmbH. All rights reserved. | ||
* Licensed under the MIT License. See LICENSE file in the project root for license information. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
use PhpCsFixer\Runner\Parallel\ParallelConfigFactory; | ||
|
||
$finder = (new PhpCsFixer\Finder()) | ||
->in(__DIR__); | ||
|
||
return (new PhpCsFixer\Config()) | ||
->setParallelConfig(ParallelConfigFactory::detect()) | ||
->setRules([ | ||
'@PHP81Migration' => true, | ||
'@Symfony' => true, | ||
'@Symfony:risky' => true, | ||
'declare_strict_types' => true, | ||
'header_comment' => [ | ||
'header' => 'Copyright (c) Fusonic GmbH. All rights reserved.'.\PHP_EOL.'Licensed under the MIT License. '. | ||
'See LICENSE file in the project root for license information.', | ||
'location' => 'after_open', | ||
], | ||
'no_useless_else' => true, | ||
'no_useless_return' => true, | ||
'php_unit_strict' => true, | ||
'single_line_throw' => false, | ||
'strict_comparison' => true, | ||
'strict_param' => true, | ||
]) | ||
->setFinder($finder) | ||
->setRiskyAllowed(true); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# CHANGELOG for 3.x | ||
|
||
## 3.0.0 | ||
|
||
- Bumped the required PHP version from `^7.4 || ^8.0` to `^8.1` | ||
- Bumped the compatible Symfony version from `^3.0 || ^4.0 || ^5.0 || ^6.0` to `^5.4 || ^6.4 || ^7.1` | ||
- Upgraded PHPUnit from `^9.0` to `^11.4` and updated tests accordingly | ||
- Added `composer test` script for running tests | ||
- Installed `friendsofphp/php-cs-fixer` and applied Fusonic's code style | ||
- Added `composer phpcs:check` script for validating code style | ||
- Added `composer phpcs:fix` script for fixing code style violations | ||
- Installed `phpstan/phpstan`, `phpstan/phpstan-deprecation-rules`, `phpstan/phpstan-phpunit` and | ||
`phpstan/phpstan-strict-rules` and fixed reported errors | ||
- Added `composer phpstan` script for validating code | ||
- Updated documentation | ||
- Switched to GitHub actions for automated testing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# UPGRADE FROM 2.2 TO 3.0 | ||
|
||
## Requirements | ||
- Bumped the required PHP version from `^7.4 || ^8.0` to `^8.1` | ||
- Bumped the compatible Symfony version from `^3.0 || ^4.0 || ^5.0 || ^6.0` to `^5.4 || ^6.4 || ^7.1` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,25 @@ | ||
<?php | ||
|
||
/* | ||
* Copyright (c) Fusonic GmbH. All rights reserved. | ||
* Licensed under the MIT License. See LICENSE file in the project root for license information. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
use Symfony\Component\HttpClient\NativeHttpClient; | ||
use Symfony\Component\HttpClient\Psr18Client; | ||
|
||
require __DIR__ . "/../vendor/autoload.php"; | ||
require __DIR__.'/../vendor/autoload.php'; | ||
|
||
// Initialize new Psr\HttpClient implementation. This example uses Symfony's implementation from the symfony/http-client | ||
// package but you can use any implementation provided by your framework of choice. | ||
$client = new Psr18Client(new NativeHttpClient([ "headers" => [ "User-Agent" => "facebookexternalhit/1.1" ] ])); | ||
// package, but you can use any implementation provided by your framework of choice. | ||
$client = new Psr18Client(new NativeHttpClient(['headers' => ['User-Agent' => 'facebookexternalhit/1.1']])); | ||
|
||
// Create a new crawler | ||
$crawler = new Fusonic\OpenGraph\Consumer($client, $client); | ||
|
||
// Crawl the desired URL and retrieve a Fusonic\OpenGraph\Object in response | ||
$object = $crawler->loadUrl("https://github.com"); | ||
$object = $crawler->loadUrl('https://github.com'); | ||
|
||
var_dump($object); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add changes from 2.3 as seen in #36