Skip to content
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

Upgrade to PHPStan version 2 #301

Merged
merged 4 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ updates:
- dependency-name: "phpunit/phpunit"
update-types: ["version-update:semver-major"]

- dependency-name: "phpstan/phpstan"
update-types: ["version-update:semver-major"]

- package-ecosystem: "github-actions"
directory: "/"
schedule:
Expand Down
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
]
},
"require-dev": {
"phpstan/phpstan": "^1.0",
"phpstan/phpstan": "^2.0",
"phpstan/phpstan-deprecation-rules": "^2.0",
"phpstan/phpstan-phpunit": "^2.0",
"phpunit/phpunit": "^11.0",
"squizlabs/php_codesniffer": "^3.7",
"bizurkur/mockfs": "^0.2.0"
Expand Down
112 changes: 105 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ parameters:
- src
- tests
- vigilant.php

ignoreErrors:
- identifier: includeOnce.fileNotFound
path: src/Config.php
2 changes: 1 addition & 1 deletion src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public function getCacheFormatVersion(): int
private function requireConfigFile(): void
{
if (file_exists('config.php') === true) {
require('config.php');
include_once('config.php');
}
}
}
4 changes: 0 additions & 4 deletions tests/CacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ public function testGetFirstCheck(): void
{
$check = self::$cache->getFirstCheck();

$this->assertIsInt($check);
$this->assertEquals(
self::$fixtureData['first_check'],
$check
Expand Down Expand Up @@ -127,7 +126,6 @@ public function testGetNextCheck(): void
{
$check = self::$cache->getNextCheck();

$this->assertIsInt($check);
$this->assertEquals(
self::$fixtureData['next_check'],
$check
Expand All @@ -141,7 +139,6 @@ public function testGetItems(): void
{
$items = self::$cache->getItems();

$this->assertIsArray($items);
$this->assertEquals(
self::$fixtureData['items'],
$items
Expand All @@ -155,7 +152,6 @@ public function testGetErrorCount(): void
{
$count = self::$cache->getErrorCount();

$this->assertIsInt($count);
$this->assertEquals(
self::$fixtureData['error_count'],
$count
Expand Down
3 changes: 2 additions & 1 deletion tests/CheckTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ public function testIsDue(): void
{
$details = new Details($this->feed);
$check = new check($details, new Fetch(), self::$config, self::$logger);
$this->assertIsBool($check->isDue());

$this->assertTrue($check->isDue());
}

/**
Expand Down
1 change: 0 additions & 1 deletion tests/FeedsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public function testGet(): void

$feeds = new Feeds($config, self::$logger);

$this->assertIsArray($feeds->get());
$this->assertContainsOnlyInstancesOf('Vigilant\Feed\Feed', $feeds->get());
}

Expand Down