einenlum/composer-version-parser

A library to extract the potential higher version of a package from Composer requirements

1.0.1 2023-10-13 16:36 UTC

This package is auto-updated.

Last update: 2024-11-13 20:34:17 UTC


README

This small library allows to parse the version requirements from a composer.json file, allowing to get the probable version of a package (useful when no composer.lock is present).

Examples:

More complex cases are not handled for now.

Install

composer require einenlum/composer-version-parser

Usage

<?php

require_once __DIR__ . '/vendor/autoload.php';

use Einenlum\ComposerVersionParser\Parser;

$parser = new Parser();
$parser->parse('v3.4.*'); // '3.4'