Skip to content

Commit

Permalink
Documentation + composer dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
dkraczkowski committed Mar 26, 2019
1 parent 223b8a1 commit 98423d7
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
/coverage.clover
/vendor
/composer.lock
.phpunit.result.cache
15 changes: 11 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,29 @@ language: php

sudo: true

env:
global:
- CC_TEST_REPORTER_ID=06e760639839ebb404cc782646f5867ac7da7ce0e0e914978f6988812415f0d3

php:
- 7.2
- 7.3

before_install:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
- composer self-update

install:
- composer update
- composer install --no-interaction --no-progress --no-suggest

script:
- vendor/bin/phpunit
- vendor/bin/phpunit --coverage-clover=clover.xml
- vendor/bin/phpcs --standard=PSR12 --warning-severity=0 src

after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT

cache:
directories:
Expand Down
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,28 @@
# Enum [![Build Status](https://travis-ci.org/fat-code/enum.svg?branch=master)](https://travis-ci.org/fat-code/enum) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/fat-code/enum/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/fat-code/enum/?branch=master) [![Code Coverage](https://scrutinizer-ci.com/g/fat-code/enum/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/fat-code/enum/?branch=master)
# Enum [![Build Status](https://travis-ci.org/fat-code/enum.svg?branch=master)](https://travis-ci.org/fatcode/enum) [![Maintainability](https://api.codeclimate.com/v1/badges/a3ad92200e13a6219750/maintainability)](https://codeclimate.com/github/fatcode/enum/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/a3ad92200e13a6219750/test_coverage)](https://codeclimate.com/github/fatcode/enum/test_coverage)
Enumeration library for connoisseurs.

## Installation
`composer install fatcode/enum`

## Enum declaration
```php
<?php

use FatCode\Enum;

class Colors extends Enum
{
public const RED = 'red';
public const GREEN = 'green';
protected const INVISIBLE_COLOR = 'invisible_color';
}
```

## Enum usage
```php
<?php
// $red is instance of Enum with value 'red'
$red = Colors::RED();
$red->getValue(); // "red"
$red->getKey();// "RED"
```
9 changes: 7 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "fatcode/enum",
"description": "Enumeration library for connoisseurs.",
"version": "dev-master",
"keywords": [
"enum",
"php"
Expand All @@ -16,8 +15,14 @@
"require": {
"php": ">=7.2.0"
},
"scripts": {
"phpunit": "vendor/bin/phpunit --coverage-text",
"phpcs": "vendor/bin/phpcs --standard=PSR12 --warning-severity=0 src",
"phpcsf": "vendor/bin/phpcbf --standard=PSR12 --warning-severity=0 src"
},
"require-dev": {
"phpunit/phpunit": ">=8.0"
"phpunit/phpunit": ">=8.0",
"squizlabs/php_codesniffer": ">=3.0"
},
"autoload": {
"psr-4": {
Expand Down

0 comments on commit 98423d7

Please sign in to comment.