Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/code_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
# see https://github.com/shivammathur/setup-php
- uses: shivammathur/setup-php@v2
with:
php-version: 8.3
php-version: 8.4
coverage: none

# composer install cache - https://github.com/ramsey/composer-install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/downgraded_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
-
uses: "shivammathur/setup-php@v2"
with:
php-version: 8.3
php-version: 8.4
coverage: none

# invoke patches
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
"bin/jack"
],
"require": {
"php": ">=8.3",
"php": ">=8.4",
"composer/semver": "^3.4",
"entropy/entropy": "dev-main",
"nette/utils": "^4.1",
"symfony/process": "^7.4",
"symfony/process": "^8.0",
"webmozart/assert": "^2.0"
},
"require-dev": {
"phpecs/phpecs": "^2.2",
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan": "^2.1",
"phpunit/phpunit": "^12.5",
"phpunit/phpunit": "^13.0",
"rector/rector": "^2.2",
"rector/swiss-knife": "^2.3",
"shipmonk/composer-dependency-analyser": "^1.8",
Expand Down
15 changes: 13 additions & 2 deletions src/Command/BreakPointCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ public function __construct(
/**
* @param bool $dev Focus on dev packages only
* @param int $limit Maximum number of outdated major version packages
* @param int $minDays Minimum number of days a release has to be old to be considered outdated
* @param string[] $ignore Ignore packages by name, e.g. "symfony/" or "symfony/console"
*/
public function run(bool $dev = false, int $limit = 5, array $ignore = []): int
public function run(bool $dev = false, int $limit = 5, int $minDays = 0, array $ignore = []): int
{
$this->outputPrinter->green('Analyzing "composer.json" for major and minor outdated packages');

Expand All @@ -40,16 +41,26 @@ public function run(bool $dev = false, int $limit = 5, array $ignore = []): int
}

$composerJsonFilePath = getcwd() . '/composer.json';
$now = new \DateTimeImmutable();
$outdatedComposer = $this->outdatedComposerFactory->createOutdatedComposer(
array_filter(
$responseJson[ComposerKey::INSTALLED_KEY],
static function (array $package) use ($ignore): bool {
static function (array $package) use ($ignore, $minDays, $now): bool {
foreach ($ignore as $ignoredPackage) {
if (str_contains((string) $package['name'], $ignoredPackage)) {
return false;
}
}

if ($minDays === 0) {
return true;
}

$pageAgeInDays = (new \DateTimeImmutable($package['latest-release-date']))->diff($now)->days;
if ($pageAgeInDays < $minDays) {
return false;
}

return true;
}
),
Expand Down
Loading