Skip to content

Commit 9de1cbe

Browse files
authored
Add no-update & no-scripts support to the require command
1 parent ed21510 commit 9de1cbe

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/Commands/RequireCommand.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ final public function __construct(
1515
protected Composer $composer,
1616
protected string $package,
1717
protected bool $dryRun = false,
18-
protected bool $dev = false
18+
protected bool $dev = false,
19+
protected bool $noUpdate = false,
20+
protected bool $noScripts = false,
1921
) {
2022
parent::__construct($composer);
2123
}
@@ -35,6 +37,14 @@ public function arguments(): array
3537
$arguments['--dev'] = true;
3638
}
3739

40+
if ($this->noUpdate) {
41+
$arguments['--no-update'] = true;
42+
}
43+
44+
if ($this->noScripts) {
45+
$arguments['--no-scripts'] = true;
46+
}
47+
3848
$arguments['packages'] = [$this->package];
3949

4050
return $arguments;

0 commit comments

Comments
 (0)