-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
language: php | ||
php: | ||
- '7.4' | ||
- nightly | ||
|
||
before_script: | ||
- travis_retry composer self-update | ||
- travis_retry composer install --no-interaction --prefer-source --dev | ||
|
||
script: | ||
- vendor/bin/phpunit --coverage-clover=coverage.xml | ||
|
||
after_success: | ||
- bash <(curl -s https://codecov.io/bash) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.4-8892BF.svg?style=flat-square)](https://php.net/) | ||
[![Latest Stable Version](https://poser.pugx.org/mazanax/composer-project-version/v/stable)](https://packagist.org/packages/mazanax/composer-project-versionpaginator) | ||
[![Build Status](https://travis-ci.org/mazanax/paginator.svg?branch=master)](https://travis-ci.org/mazanax/composer-project-version) | ||
[![codecov](https://codecov.io/gh/mazanax/composer-project-version/branch/master/graph/badge.svg)](https://codecov.io/gh/mazanax/composer-project-version) | ||
|
||
# Composer Package Version | ||
Helper function to get a current version from `composer.json` file in your project | ||
|
||
## Installation | ||
`composer require mazanax/composer-project-version` | ||
|
||
## Usage | ||
|
||
### • PackageVersion class | ||
```php | ||
<?php | ||
|
||
$packageVersion = \MZNX\ComposerPackageVersion\PackageVersion::init(__DIR__ . '/path/to/composer.json') | ||
$version = $packageVersion->getVersion(); | ||
``` | ||
|
||
### • Version function | ||
```php | ||
|
||
$packageVersion = \MZNX\ComposerPackageVersion\Version(__DIR__ . '/path/to/composer.json'); | ||
``` | ||
|
||
## License | ||
|
||
MIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"> | ||
<coverage> | ||
<include> | ||
<directory suffix=".php">./src/</directory> | ||
</include> | ||
<report> | ||
<clover outputFile="clover.xml"/> | ||
</report> | ||
</coverage> | ||
<testsuites> | ||
<testsuite name="Unit"> | ||
<directory>./tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
<logging/> | ||
</phpunit> |