Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find a way to avoid @dev || xx constraint for local packages #4

Open
soyuka opened this issue Feb 29, 2024 · 0 comments
Open

Find a way to avoid @dev || xx constraint for local packages #4

soyuka opened this issue Feb 29, 2024 · 0 comments

Comments

@soyuka
Copy link
Owner

soyuka commented Feb 29, 2024

Tried:

        $requires = [];
        $package = $composer->getPackage();
        foreach ($package->getRequires() as $key => $require) {
            if (in_array($require->getTarget(), $packages, true)) {
                $constraint = $require->getConstraint();
                $prettyString = '*@dev || ' . $constraint->getPrettyString();
                $newConstraint = new MultiConstraint([new MatchAllConstraint(), $constraint], false);
                $newConstraint->setPrettyString($prettyString);
                $require = new Link($require->getSource(), $require->getTarget(), $newConstraint, Link::TYPE_REQUIRE, $prettyString);
            }

            $requires[$key] = $require;
        }

        $package->setRequires($requires);

But it doesn't work, it says
20240229_18h24m48s_grim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant