210 Commits (e3d99cac5928d72859fac8300255c9566a26e9d5)

Author SHA1 Message Date
Kunal Mehta 14d1f0f3f6 Move VersionParser::parseLinks() to ArrayLoader::parseLinks()
Working towards #3545.

parseLinks is a wrapper around VersionParser::parseConstraints() that
creates Link objects, and better belongs in ArrayLoader.
9 years ago
Kunal Mehta 0ad9e98a59 Don't use BasePackage::$stabilities in VersionParser
Working towards #3545.

This adds VersionParser::$stabilities, which is an array of the
supported stability levels. This adds a little bit of duplication,
however we were already hardcoding the various stabilities in regular
expressions and functions like parseStability().
9 years ago
Kunal Mehta c5afb8f23a Mark VersionParser::formatVersion() as deprecated
With 1753c275ff, this will be handled nicely.
9 years ago
Kunal Mehta 99dab8aebd Move VersionParser::formatVersion() to BasePackage::getFullPrettyVersion()
Working towards #3545.

formatVersion() does not belong in VersionParser since it depends upon a
Package object, and is creating a more complete pretty formatted
version, not parsing anything.

The new getFullPrettyVersion() method can be seen as an extension to
getPrettyVersion(), and is located in BasePackage as a result.

Callers to VersionParser::formatVersion() were not updated in this
commit to demonstrate that no functionality was changed in this
refactor. They will be updated in a follow up commit.
9 years ago
Jordi Boggiano 6a64041055 CS fixes 9 years ago
Sam Minnee 2cd698874f Include pre-releases in >=2.3.0 comparison. Fixes #4080.
This is a change to the >=2.3.0 comparison. Without this change, such a
comparison will exclude pre-release versions.

The rationale is that this makes the comparison more consistent with
<2.3.0 (which excludes all pre-releases) and ~2.3.0 (which includes
pre-releases).
9 years ago
nevvermind 12c833864c Revert converting `1.0.0` to `^1.0`. 9 years ago
nevvermind 4fd9a3ceee compare against correct format 9 years ago
nevvermind 3032f0a538 Refactor based on code review
- Move the version api getter to the PluginManager And make it such that it can be mocked, but not pollute the public interface. That means "protected" visibility.
- The plugin api version constant should still be used throughout the code.
- Use different fixtures class names
- Use regex possessive quantifiers for performance
- Use full words for readability
9 years ago
nevvermind eb2aa14830 Make plugins have actual constraints instead of fixed versions
Instead of developing plugins against a single, fixed Plugin API version - `"composer-plugin-api": "1.0.0"`, this change will allow plugin developers to use versions like `"composer-plugin-api": "~1.1"` or `"composer-plugin-api": ">=2.1 <3.0"`, aka actual Composer-compatible constraints.

Only the "1.0", "1.0.0" and "1.0.0" Plugin API versions will be regarded as BC versions, and internally converted to "^1.0"; every other declared version string will be kept as it is.

Because of this new constraint flexibility, plugin version mismatches will be skipped, which means those plugin will NOT be registered to the system. Previously, a mismatch triggered a warning, but plugins were still registered.
9 years ago
Rob Bast 46e0a506b9 Added another testcase + fix 9 years ago
Rob Bast a0ca1d4d96 Consider 0 as part of a version 9 years ago
Jordi Boggiano 4ce0adb23c Use the caret operator for all require operations 9 years ago
Jordi Boggiano 43c1caad0d Merge remote-tracking branch 'Seldaek/caret-op-for-semver'
Conflicts:
	tests/Composer/Test/Package/Version/VersionSelectorTest.php
9 years ago
Jordi Boggiano f41c1217f5 Merge pull request #3913 from hannesvdvreken/patch-2
Remove unused variable
9 years ago
Rob Bast 117b7ea033 Fixes #3900 9 years ago
Hannes Van De Vreken b85cb7df82 Remove unused variable 9 years ago
Chris Brand 87b7de4d0a Add the P character to the regex pattern
According to http://php.net/manual/en/function.preg-match.php and some other sources named groups should contain a 'P' character after the '?'

Without this, I receive the following error when running an update:

[ErrorException]
  preg_match(): Compilation failed: unrecognized character after (?< at offset 4

Exception trace:
 () at phar:///var/www/git/smmqa/app/admin/composer.phar/src/Composer/Package/Version/VersionParser.php:181
10 years ago
Jordi Boggiano cd38d1e096 Tweaks to also support 1.0-dev style aliases, refs #3480 10 years ago
Damian Mooyman 7bb85ff21e Support aliases for numeric branches. Fixes #3461 10 years ago
Jordi Boggiano d4523119ea Use caret operator for 0.x releases when guessing versions, fixes #3518 10 years ago
Jordi Boggiano 06e96a78e2 Update ranges for 0.N versions, refs #3518 10 years ago
Jordi Boggiano 9438f3a58f Use better semver ranges for 0.x versions, fixes #3518 10 years ago
Jordi Boggiano 92f4c1fb35 Allow and ignore semver build metadata, fixes #2422 10 years ago
Jordi Boggiano f363f9d370 Add support for caret (^) operator 10 years ago
Jordi Boggiano ebab9db27a Add support for hyphen ranges 10 years ago
Jordi Boggiano 69ef80124f Add support for capital X in 3.X and || for OR 10 years ago
Jordi Boggiano 4c713978e9 Add more tests and validate that there is only one comma 10 years ago
Jordi Boggiano ca168d478b Spaces are now equivalent to comma in constraints and mean AND 10 years ago
Jordi Boggiano 029f709300 Fix parsing stability suffixes in multi constraints, fixes #1732 10 years ago
Jordi Boggiano 94926218e8 CS fixes 10 years ago
Jordi Boggiano e6165e6495 Tweak rules to allow guessing based on branch aliases and avoid greedy constraints on alpha/beta/RC packages, refs #3096 10 years ago
Jordi Boggiano cf75ec7763 Merge remote-tracking branch 'weaverryan/require-version-select' 10 years ago
François Pluchino 6c6a623229 Fix invalid version format 10 years ago
Ryan Weaver 895e62e859 Refactoring selection of the "recommended" version (e.g ~1.2) and adding some tests
This also modifies the behavior slightly (from a recommendation by seldaek) to always
propose the minor version of the recommendation (e.g. ~1.2 instead of ~1.2.1).
10 years ago
Ryan Weaver aea2e901a9 Extracting logic into a new class related to selecting the latest version
Also refactored InitCommand slightly so that you can use this "latest version"
functionality when searching for a package as well.
10 years ago
François Pluchino 8b5c00bff0 Fix phpdoc 10 years ago
Pascal Borreli 2f4df9d459 Fixed typos 11 years ago
Jordi Boggiano 80499bb024 Detect ~> misuse and suggest fix, fixes #2476 11 years ago
Jordi Boggiano 11a0d16ccc CS fixes 11 years ago
Jordi Boggiano f59f443fce CS fixes and one more test for safety, fixes #1855 11 years ago
Jordi Boggiano 533512879e Merge remote-tracking branch 'sminnee/fix-tilde-constraint-stabililty' 11 years ago
Jordi Boggiano 8d0b7f278e CS fixes 11 years ago
Pavel Savinov 831bd844bd Almost PHPDoc problems fixed 11 years ago
Sam Minnee 324ef0f9bb Fixed upper bound of wildcard matches.
Follow-on from 95b4348afa
11 years ago
Sam Minnee 95b4348afa Fixed lower bound of tilde and wildcard matches.
The lower bound of ~1.2 and 1.2.* style version requirements now uses >= 1.2.0.0-dev instead of
> 1.1.9999999.9999999.  This is more straightforward to read, and behaves equivalently.
11 years ago
Sam Minnee be9aae5bab Formatting updates for PSR-2 compliance. 11 years ago
Sam Minnee b25457a8c1 Refactor wildcard matching to use manipulateVersionString 11 years ago
Sam Minnee 34a21516c8 Fix tilde constraints without a stability suffix to work like wildcard constraints.
With this fix, a tilde constraint such as ~3.1 won't match unstable versions of 3.1,
but a wildcard constraint such as 3.1.* would.  This seems like a confusing
inconsistency, and so I have corrected it.
11 years ago
Jordi Boggiano 9d948eb795 Merge branch 'disjunctive' 11 years ago
Jordi Boggiano 0cccafbe81 Add disjunctive multi-constraints with |, refs #643, fixes #1342 11 years ago
Jordi Boggiano e16caa9bd7 Add EmptyConstraint 11 years ago
Shane Auckland c6c521bfae optimizing loops 12 years ago
Jordi Boggiano 97dfbefa72 Add support for arbitrary values for the references in version constraints 12 years ago
Jordi Boggiano 908d2d91da Fix case insensitive matching 12 years ago
Jordi Boggiano cea4c05021 Fix parsing of ~ version constraint with unstable versions, fixes #1476 12 years ago
Jordi Boggiano 514a3cde77 CS fixes 12 years ago
Jordi Boggiano 977fc3241c Clarify exception messages when invalid versions are detected in aliases 12 years ago
Jordi Boggiano dee9bcb9f1 Add --stability and support for package:version and package=version to create-project, fixes #957 12 years ago
Pascal Borreli 83fd3967f0 Fixed PHPDoc 12 years ago
Jordi Boggiano 573e4b2a7c Merge branch 'newrepo' 12 years ago
Jordi Boggiano a59a5c4581 Merge remote-tracking branch 'simensen/sem-version-support' 12 years ago
Jordi Boggiano 44c271a477 Merge remote-tracking branch 'simensen/less-than-dev' 12 years ago
Jordi Boggiano ee0cd07468 CS fixes 12 years ago
Jordi Boggiano beb9a5bd72 Code optimizations: avoid loops in match() 12 years ago
Beau Simensen 081ead1635 Version Parsing: Consider <x.y.z to be <x.y.z-dev
> Consider `<x.y.z` to be `<x.y.z-dev.` Because in 99%
> of the cases that's what the intent is. Could be
> overriden with `<x.y.z-stable`.

- @Seldaek

refs #643
12 years ago
Beau Simensen 96a76eeffc Semantic Version Parsing: ~version
Implemented `~` according to #643 and used the following versions
as a test case as defined by @Seldaek:

 * "~1.2.3.4" = ">=1.2.3.4 <1.2.4.0-dev"
 * "~1.2.3" = ">=1.2.3 <1.3.0-dev"
 * "~1.2" = ">=1.2.0 <2.0.0-dev"
 * "~1" = ">=1.0.0 <2.0.0-dev"

Refs #643
12 years ago
Jordi Boggiano 62bb5b339b Allow parsing of stability modifiers combined with multi-constraints 12 years ago
Jordi Boggiano 0932f65a17 Return 7 chars and not 6 for short git hashes, formatting fixes 12 years ago
Jordi Boggiano 338730b19b Merge remote-tracking branch 'zczapran/issue/1043_wrong_output_for_versions_when_updating' 12 years ago
Jordi Boggiano e01a9c564d Fix parsing of stability for lowercased RC versions 12 years ago
Zbigniew Czapran 8d966547a2 removed overkill function isHash as suggested by @stloyd 12 years ago
Zbigniew Czapran c0c23033d5 simplified if statement 12 years ago
Zbigniew Czapran 730f206cea removed unneccesary PackageMock and trailing whitespaces 12 years ago
Zbigniew Czapran 80c2736021 in VersionParser only truncate the version if hash 12 years ago
Jordi Boggiano 9965f02951 Clean up link creation 12 years ago
Jordi Boggiano fe15c6a827 Make dev version matches preserve the proper case, fixes #935 12 years ago
Jordi Boggiano 198a40fc63 Quote version in output to highlight empty versions 12 years ago
Alexey Prilipko 75d3d57117 Version parser stability regexp update 12 years ago
Jordi Boggiano 6e90c0be51 CS fixes 12 years ago
Jordi Boggiano 4fcc114f97 Merge pull request #808 from palex-fpt/not-equal-operator
Add '<>' operator to Version Parser
12 years ago
Nils Adermann cc7632489d Make problem report messages more readable
Added pretty strings to constraints
12 years ago
Alexey Prilipko e130386612 Add '<>' operator for Version Parser 12 years ago
Nils Adermann 41215a0e47 Require first version of a root package alias, rather than alias
This makes sure that the alias will always be installed, even if it isn't
technically needed.
12 years ago
Jordi Boggiano c440b4594a More PSR-2 goodness 12 years ago
Jordi Boggiano 99513ba52b Adjust output for create project, refs #724 12 years ago
Jordi Boggiano 713309b38c Show exact version being installed in create-project, fixes #724 12 years ago
Jordi Boggiano 1bd4ccbd54 php-cs-fixer magic 12 years ago
Jordi Boggiano c10eb66ac4 Ignore references when parsing dev versions 12 years ago
Jordi Boggiano 453b9a616b Add test for Pool handling and refactor a couple things 12 years ago
Jordi Boggiano ef28f3b067 Basic handling of stability flags 12 years ago
Jordi Boggiano 70a3c68f73 Add package stability 12 years ago
Jordi Boggiano 595182aec0 Add/fix tests 12 years ago
Jordi Boggiano 8654c43c62 Fix version parser regression, fixes #550 12 years ago
Jordi Boggiano f604ca5762 Allow .x in version constraints as alias for .* 12 years ago
Martin Hasoň 736ea800e3 Added isDev method to the VersionParser class 13 years ago
Jordi Boggiano 59d2b1145c Add lock file alias support and a bunch of fixes 13 years ago
Jordi Boggiano 82054f2060 Add aliasing: `foo as bar` will require foo and automatically make it replace the bar version 13 years ago
Jordi Boggiano 3e6176eccf Update version parser to support any branch name 13 years ago
Hugo Hamon 488928b9b5 [Package] removed unused local $key variable from VersionParser::parseConstraints() method. 13 years ago
Per Bernhardt d78548cbf9 Added mercurial's "default" branch as a valid dev version (same as master / trunk). 13 years ago
Jordi Boggiano 22858e81ef Fix .* version constraints parsing to include nonstable versions 13 years ago
Jeremy Mikola be6b748426 Fix reference to invalid branch name variable 13 years ago
Jordi Boggiano e09f6900da Fix up version parsing 13 years ago
Jordi Boggiano 19f89069a4 Add some more version normalization and support for branch names 13 years ago
Jordi Boggiano fda206400a Fix constraint parsing 13 years ago
Jordi Boggiano da6566b343 Minor improvements to VersionParser 13 years ago
Jordi Boggiano 2e10b5c17e Expand normalization feature and adjust tests 13 years ago
Jordi Boggiano f761cfe525 Refactored VersionParser 13 years ago
everzet 9deb10361f second batch of refactoring 13 years ago