76 Commits (6a466a120a404d1c5d492e5ca715841c491517fc)

Author SHA1 Message Date
Jordi Boggiano 6a466a120a
Enable strict types on all files 2 years ago
Jordi Boggiano 6da38f83a0
Add parameter types to all the things 2 years ago
Jordi Boggiano eda9014bef
Add return types to all code which is not being extended by open source packages 2 years ago
Jordi Boggiano abdc6893a6
Add void types where no return statement is present 2 years ago
Jordi Boggiano 86fb8d4412
Fix CS 2 years ago
Jordi Boggiano e30a6b0b9b
Add support for ignoring the upper bound of platform requirements using "name+" notation 2 years ago
Martin Herndl 3013674c92
Refactor ignore platform reqs checks (#10079)
Introduces a `PlatformRequirementFilter` with methods that help to decide if a requirement is ignored or not as discussed in #10045 but without changing behaviour.
3 years ago
Jordi Boggiano 75a8677e8a
Remove unknown Rule type 3 years ago
immeëmosol 50d738eeee
Reaching phpstan level 6 in Composer/DependencyResolver (refs #10159) (#10178) 3 years ago
Jordi Boggiano b209816056
Type annotations 3 years ago
Jordi Boggiano 4bcd860b65
Add more type annotations 3 years ago
Jordi Boggiano 4c9e75c6e5
Fix CS 3 years ago
Jordi Boggiano 4940009f83
Bump phpstan to level 3 (#9734)
Clean up PackageInterface/CompletePackageInterface, add missing methods, type things in solver as BasePackage, added CompleteAliasPackage, ..
3 years ago
Jordi Boggiano d00edab884
Merge pull request #9477 from naderman/fix-alias-conflicts
Explicit conflicts should conflict with aliases of packages too
4 years ago
Nils Adermann 7197278fe9 Always install aliases together with their original package
Restores some Composer 1.x behavior like unbound constraints conflicting
with default branches unless they are branch aliased.

Simplifies conflicts with aliases because packages cannot be installed
without their aliases, so we do not need to know which aliases are
uninstalled in lock file or installed.json.
4 years ago
Jordi Boggiano b7d770659b
CS fixes 4 years ago
Nils Adermann 780e6fc027 Avoid creating unnecessary conflict rules for provide/replace of aliases 4 years ago
Nils Adermann 3764b3007d Explicit conflict rule generation needs to use pool->whatProvides
If relying on packages added by name in the generator aliases will be
skipped.
4 years ago
Nils Adermann 27f200caf1 Create ROOT_ALIAS rules inside package rule generation 4 years ago
Nils Adermann 4215344c93 Rule generator cleanup: no need for 2 added package arrays, more specific root alias rule 4 years ago
Jordi Boggiano b7e1383083
Make sure the alias package gets added to conflict rules etc, and only add it if aliased package is actually added 4 years ago
Jordi Boggiano 7b183956d8
Make sure the root aliases always get installed when a package is updated, fixes #9448 4 years ago
Nils Adermann 74fb313c39 Separate locked packages from fixed packages in request
Locked packages are basically like removable fixed packages, so we still
only load one version, but we do not require their installation unless
something the user needs requires their use. So they automatically get
removed if they are no longer needed on any update.
4 years ago
Yanick Witschi bd6f62c535 Consistently reuse the new PlatformRepository::isPlatformPackage() method 4 years ago
Jordi Boggiano a66a939b76
Merge pull request #8937 from Seldaek/optim-rules
Optimize rule creation for alias packages
4 years ago
Jordi Boggiano 9bd255d8f1
Remove some dead code from RuleSetGenerator 4 years ago
Jordi Boggiano 5a4709c3d6
Optimize rule creation for alias packages
This mainly benefits projects running updates with minimum-stability: dev
4 years ago
Jordi Boggiano 0ea9eafcaf
Add rules for aliased packages when an alias is added, fixes #8902 4 years ago
Jordi Boggiano e85da00dff
Add a way to ignore only some packages in --ignore-platform-reqs, and make the platform check ignore those packages which were ignored as requirements, fixes #8861 4 years ago
Jordi Boggiano 81bf47ffa2
Use fully qualified calls in hot classes 4 years ago
Nils Adermann 80a5fdf398 Remove obsolete rules and their generation
The only automatic conflict we have results from packages using the same name
either by literally having the same name and being different versions or they
replace the same name, so

- removed all types of obsolete rules
- simplified rule generation significantly
- got rid of provide filtering in the pool
- fixed some language in error handling
4 years ago
Nils Adermann 4e3d989978 A package providing a name should not conflict with a package replacing it
Simplified whatProvides, mustMatchName is unused, removed unused
function from policy
4 years ago
Nils Adermann fdfdee03c1 Remove unused argument to pool->match 4 years ago
Nils Adermann 5bdc0fc9c5 Request jobs replaced by root require / fixed package
The only type of request job remaining was "install" which is really a
root requirement. The only other kind of input for the solver is now a
set of fixed packages.

Rules have been updated to account for only two kinds of former job
reason: FIXED or ROOT_REQUIRE. The job property has always been
redundant and has been removed, since reasonData suffices.

Problem reasons are always rules, so the unnecessary wrapping in an
array has been removed.

We now only ever generate a single rule per root require or fixed
package, so there is no need for the solver to special handle disabling
"jobs" anymore, the rule can just be disabled as usual.

For consistency special handling of rules for jobs in problems has been
integrated into the rule class like all other rule reasons. As part of
this change the error message for root requirements has been improved a
bit to make it clearer where the package installation request came from.

The word job has also been removed from operations, which are called
operations, not jobs.
4 years ago
Jordi Boggiano 1d31190472
Keep track of unacceptable fixed packages for later to use in error reporting and make sure the pool state is consistent 4 years ago
Jordi Boggiano c6a3f48eaf
Remove some more remove request handling 4 years ago
Jordi Boggiano 6dc576738a
Avoid partial updates from applying changes to packages which are not locked with an acceptable stability 4 years ago
Nils Adermann dc0f2e7e46 Ensure multi conflict rules are only used for 3+ literals
Implements the equals method correctly on multi conflict rules. If there
are fewer literals a regular Rule2Literals is enough to represent the
basic conflict rule.
5 years ago
Nils Adermann ed300b9f22 New Multi Conflict Rule for transitive conflicts, to reduce memory 5 years ago
Nils Adermann c50d236378 Correctly load branch aliases from lock file
Root aliases are also stored in the lock file, so on install do not read
them from composer.json.
5 years ago
Nils Adermann 4481cc4a88 Allow an install request for a package name which is already fixed
Ensures packages get loaded from locked repo correctly. We may not want
to support this particular use-case at all, but for now it fixes the
existing test, so we may want to revisit this later.
5 years ago
Nils Adermann 995b4f923e Fix more tests which were lacking lock files for partial updates, display fix jobs in problems 5 years ago
Nils Adermann f5e18250e6 Merge remote-tracking branch 'github-composer/2.0' into solve-without-installed
* github-composer/2.0: (48 commits)
  Fix missing use/undefined var
  Split up steps on VCS downloaders to allow doing network operations before touching the filesystem on GitDownloader, fixes #7903
  Fix use statement
  Deduplicate findHeaderValue code
  Add install-path to the installed.json for every package, fixes #2174, closes #2424
  Remove unnecessary config from phpstan
  Make sure the directory exists and will not block installation later when downloading
  Avoid wiping the whole target package if download of the new one fails, refs #7929
  Only empty dir before actually installing packages, fixes #7929
  Improve output when installing packages
  Show best possible version in diagnose command
  Remove extra arg
  Allow path repos to point to their own source dir as install target, resulting in noop, fixes #8254
  Fix use of decodeJson
  Fix update mirrors to also update transport-options, fixes #7672
  Fix updating or URLs to include dist type and shasum, fixes #8216
  Fix origin computation
  Improve handling of non-standard ports for GitLab and GitHub installs, fixes #8173
  Load packages from the lock file for check-platform-reqs if no dependencies have been installed yet, fixes #8058
  Fix error_handler return type declaration
  ...
5 years ago
Jordi Boggiano 6c4357a7ed
Merge branch 'master' into 2.0 5 years ago
Baptiste Lafontaine a4611d511f Ignore platform reqs now handle conflict rules 5 years ago
Nils Adermann 10ada7bf82 Refactor Installer class into separate install and update processes
- Introduce separate Lock and LocalRepo transactions, one for changes
  to the lock file, one for changes to locally installed packages based
  on lock file
- Remove various hacks to keep dev dependencies updated and
  incorporated the functionality into the transaction classes
- Remove installed repo, there are now local repo, locked repo and
  platform repo
- Remove access to local repo from solver, only supply locked packages
- Update can now be run to modify the lock file but not install packages
  to local repo
5 years ago
Jordi Boggiano 2e0f31106a Merge remote-tracking branch 'origin/master' into 2.0 6 years ago
Gabriel Caruso 2a13bb2649 Fixes from PHPStan (#7687)
* fix docblocks

* remove redundant conditional

* fix wrong variable name

* fix wrong namespaces

* add missing private members

* remove unused/redundant arguments

* move testcase class

* exclude TestCase.php

* Tweak RuleWatchGraph type hints

* Tweak doc comment
6 years ago
Nils Adermann 7c2d3518e5 Remove whitelisting of required package names, done by pool builder now 6 years ago
Christophe Coevoet e5b948c683 Refactor the handling of conflict rules in the solver
Conflict rules are not added in the solver based on the packages loaded in the
solver by require rules, instead of loading remote metadata for them. This has
2 benefits:

- it reduces the number of conflict rules in the solver in case of conflict
  rules targetting packages which are not required
- it fixes the behavior of replaces, which is meant to conflict with all
  versions of the replaced package, without introducing a performance
  regression (this behavior was changed when optimizing composer in the past).
6 years ago