[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-8539":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":14,"stars7d":15,"stars30d":16,"stars90d":14,"forks30d":14,"starsTrendScore":14,"compositeScore":17,"rankGlobal":9,"rankLanguage":9,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":9,"pushedAt":9,"updatedAt":23,"readmeContent":24,"aiSummary":25,"trendingCount":14,"starSnapshotCount":14,"syncStatus":26,"lastSyncTime":27,"discoverSource":28},8539,"semver","composer\u002Fsemver","composer","Semantic versioning utilities with the addition of version constraints parsing and checking.",null,"PHP",3296,76,13,0,1,4,58.56,"MIT License",false,"main",true,[],"2026-06-12 04:00:40","composer\u002Fsemver\n===============\n\nVersion comparison library that offers utilities, version constraint parsing and validation.\n\nIt follows semver (semantic versioning) where possible but is also constrained by\n`version_compare` and backwards compatibility and as such cannot implement semver strictly.\n\nOriginally written as part of [composer\u002Fcomposer](https:\u002F\u002Fgithub.com\u002Fcomposer\u002Fcomposer),\nnow extracted and made available as a stand-alone library.\n\n[![Continuous Integration](https:\u002F\u002Fgithub.com\u002Fcomposer\u002Fsemver\u002Factions\u002Fworkflows\u002Fcontinuous-integration.yml\u002Fbadge.svg?branch=main)](https:\u002F\u002Fgithub.com\u002Fcomposer\u002Fsemver\u002Factions\u002Fworkflows\u002Fcontinuous-integration.yml)\n[![PHP Lint](https:\u002F\u002Fgithub.com\u002Fcomposer\u002Fsemver\u002Factions\u002Fworkflows\u002Flint.yml\u002Fbadge.svg?branch=main)](https:\u002F\u002Fgithub.com\u002Fcomposer\u002Fsemver\u002Factions\u002Fworkflows\u002Flint.yml)\n[![PHPStan](https:\u002F\u002Fgithub.com\u002Fcomposer\u002Fsemver\u002Factions\u002Fworkflows\u002Fphpstan.yml\u002Fbadge.svg?branch=main)](https:\u002F\u002Fgithub.com\u002Fcomposer\u002Fsemver\u002Factions\u002Fworkflows\u002Fphpstan.yml)\n\nInstallation\n------------\n\nInstall the latest version with:\n\n```bash\ncomposer require composer\u002Fsemver\n```\n\n\nRequirements\n------------\n\n* PHP 5.3.2 is required but using the latest version of PHP is highly recommended.\n\n\nVersion Comparison\n------------------\n\nFor details on how versions are compared, refer to the [Versions](https:\u002F\u002Fgetcomposer.org\u002Fdoc\u002Farticles\u002Fversions.md)\narticle in the documentation section of the [getcomposer.org](https:\u002F\u002Fgetcomposer.org) website.\n\n\nBasic usage\n-----------\n\n### Validation \u002F Normalization\n\nThe [`Composer\\Semver\\VersionParser`](https:\u002F\u002Fgithub.com\u002Fcomposer\u002Fsemver\u002Fblob\u002Fmain\u002Fsrc\u002FVersionParser.php)\nclass provides the following methods for parsing, normalizing and validating versions and constraints.\n\nNumeric versions are normalized to a 4 component versions (e.g. `1.2.3` is normalized to `1.2.3.0`)\nfor internal consistency and compatibility with `version_compare`. Normalized versions are used for\nconstraints internally but should not be shown to end users.\n\nFor versions:\n\n* isValid($version)\n* normalize($version, $fullVersion = null)\n* normalizeBranch($name)\n* normalizeDefaultBranch($name)\n\nFor constraints:\n\n* parseConstraints($constraints)\n\nFor stabilities:\n\n* parseStability($version)\n* normalizeStability($stability)\n\n### Comparison\n\nThe [`Composer\\Semver\\Comparator`](https:\u002F\u002Fgithub.com\u002Fcomposer\u002Fsemver\u002Fblob\u002Fmain\u002Fsrc\u002FComparator.php) class provides the following methods for comparing versions:\n\n* greaterThan($v1, $v2)\n* greaterThanOrEqualTo($v1, $v2)\n* lessThan($v1, $v2)\n* lessThanOrEqualTo($v1, $v2)\n* equalTo($v1, $v2)\n* notEqualTo($v1, $v2)\n\nEach function takes two version strings as arguments and returns a boolean. For example:\n\n```php\nuse Composer\\Semver\\Comparator;\n\nComparator::greaterThan('1.25.0', '1.24.0'); \u002F\u002F 1.25.0 > 1.24.0\n```\n\n### Semver\n\nThe [`Composer\\Semver\\Semver`](https:\u002F\u002Fgithub.com\u002Fcomposer\u002Fsemver\u002Fblob\u002Fmain\u002Fsrc\u002FSemver.php) class provides the following methods:\n\n* satisfies($version, $constraints)\n* satisfiedBy(array $versions, $constraint)\n* sort($versions)\n* rsort($versions)\n\n### Intervals\n\nThe [`Composer\\Semver\\Intervals`](https:\u002F\u002Fgithub.com\u002Fcomposer\u002Fsemver\u002Fblob\u002Fmain\u002Fsrc\u002FIntervals.php) static class provides\na few utilities to work with complex constraints or read version intervals from a constraint:\n\n```php\nuse Composer\\Semver\\Intervals;\n\n\u002F\u002F Checks whether $candidate is a subset of $constraint\nIntervals::isSubsetOf(ConstraintInterface $candidate, ConstraintInterface $constraint);\n\n\u002F\u002F Checks whether $a and $b have any intersection, equivalent to $a->matches($b)\nIntervals::haveIntersections(ConstraintInterface $a, ConstraintInterface $b);\n\n\u002F\u002F Optimizes a complex multi constraint by merging all intervals down to the smallest\n\u002F\u002F possible multi constraint. The drawbacks are this is not very fast, and the resulting\n\u002F\u002F multi constraint will have no human readable prettyConstraint configured on it\nIntervals::compactConstraint(ConstraintInterface $constraint);\n\n\u002F\u002F Creates an array of numeric intervals and branch constraints representing a given constraint\nIntervals::get(ConstraintInterface $constraint);\n\n\u002F\u002F Clears the memoization cache when you are done processing constraints\nIntervals::clear()\n```\n\nSee the class docblocks for more details.\n\n\nLicense\n-------\n\ncomposer\u002Fsemver is licensed under the MIT License, see the LICENSE file for details.\n","composer\u002Fsemver 是一个用于处理语义化版本的 PHP 库，提供了版本比较、约束解析和验证等功能。该项目遵循语义化版本规范，并且支持版本约束的解析与校验，同时兼容 PHP 的 `version_compare` 函数以确保向后兼容性。它最初是 Composer 项目的一部分，现在被独立出来作为一个单独的库使用。适用于需要进行软件包版本管理及依赖关系处理的场景，如构建系统、持续集成环境或任何涉及版本控制的应用程序中。通过 Composer 可轻松安装此库，要求最低 PHP 版本为 5.3.2，但建议使用最新版 PHP 以获得最佳体验。",2,"2026-06-11 03:18:32","top_language"]