Skip to content

Commit

Permalink
Support for PHP 8.0 (#342)
Browse files Browse the repository at this point in the history
* WIP

* parent d785a01
author pascalbaljet <pascal@pascalbaljet.nl> 1606476758 +0100
committer pascalbaljet <pascal@pascalbaljet.nl> 1606478514 +0100

parent d785a01
author pascalbaljet <pascal@pascalbaljet.nl> 1606476758 +0100
committer pascalbaljet <pascal@pascalbaljet.nl> 1606478501 +0100

Update composer.json

Updated to Crawler v5 + Run test server on GA

Fix styling

Update composer.json

Update composer.json

Reversed PHP 7.4 support

* Fix styling

* Update composer.json

* Update composer.json

* Update composer.json

Co-authored-by: pascalbaljet <pascalbaljet@users.noreply.github.com>
  • Loading branch information
pascalbaljet and pascalbaljet authored Nov 27, 2020
1 parent 368703a commit 35d631f
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 42 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,29 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [7.4, 7.3]
laravel: [8.*, 7.*, 6.*, 5.8.*]
php: [8.0, 7.4]
laravel: [8.*]
dependency-version: [prefer-lowest, prefer-stable]
os: [ubuntu-latest]
include:
- laravel: 8.*
testbench: 6.*
- laravel: 7.*
testbench: 5.*
- laravel: 6.*
testbench: 4.*
- laravel: 5.8.*
testbench: 3.8.*
exlude:
- laravel: 8.*
php: 7.2

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}

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

- name: Install and start test server
run: |
cd tests/server
npm install
(node server.js &) || /bin/true
- name: Wait for server bootup
run: sleep 5

- name: Cache dependencies
uses: actions/cache@v1
with:
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.10","version":"2.16.4","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\/SitemapServiceProvider.php":4046326413,"src\/Crawler\/Observer.php":3776578038,"src\/Crawler\/Profile.php":491304014,"src\/Sitemap.php":59941369,"src\/SitemapGenerator.php":551139945,"src\/SitemapIndex.php":2195872423,"src\/Tags\/Tag.php":655113915,"src\/Tags\/Url.php":3654747035,"src\/Tags\/Sitemap.php":291541337,"src\/Tags\/Alternate.php":2677822067,"tests\/UrlTest.php":3228679757,"tests\/CustomCrawlProfile.php":1103021984,"tests\/__snapshots__\/SitemapTest__an_url_with_an_alternate_can_be_added_to_the_sitemap__1.php":2144182188,"tests\/SitemapIndexTest.php":2799885370,"tests\/SitemapGeneratorTest.php":1773786182,"tests\/AlternateTest.php":1318703542,"tests\/CrawlProfileTest.php":1435152950,"tests\/SitemapTest.php":1907794861,"tests\/TestCase.php":2965666986}}
{"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\/Crawler\/Profile.php":1529434799,"src\/Crawler\/Observer.php":2755382592,"src\/SitemapIndex.php":2195872423,"src\/SitemapGenerator.php":2380644183,"src\/SitemapServiceProvider.php":4046326413,"src\/Sitemap.php":59941369,"src\/Tags\/Alternate.php":2677822067,"src\/Tags\/Url.php":3654747035,"src\/Tags\/Tag.php":655113915,"src\/Tags\/Sitemap.php":291541337,"tests\/UrlTest.php":3228679757,"tests\/SitemapGeneratorTest.php":1773786182,"tests\/CustomCrawlProfile.php":3607391448,"tests\/AlternateTest.php":1318703542,"tests\/SitemapTest.php":1907794861,"tests\/SitemapIndexTest.php":2799885370,"tests\/__snapshots__\/SitemapTest__an_url_with_an_alternate_can_be_added_to_the_sitemap__1.php":2144182188,"tests\/CrawlProfileTest.php":641678678,"tests\/TestCase.php":2965666986}}
20 changes: 11 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,18 @@
}
],
"require": {
"php": "^7.2",
"illuminate/support": "~5.8.0|^6.0|^7.0|^8.0",
"nesbot/carbon": "^1.21|^2.0",
"spatie/crawler": "^4.1.0"
"php": "^7.4|^8.0",
"illuminate/support": "^8.0",
"guzzlehttp/guzzle": "^7.2",
"nesbot/carbon": "^2.0",
"spatie/crawler": "^5.0",
"symfony/dom-crawler": "^5.1.14"
},
"require-dev": {
"mockery/mockery": "^1.3.1",
"orchestra/testbench": "~3.8.8|^4.0|^5.0|^6.0",
"phpunit/phpunit": "^8.3|^9.0|^9.3",
"spatie/phpunit-snapshot-assertions": "^3.0.0",
"mockery/mockery": "^1.3.3",
"orchestra/testbench": "^6.0",
"phpunit/phpunit": "^9.3",
"spatie/phpunit-snapshot-assertions": "^4.0",
"spatie/temporary-directory": "^1.1"
},
"autoload": {
Expand Down Expand Up @@ -53,4 +55,4 @@
},
"minimum-stability": "dev",
"prefer-stable": true
}
}
2 changes: 1 addition & 1 deletion src/Crawler/Observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use GuzzleHttp\Exception\RequestException;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\UriInterface;
use Spatie\Crawler\CrawlObserver;
use Spatie\Crawler\CrawlObservers\CrawlObserver;

class Observer extends CrawlObserver
{
Expand Down
2 changes: 1 addition & 1 deletion src/Crawler/Profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Spatie\Sitemap\Crawler;

use Psr\Http\Message\UriInterface;
use Spatie\Crawler\CrawlProfile;
use Spatie\Crawler\CrawlProfiles\CrawlProfile;

class Profile extends CrawlProfile
{
Expand Down
2 changes: 1 addition & 1 deletion src/SitemapGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\UriInterface;
use Spatie\Crawler\Crawler;
use Spatie\Crawler\CrawlProfile;
use Spatie\Crawler\CrawlProfiles\CrawlProfile;
use Spatie\Sitemap\Crawler\Observer;
use Spatie\Sitemap\Crawler\Profile;
use Spatie\Sitemap\Tags\Url;
Expand Down
4 changes: 2 additions & 2 deletions tests/CrawlProfileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace Spatie\Sitemap\Test;

use Spatie\Crawler\Crawler;
use Spatie\Crawler\CrawlInternalUrls;
use Spatie\Crawler\CrawlSubdomains;
use Spatie\Crawler\CrawlProfiles\CrawlInternalUrls;
use Spatie\Crawler\CrawlProfiles\CrawlSubdomains;
use Spatie\Sitemap\Crawler\Profile;
use Spatie\Sitemap\Sitemap;
use Spatie\Sitemap\SitemapGenerator;
Expand Down
2 changes: 1 addition & 1 deletion tests/CustomCrawlProfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Spatie\Sitemap\Test;

use Psr\Http\Message\UriInterface;
use Spatie\Crawler\CrawlProfile;
use Spatie\Crawler\CrawlProfiles\CrawlProfile;

class CustomCrawlProfile extends CrawlProfile
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<?php

return '<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url>
<loc>http://localhost/home</loc>
Expand All @@ -10,4 +8,4 @@
<changefreq>daily</changefreq>
<priority>0.8</priority>
</url>
</urlset>';
</urlset>

This file was deleted.

0 comments on commit 35d631f

Please # to comment.