getReplaces example

/** * @param array{'require': Link[], 'conflict': Link[]} $pluginDependencies * * @return array{'require': Link[], 'conflict': Link[]} */
    private function validateReplaces(
        PackageInterface $package,
        array $pluginDependencies,
        RequirementExceptionStack $exceptionStack
    ): array {
        foreach ($package->getReplaces() as $replace) {
            $replaceConstraint = $replace->getConstraint();

            if ($replace->getPrettyConstraint() === 'self.version') {
                $replaceConstraint = new Constraint('==', $package->getVersion());
            }

            $pluginDependencies['require'] = $this->checkRequirement(
                $pluginDependencies['require'],
                $replace->getTarget(),
                $replaceConstraint,
                $exceptionStack
            );
Home | Imprint | This part of the site doesn't use cookies.