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 composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"composer-runtime-api": "^2.2",
"composer/semver": "^3.4",
"guzzlehttp/guzzle": "^7.10",
"symfony/console": "^7.3",
"symfony/console": "^8.1",
"symfony/polyfill-iconv": "^1.33"
},
"require-dev": {
Expand Down
159 changes: 121 additions & 38 deletions composer.lock

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

Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ cmp stderr stderr.golden

-- stderr.golden --

[ERROR] The "require.php" field is not a valid version constraint: Could not parse version constraint ~>1.0: Invalid
operator "~>", you probably meant to use the "~" operator
[ERROR] The "require.php" field is not a valid version constraint: Could not parse version constraint ~>1.0: Invalid
operator "~>", you probably meant to use the "~" operator

-- composer.json --
{"require":{"php":"~>1.0"}}
2 changes: 1 addition & 1 deletion internal/composer/fail/testdata/unsatisfiable_2.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ cmp stderr stderr.golden

-- stderr.golden --

[ERROR] No PHP versions could satisfy the constraint ">999".
[ERROR] No PHP versions could satisfy the constraint ">999".

-- composer.json --
{"require":{"php":">999"}}
6 changes: 3 additions & 3 deletions internal/composer/misc/testdata/bad_mode.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ cmp stderr stderr.golden

-- stderr.golden --


[ERROR] Invalid --mode "bad". Available modes: [full, minor-only]

The value "bad" is not valid for the "mode" option. Supported values are "full", "minor-only".

composer [--source SOURCE] [--mode MODE] [--] [<path>]

Expand Down
6 changes: 3 additions & 3 deletions internal/composer/misc/testdata/bad_source.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ cmp stderr stderr.golden

-- stderr.golden --


[ERROR] Invalid --source "bad". Available sources: [auto, php.net, offline]

The value "bad" is not valid for the "source" option. Supported values are "auto", "php.net", "offline".

composer [--source SOURCE] [--mode MODE] [--] [<path>]

Expand Down
2 changes: 1 addition & 1 deletion internal/constraint/fail/testdata/ruby.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ cmp stderr stderr.golden

-- stderr.golden --

[ERROR] Could not parse version constraint ~>1.0: Invalid operator "~>", you probably meant to use the "~" operator
[ERROR] Could not parse version constraint ~>1.0: Invalid operator "~>", you probably meant to use the "~" operator

2 changes: 1 addition & 1 deletion internal/constraint/fail/testdata/unsatisfiable_2.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ cmp stderr stderr.golden

-- stderr.golden --

[ERROR] No PHP versions could satisfy the constraint ">999".
[ERROR] No PHP versions could satisfy the constraint ">999".

6 changes: 3 additions & 3 deletions internal/constraint/misc/testdata/bad_mode.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ cmp stderr stderr.golden

-- stderr.golden --


[ERROR] Invalid --mode "bad". Available modes: [full, minor-only]

The value "bad" is not valid for the "mode" option. Supported values are "full", "minor-only".

constraint [--source SOURCE] [--mode MODE] [--] <constraint>

6 changes: 3 additions & 3 deletions internal/constraint/misc/testdata/bad_source.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ cmp stderr stderr.golden

-- stderr.golden --


[ERROR] Invalid --source "bad". Available sources: [auto, php.net, offline]

The value "bad" is not valid for the "source" option. Supported values are "auto", "php.net", "offline".

constraint [--source SOURCE] [--mode MODE] [--] <constraint>

9 changes: 5 additions & 4 deletions src/Console/ComposerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Attribute\Argument;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Attribute\Option;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Style\SymfonyStyle;
use TypistTech\PhpMatrix\Composer;
Expand All @@ -25,10 +26,10 @@ public function __invoke(
Application $application,
#[Argument(description: 'Path to composer.json file.')]
string $path = './composer.json',
#[SourceOption]
string $source = Source::Auto->value,
#[ModeOption]
string $mode = Mode::MinorOnly->value,
#[Option(description: Source::DESCRIPTION)]
Source $source = Source::Auto,
#[Option(description: Mode::DESCRIPTION)]
Mode $mode = Mode::MinorOnly,
): int {
try {
$composer = Composer::fromFile($path);
Expand Down
Loading