mazanax/composer-project-version

Small helper to get current composer project version

1.0.1 2021-04-20 09:06 UTC

This package is auto-updated.

Last update: 2024-10-20 17:14:43 UTC


README

Minimum PHP Version Latest Stable Version Build Status codecov

Composer Package Version

Helper function to get a current version from composer.json file in your project

If you want to get separate values of major/minor/patch version, you can try mazanax/composer-version-semver

Installation

composer require mazanax/composer-project-version

Usage

• PackageVersion class

<?php

$packageVersion = \MZNX\ComposerPackageVersion\PackageVersion::init(__DIR__ . '/path/to/composer.json');
$version = $packageVersion->getVersion();

• Version function

$packageVersion = \MZNX\ComposerPackageVersion\Version(__DIR__ . '/path/to/composer.json');

License

MIT