Skip to content

Commit 17ea336

Browse files
committed
Create OptionsResolver
0 parents  commit 17ea336

File tree

12 files changed

+246
-0
lines changed

12 files changed

+246
-0
lines changed

.circleci/config.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
version: '2.1'
2+
3+
jobs:
4+
composer:
5+
docker:
6+
- image: composer
7+
steps:
8+
- checkout
9+
- restore_cache:
10+
key: composer-{{ checksum "composer.json" }}
11+
- run:
12+
command: |
13+
composer global require hirak/prestissimo;
14+
composer install --no-interaction --no-progress --classmap-authoritative;
15+
- save_cache:
16+
key: composer-{{ checksum "composer.json" }}
17+
paths:
18+
- ./vendor
19+
- persist_to_workspace:
20+
root: .
21+
paths:
22+
- vendor
23+
24+
phpcs:
25+
docker:
26+
- image: steevanb/php-code-sniffs:2.0.10
27+
working_directory: /var/phpcs
28+
steps:
29+
- checkout
30+
- restore_cache:
31+
keys:
32+
- composer-{{ checksum "composer.json" }}
33+
- run:
34+
name: phpcs
35+
command: bin/phpcs
36+
37+
phpstan:
38+
docker:
39+
- image: php:7.3.6-cli-alpine3.10
40+
steps:
41+
- checkout
42+
- restore_cache:
43+
keys:
44+
- composer-{{ checksum "composer.json" }}
45+
- run:
46+
name: phpstan
47+
command: bin/phpstan
48+
49+
phpunit:
50+
docker:
51+
- image: php:7.3.6-cli-alpine3.10
52+
steps:
53+
- checkout
54+
- restore_cache:
55+
keys:
56+
- composer-{{ checksum "composer.json" }}
57+
- run:
58+
name: phpunit
59+
command: bin/phpunit
60+
61+
workflows:
62+
version: '2.1'
63+
Code quality:
64+
jobs:
65+
- phpcs
66+
- composer
67+
- phpstan:
68+
requires:
69+
- composer
70+
- phpunit:
71+
requires:
72+
- composer

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/vendor/
2+
/composer.lock
3+
/.phpunit.result.cache

.scrutinizer.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
build:
2+
environment:
3+
php: 7.2
4+
checks:
5+
php:
6+
code_rating: true
7+
duplication: true

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[![version](https://img.shields.io/badge/version-1.0.0-green.svg)](https://github.com/steevanb/symfony-options-resolver/tree/1.0.0)
2+
[![doctrine](https://img.shields.io/badge/symfony/options_resolver-^2.6||^3.0||^4.0-blue.svg)](https://github.com/symfony/options-resolver)
3+
[![php](https://img.shields.io/badge/php-^7.1-blue.svg)](http://www.php.net)
4+
![Lines](https://img.shields.io/badge/code%20lines-XXXX-green.svg)
5+
![Total Downloads](https://poser.pugx.org/steevanb/symfony-options-resolver/downloads)
6+
[![Scrutinizer](https://scrutinizer-ci.com/g/steevanb/symfony-options-resolver/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/steevanb/symfony-options-resolver/)
7+
8+
### symfony-options-resolver
9+
10+
Add features to Symfony [OptionsResolver](https://github.com/symfony/options-resolver) compoent.
11+
12+
[Changelog](changelog.md)
13+
14+
### Installation
15+
16+
```bash
17+
composer require "steevanb/symfony-options-resolver": "^1.0"
18+
```
19+
20+
### Examples
21+
22+
```php
23+
use steevanb\SymfonyOptionsResolver\OptionsResolver
24+
25+
26+
```

bin/phpcs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env sh
2+
3+
set -e
4+
5+
if [ $(which docker || false) ]; then
6+
docker run \
7+
--rm \
8+
-v $(pwd)/$(dirname $0)/../:/var/phpcs:ro \
9+
--entrypoint "/var/phpcs/bin/phpcs" \
10+
steevanb/php-code-sniffs:2.0.10
11+
else
12+
cd /var/steevanb/php-code-sniffs/vendor/steevanb/php-code-sniffs
13+
../../bin/phpcs \
14+
--standard=ruleset.xml \
15+
--report=steevanb\\PhpCodeSniffs\\Reports\\Steevanb \
16+
--warning-severity=0 \
17+
-s \
18+
--ignore=/var/phpcs/vendor/ \
19+
/var/phpcs
20+
fi

bin/phpstan

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env sh
2+
3+
readonly PROJECT_DIRECTORY=$(realpath $(dirname $(realpath $0))/..)
4+
5+
set -e
6+
7+
if [ $(which docker || false) ]; then
8+
docker run \
9+
--rm \
10+
-v ${PROJECT_DIRECTORY}:/var/phpstan:ro \
11+
-w /var/phpstan \
12+
php:7.3.6-cli-alpine3.10 \
13+
/var/phpstan/bin/phpstan
14+
else
15+
./vendor/bin/phpstan analyse --ansi -c phpstan.neon
16+
fi

bin/phpunit

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env sh
2+
3+
readonly PROJECT_DIRECTORY=$(realpath $(dirname $(realpath $0))/..)
4+
5+
set -e
6+
7+
if [ $(which docker || false) ]; then
8+
docker run \
9+
--rm \
10+
-it \
11+
-v ${PROJECT_DIRECTORY}:/var/www/html \
12+
php:7.2-fpm-alpine3.10 \
13+
bin/phpunit
14+
else
15+
vendor/bin/phpunit tests/
16+
fi

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
### 1.0.0 - 2019-09-27
2+
3+
- Create `steevanb\SymfonyOptionsResolver\OptionsResolver`.
4+
- Add `OptionsResolver::configureOption()`.
5+
- Add `OptionsResolver::configureRequiredOption()`.

composer.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "steevanb/symfony-options-resolver",
3+
"license": "MIT",
4+
"description": "Add features to Symfony OptionsResolver component.",
5+
"autoload": {
6+
"psr-4": {
7+
"steevanb\\SymfonyOptionsResolver\\": "src"
8+
}
9+
},
10+
"autoload-dev": {
11+
"psr-4": {
12+
"steevanb\\SymfonyOptionsResolver\\Tests\\": "tests"
13+
}
14+
},
15+
"require": {
16+
"php": "^7.1.",
17+
"symfony/options-resolver": "^2.6||^3.0||^4.0"
18+
},
19+
"require-dev": {
20+
"phpunit/phpunit": "^8.3",
21+
"phpstan/phpstan": "^0.11"
22+
}
23+
}

phpstan.neon

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
parameters:
2+
level: 5
3+
paths:
4+
- src/
5+
- tests/
6+
ignoreErrors: []

0 commit comments

Comments
 (0)