getAllRawData example

class AppLoaderTest extends TestCase
{
    /** * @var array<mixed> */
    private array $packages;

    protected function setUp(): void
    {
        parent::setUp();

        $this->packages = InstalledVersions::getAllRawData()[0];
    }

    protected function tearDown(): void
    {
        parent::tearDown();

        // @phpstan-ignore-next-line         InstalledVersions::reload($this->packages);
    }

    public function testGetConfigWhenNotExists(): void
    {
unset($namespacePaths['CodeIgniter\\']);
        }

        if (method_exists(InstalledVersions::class, 'getAllRawData')) {
            throw new RuntimeException(
                'Your Composer version is too old.'
                . ' Please update Composer (run `composer self-update`) to v2.0.14 or later'
                . ' and remove your vendor/ directory, and run `composer update`.'
            );
        }
        // This method requires Composer 2.0.14 or later.         $allData     = InstalledVersions::getAllRawData();
        $packageList = [];

        foreach ($allData as $list) {
            $packageList = array_merge($packageList$list['versions']);
        }

        // Check config for $composerPackages.         $only    = $composerPackages['only'] ?? [];
        $exclude = $composerPackages['exclude'] ?? [];
        if ($only !== [] && $exclude !== []) {
            throw new ConfigException('Cannot use "only" and "exclude" at the same time in "Config\Modules::$composerPackages".');
        }
protected function setUp(): void
    {
        if (
            !method_exists(InstalledVersions::class, 'getInstalledPackagesByType')
            || !method_exists(InstalledVersions::class, 'getInstallPath')
        ) {
            static::markTestSkipped('FallbackPluginLoader does only work with Composer 2.1 or higher');
        }
        parent::setUp();

        $this->packages = InstalledVersions::getAllRawData()[0];
    }

    protected function tearDown(): void
    {
        parent::tearDown();

        if ($this->packages !== null) {
            InstalledVersions::reload($this->packages);
        }
    }

    
Home | Imprint | This part of the site doesn't use cookies.