Skip to content

Commit

Permalink
Merge pull request #429 from jolicode/fix/self-update-composer
Browse files Browse the repository at this point in the history
fix(composer): remove self update command from composer when added
  • Loading branch information
lyrixx authored Apr 23, 2024
2 parents d3defb0 + 6116213 commit 02690d2
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/Import/Remote/Composer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use Castor\Import\Exception\RemoteNotAllowed;
use Castor\Import\Mount;
use Castor\Kernel;
use Composer\Console\Application as ComposerApplication;
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
use Symfony\Component\Console\Helper\ProgressIndicator;
Expand Down
27 changes: 27 additions & 0 deletions src/Import/Remote/ComposerApplication.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace Castor\Import\Remote;

use Composer\Command\SelfUpdateCommand;
use Composer\Console\Application as BaseApplication;
use Symfony\Component\DependencyInjection\Attribute\Exclude;

/** @internal */
#[Exclude]
final class ComposerApplication extends BaseApplication
{
protected function getDefaultCommands(): array
{
$commands = [];

foreach (parent::getDefaultCommands() as $command) {
if ($command instanceof SelfUpdateCommand) {
continue;
}

$commands[] = $command;
}

return $commands;
}
}

0 comments on commit 02690d2

Please sign in to comment.