Skip to content

Commit 77d3e4a

Browse files
committed
fix version constraint
1 parent d9ff74c commit 77d3e4a

File tree

4 files changed

+34
-40
lines changed

4 files changed

+34
-40
lines changed

README.md

Lines changed: 7 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,18 @@
11
# Composer Diff Plugin
22

3+
[![Latest version](https://img.shields.io/packagist/v/ion-bazan/composer-diff.svg)](https://packagist.org/packages/ion-bazan/composer-diff)
4+
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/IonBazan/composer-diff/Tests)](https://github.com/IonBazan/composer-diff/actions)
5+
[![PHP version](https://img.shields.io/packagist/php-v/ion-bazan/composer-diff.svg)](https://packagist.org/packages/ion-bazan/composer-diff)
6+
[![Codecov](https://img.shields.io/codecov/c/gh/IonBazan/composer-diff)](https://codecov.io/gh/IonBazan/composer-diff)
7+
[![Downloads](https://img.shields.io/packagist/dt/ion-bazan/composer-diff.svg)](https://packagist.org/packages/ion-bazan/composer-diff)
8+
[![License](https://img.shields.io/packagist/l/ion-bazan/composer-diff.svg)](https://packagist.org/packages/ion-bazan/composer-diff)
9+
310
Generates packages changes report in Markdown format by comparing `composer.lock` files. Compares with last-commited changes by default.
411

512
![preview](preview.gif)
613

714
## Example output
815

9-
```
10-
| Prod Packages | Base | Target |
11-
|------------------------------------|---------|---------|
12-
| psr/event-dispatcher | New | 1.0.0 |
13-
| symfony/deprecation-contracts | New | v2.1.2 |
14-
| symfony/event-dispatcher | v2.8.52 | v5.1.2 |
15-
| symfony/event-dispatcher-contracts | New | v2.1.2 |
16-
| symfony/polyfill-php80 | New | v1.17.1 |
17-
| php | New | >=5.3 |
18-
19-
| Dev Packages | Base | Target |
20-
|------------------------------------|-------|---------|
21-
| phpunit/php-code-coverage | 8.0.2 | 7.0.10 |
22-
| phpunit/php-file-iterator | 3.0.2 | 2.0.2 |
23-
| phpunit/php-text-template | 2.0.1 | 1.2.1 |
24-
| phpunit/php-timer | 5.0.0 | 2.1.2 |
25-
| phpunit/php-token-stream | 4.0.2 | 3.1.1 |
26-
| phpunit/phpunit | 9.2.5 | 8.5.8 |
27-
| sebastian/code-unit-reverse-lookup | 2.0.1 | 1.0.1 |
28-
| sebastian/comparator | 4.0.2 | 3.0.2 |
29-
| sebastian/diff | 4.0.1 | 3.0.2 |
30-
| sebastian/environment | 5.1.1 | 4.2.3 |
31-
| sebastian/exporter | 4.0.1 | 3.1.2 |
32-
| sebastian/global-state | 4.0.0 | 3.0.0 |
33-
| sebastian/object-enumerator | 4.0.1 | 3.0.3 |
34-
| sebastian/object-reflector | 2.0.1 | 1.1.1 |
35-
| sebastian/recursion-context | 4.0.1 | 3.0.0 |
36-
| sebastian/resource-operations | 3.0.1 | 2.0.1 |
37-
| sebastian/type | 2.1.0 | 1.1.3 |
38-
| sebastian/version | 3.0.0 | 2.0.1 |
39-
| phpunit/php-invoker | 3.0.1 | Removed |
40-
| sebastian/code-unit | 1.0.3 | Removed |
41-
```
42-
43-
## Rendered:
44-
4516
| Prod Packages | Base | Target |
4617
|------------------------------------|---------|---------|
4718
| psr/event-dispatcher | New | 1.0.0 |

composer-diff

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,20 @@ foreach ([__DIR__.'/../../autoload.php', __DIR__.'/../autoload.php', __DIR__.'/v
1111
unset($file);
1212

1313
use IonBazan\ComposerDiff\Command\DiffCommand;
14+
use IonBazan\ComposerDiff\PackageDiff;
1415
use Symfony\Component\Console\Application;
1516

17+
if (!class_exists('Symfony\Component\Console\Application')) {
18+
echo 'Please install symfony/console >= 2.3 to use this binary or use composer diff instead.'.PHP_EOL;
19+
exit(1);
20+
}
21+
22+
if (!class_exists('Composer\Package\CompletePackage')) {
23+
echo 'Please install composer/composer >= 1.1 to use this binary or use composer diff instead.'.PHP_EOL;
24+
exit(1);
25+
}
26+
1627
$application = new Application();
17-
$application->add(new DiffCommand());
18-
$application->setDefaultCommand('diff', true);
28+
$application->add(new DiffCommand(new PackageDiff()));
29+
$application->setDefaultCommand('diff', true);
1930
$application->run();

composer.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,19 @@
2020
}
2121
],
2222
"require": {
23-
"php": "^5.3.2 || ^7.0 || ^8.0",
23+
"php": ">=5.3.2",
2424
"ext-json": "*",
2525
"composer-plugin-api": "^1.1 || ^2.0"
2626
},
2727
"require-dev": {
28-
"composer/composer": "^1.1 || ^2.0",
28+
"composer/composer": "^1.1 || ^2.0@dev",
2929
"symfony/console": "^2.3 || ^3.0 || ^4.0 || ^5.0",
3030
"symfony/phpunit-bridge": "^4.2 || ^5.0"
3131
},
32+
"suggest": {
33+
"composer/composer": "To use the binary without composer runtime",
34+
"symfony/console": "To use the binary without composer runtime"
35+
},
3236
"config": {
3337
"platform": {
3438
"php": "5.3.9"

src/Plugin.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,12 @@ public function getCapabilities()
3232
'Composer\Plugin\Capability\CommandProvider' => 'IonBazan\ComposerDiff\Plugin',
3333
);
3434
}
35+
36+
public function deactivate(Composer $composer, IOInterface $io)
37+
{
38+
}
39+
40+
public function uninstall(Composer $composer, IOInterface $io)
41+
{
42+
}
3543
}

0 commit comments

Comments
 (0)