Skip to content

Commit 3b68e4e

Browse files
committed
Fix 8.3 compat and deprecations
1 parent 6e4a3a5 commit 3b68e4e

File tree

8 files changed

+11
-14
lines changed

8 files changed

+11
-14
lines changed

.github/workflows/php.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
operating-system: [ ubuntu-latest ]
17-
php-versions: [ '8.0', '8.1', '8.2' ]
17+
php-versions: [ '8.0', '8.1', '8.2', '8.3' ]
1818

1919
steps:
2020
- uses: actions/checkout@v4

.phan/config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
// Note that the **only** effect of choosing `'5.6'` is to infer that functions removed in php 7.0 exist.
5353
// (See `backward_compatibility_checks` for additional options)
5454
// Automatically inferred from composer.json requirement for "php" of ">=7.3"
55-
'target_php_version' => null,
55+
'target_php_version' => '8.3',
5656

5757
// If enabled, missing properties will be created when
5858
// they are first seen. If false, we'll report an

bin/static-analysis

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ runCheck "phpcs 'src/'" "vendor/bin/phpcs --warning-severity=0 --standard
5454
runCheck "phpcs 'tests/'" "vendor/bin/phpcs --warning-severity=0 --standard=PSR2 tests/"
5555
runCheck "phpmd 'src/'" "vendor/bin/phpmd src/ text phpmd.xml"
5656
runCheck "phpmd 'tests/'" "vendor/bin/phpmd tests/ text phpmd-tests.xml"
57-
runCheck "phpcpd 'src/'" "vendor/bin/phpcpd --min-lines=7 --min-tokens=30 --fuzzy -v src/"
58-
runCheck "phpcpd 'tests/'" "vendor/bin/phpcpd --min-lines=10 --min-tokens=100 --fuzzy tests/"
5957
runCheck "phan" "PHAN_DISABLE_XDEBUG_WARN=1 vendor/bin/phan --no-progress-bar 2>/dev/null"
6058

6159
echo -e "\n\n\e[0;37;42mStatic analysis completed successfully.\e[0m\n"

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131
"phpunit/phpunit": "^9.0.0",
3232
"squizlabs/php_codesniffer": "^3.0.0",
3333
"phpmd/phpmd": "^2.0.0",
34-
"sebastian/phpcpd": "^6.0.0",
35-
"friendsofphp/php-cs-fixer": "^3.16.0"
34+
"friendsofphp/php-cs-fixer": "^3.69.0"
3635
},
3736
"autoload": {
3837
"psr-4": {

src/Downloader/Downloader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ class Downloader implements DownloaderInterface
3838
* @param int $downloadLimit
3939
*/
4040
public function __construct(
41-
PersistenceHandlerInterface $persistenceHandler = null,
42-
RequestHandlerInterface $requestHandler = null,
41+
?PersistenceHandlerInterface $persistenceHandler = null,
42+
?RequestHandlerInterface $requestHandler = null,
4343
array $postFetchFilters = array(),
4444
int $downloadLimit = 0
4545
) {

src/Filter/Prefetch/RobotsTxtDisallowFilter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class RobotsTxtDisallowFilter implements PreFetchFilterInterface
2727
* @throws ErrorException
2828
* @throws UriSyntaxException
2929
*/
30-
public function __construct(string $seedUrl, string $userAgent = null)
30+
public function __construct(string $seedUrl, ?string $userAgent = null)
3131
{
3232
$this->seedUri = new Uri($seedUrl);
3333
$this->seedUri->normalize();

src/RequestHandler/GuzzleRequestHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class GuzzleRequestHandler implements RequestHandlerInterface
2020
* GuzzleRequestHandler constructor.
2121
* @param Client|null $client
2222
*/
23-
public function __construct(Client $client = null)
23+
public function __construct(?Client $client = null)
2424
{
2525
$this->setClient($client ?: new Client());
2626
}

src/Spider.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ class Spider
3535
*/
3636
public function __construct(
3737
string $seed,
38-
DiscovererSet $discovererSet = null,
39-
QueueManagerInterface $queueManager = null,
40-
DownloaderInterface $downloader = null,
41-
string $spiderId = null
38+
?DiscovererSet $discovererSet = null,
39+
?QueueManagerInterface $queueManager = null,
40+
?DownloaderInterface $downloader = null,
41+
?string $spiderId = null
4242
) {
4343
$this->setSeed($seed);
4444
$this->setSpiderId($spiderId);

0 commit comments

Comments
 (0)