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.113.1 helpers/src/DependabotInstallationManager.php
dependabot-composer-0.113.0 helpers/src/DependabotInstallationManager.php
dependabot-composer-0.112.37 helpers/src/DependabotInstallationManager.php
dependabot-composer-0.112.36 helpers/src/DependabotInstallationManager.php
dependabot-composer-0.112.35 helpers/src/DependabotInstallationManager.php
dependabot-composer-0.112.34 helpers/src/DependabotInstallationManager.php
dependabot-composer-0.112.33 helpers/src/DependabotInstallationManager.php
dependabot-composer-0.112.32 helpers/src/DependabotInstallationManager.php
dependabot-composer-0.112.31 helpers/src/DependabotInstallationManager.php
dependabot-composer-0.112.30 helpers/src/DependabotInstallationManager.php
dependabot-composer-0.112.29 helpers/src/DependabotInstallationManager.php
dependabot-composer-0.112.28 helpers/src/DependabotInstallationManager.php
dependabot-composer-0.112.27 helpers/src/DependabotInstallationManager.php
dependabot-composer-0.112.26 helpers/src/DependabotInstallationManager.php
dependabot-composer-0.112.25 helpers/src/DependabotInstallationManager.php
dependabot-composer-0.112.24 helpers/src/DependabotInstallationManager.php
dependabot-composer-0.112.23 helpers/src/DependabotInstallationManager.php
dependabot-composer-0.112.22 helpers/src/DependabotInstallationManager.php
dependabot-composer-0.112.21 helpers/src/DependabotInstallationManager.php
dependabot-composer-0.112.20 helpers/src/DependabotInstallationManager.php