Sha256: c5f704cf953fc33cf91ec63b050744e2151ac6271df83462e3775e24a49017c9

Contents?: true

Size: 1.58 KB

Versions: 120

Compression:

Stored size: 1.58 KB

Contents

<?php

declare(strict_types=1);

namespace Dependabot\Composer;

use Composer\DependencyResolver\Operation\InstallOperation;
use Composer\DependencyResolver\Operation\UninstallOperation;
use Composer\DependencyResolver\Operation\UpdateOperation;
use Composer\Installer\InstallationManager;
use Composer\Package\PackageInterface;
use Composer\Repository\RepositoryInterface;

class DependabotInstallationManager extends InstallationManager
{
    private $installed = [];
    private $updated = [];
    private $uninstalled = [];

    public function install(RepositoryInterface $repo, InstallOperation $operation): void
    {
        parent::install($repo, $operation);
        $this->installed[] = $operation->getPackage();
    }

    public function update(RepositoryInterface $repo, UpdateOperation $operation): void
    {
        parent::update($repo, $operation);
        $this->updated[] = [$operation->getInitialPackage(), $operation->getTargetPackage()];
    }

    public function uninstall(RepositoryInterface $repo, UninstallOperation $operation): void
    {
        parent::uninstall($repo, $operation);
        $this->uninstalled[] = $operation->getPackage();
    }

    /**
     * @return PackageInterface[]
     */
    public function getInstalledPackages(): array
    {
        return $this->installed;
    }

    /**
     * @return PackageInterface[]
     */
    public function getUpdatedPackages(): array
    {
        return $this->updated;
    }

    /**
     * @return PackageInterface[]
     */
    public function getUninstalledPackages(): array
    {
        return $this->uninstalled;
    }
}

Version data entries

120 entries across 120 versions & 1 rubygems

Version Path
dependabot-composer-0.118.8 helpers/src/DependabotInstallationManager.php
dependabot-composer-0.118.7 helpers/src/DependabotInstallationManager.php
dependabot-composer-0.118.6 helpers/src/DependabotInstallationManager.php
dependabot-composer-0.118.5 helpers/src/DependabotInstallationManager.php
dependabot-composer-0.118.4 helpers/src/DependabotInstallationManager.php
dependabot-composer-0.118.3 helpers/src/DependabotInstallationManager.php
dependabot-composer-0.118.2 helpers/src/DependabotInstallationManager.php
dependabot-composer-0.118.1 helpers/src/DependabotInstallationManager.php
dependabot-composer-0.118.0 helpers/src/DependabotInstallationManager.php
dependabot-composer-0.117.11 helpers/src/DependabotInstallationManager.php
dependabot-composer-0.117.10 helpers/src/DependabotInstallationManager.php
dependabot-composer-0.117.9 helpers/src/DependabotInstallationManager.php
dependabot-composer-0.117.8 helpers/src/DependabotInstallationManager.php
dependabot-composer-0.117.7 helpers/src/DependabotInstallationManager.php
dependabot-composer-0.117.6 helpers/src/DependabotInstallationManager.php
dependabot-composer-0.117.5 helpers/src/DependabotInstallationManager.php
dependabot-composer-0.117.4 helpers/src/DependabotInstallationManager.php
dependabot-composer-0.117.3 helpers/src/DependabotInstallationManager.php
dependabot-composer-0.117.2 helpers/src/DependabotInstallationManager.php
dependabot-composer-0.117.1 helpers/src/DependabotInstallationManager.php