Skip to content

Commit

Permalink
Add readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mazanax committed Apr 19, 2021
1 parent 82e6234 commit bd396a3
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .travis.yml
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)
30 changes: 30 additions & 0 deletions README.md
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

### &bull; PackageVersion class
```php
<?php

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

### &bull; Version function
```php

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

## License

MIT
17 changes: 17 additions & 0 deletions phpunit.xml.dist
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>

0 comments on commit bd396a3

Please sign in to comment.