sebastian/version's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
Sebastian/version is a PHP library that provides a smooth mechanism for managing the version number of Git-hosted PHP projects. Through its user-friendly interface and efficient tools, this library allows you to keep track of and manage project versions, making it an essential asset for developers working with PHP projects hosted on Git.
Utilizing sebastian/version in your PHP project is straightforward. Installation is performed via Composer, a tool for dependency management in PHP. You can add the library to your project using the following command:
composer require sebastian/version
For adding this library as a development-time dependency(in case you need this library for running your project's test suite), use:
composer require --dev sebastian/version
After installing the library, an instance of the
SebastianBergmann\Version class can be created by providing two parameters: a
$release version number (or the name of the release series if no release has been made yet), and a
__DIR__) which refers to the source code directory of the project. Then, you can leverage the
asString() method of this class to return the version information:
<?php declare(strict_types=1); use SebastianBergmann\Version; $version = new Version('1.0.0', __DIR__); var_dump($version->asString());
You would need to update the string passed as
$release parameter when new release is prepared.
In terms of documentation for sebastian/version, the most comprehensive resources can be found directly in the associated GitHub repository. The readme file located there provides a detailed overview of the library's purpose, methods, and general usage instruction. No separate official documentation apart from this exists, which implies that the GitHub repository is the definitive source for all related information.