Skip to content

Commit

Permalink
[RFR] Refresh (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
webda2l authored Mar 19, 2018
1 parent 4345e93 commit 1347f21
Show file tree
Hide file tree
Showing 23 changed files with 316 additions and 266 deletions.
33 changes: 0 additions & 33 deletions .php_cs

This file was deleted.

41 changes: 41 additions & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

$header = <<<'HEADER'
This file is part of the AutoFormBundle package.
(c) David ALLIX <http://a2lix.fr>
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
HEADER;

return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules([
'@DoctrineAnnotation' => true,
'@PHP70Migration:risky' => true,
'@PHP71Migration:risky' => true,
'@PHPUnit60Migration:risky' => true,
'@Symfony' => true,
'@Symfony:risky' => true,
'array_syntax' => ['syntax' => 'short'],
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'general_phpdoc_annotation_remove' => ['param', 'method', 'return', 'inheritdoc'],
'header_comment' => ['header' => $header],
'linebreak_after_opening_tag' => true,
'list_syntax' => ['syntax' => 'short'],
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_class_elements' => true,
'ordered_imports' => true,
'phpdoc_order' => true,
'strict_comparison' => true,
'strict_param' => true,
])
->setFinder(
PhpCsFixer\Finder::create()
->exclude(['vendor'])
->in(['src', 'tests'])
)
;
16 changes: 0 additions & 16 deletions .styleci.yml

This file was deleted.

57 changes: 44 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,56 @@
language: php

sudo: false
dist: trusty

cache:
directories:
- $HOME/.composer/cache
directories:
- $HOME/.composer/cache/files
- $HOME/symfony-bridge/.phpunit

env:
global:
- CHECK_PHP_SYNTAX="false"
- COVERAGE="false"
- PHPUNIT_FLAGS="-v"
- SYMFONY_PHPUNIT_DIR="$HOME/symfony-bridge/.phpunit"

matrix:
include:
- php: hhvm
env: COMPOSER_EXTRA="--prefer-lowest --prefer-stable"
- php: 5.5
env: COMPOSER_EXTRA="--prefer-lowest --prefer-stable"
- php: 5.6
env: COMPOSER_EXTRA="--prefer-lowest --prefer-stable"
- php: 7.0
env: COMPOSER_EXTRA="--prefer-lowest --prefer-stable"
fast_finish: true
include:
# Minimum supported dependencies with the latest and oldest PHP version
- php: 7.1
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak_vendors"
- php: 7.2
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak_vendors"

# Test the latest stable release
- php: 7.1
- php: 7.2
env: CHECK_PHP_SYNTAX="true"

# Latest commit to master
- php: 7.2
env: STABILITY="dev"

allow_failures:
# dev-master is allowed to fail.
- env: STABILITY="dev"

before_install:
- if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi
- if ! [ -z "$STABILITY" ]; then composer config minimum-stability ${STABILITY}; fi;
- if ! [ -v "$DEPENDENCIES" ]; then composer require --no-update ${DEPENDENCIES}; fi;

install:
- composer --prefer-source $COMPOSER_EXTRA update
# To be removed when this issue will be resolved: https://github.com/composer/composer/issues/5355
- if [[ "$COMPOSER_FLAGS" == *"--prefer-lowest"* ]]; then composer update --prefer-dist --no-interaction --prefer-stable --quiet; fi
- composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction
# Force most recent version of PHPUnit
- SYMFONY_PHPUNIT_VERSION=6.5 ./vendor/bin/simple-phpunit install

script:
- vendor/bin/phpunit Tests/
- composer validate --strict --no-check-lock
# Force most recent version of PHPUnit
- SYMFONY_PHPUNIT_VERSION=6.5 ./vendor/bin/simple-phpunit $PHPUNIT_FLAGS
- if [[ "$CHECK_PHP_SYNTAX" == "true" ]]; then php ./vendor/bin/php-cs-fixer fix --no-interaction --dry-run --diff -v; fi;
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2012-2018 David ALLIX

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
35 changes: 29 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,33 @@
A2lixAutoFormBundle
===================
# A2lix Auto Form Bundle

[![Build Status](https://travis-ci.org/a2lix/AutoFormBundle.svg?branch=master)](https://travis-ci.org/a2lix/AutoFormBundle)
[![Latest Stable Version](https://poser.pugx.org/a2lix/auto-form-bundle/v/stable)](https://packagist.org/packages/a2lix/auto-form-bundle) [![Total Downloads](https://poser.pugx.org/a2lix/auto-form-bundle/downloads)](https://packagist.org/packages/a2lix/auto-form-bundle) [![Latest Unstable Version](https://poser.pugx.org/a2lix/auto-form-bundle/v/unstable)](https://packagist.org/packages/a2lix/auto-form-bundle) [![License](https://poser.pugx.org/a2lix/auto-form-bundle/license)](https://packagist.org/packages/a2lix/auto-form-bundle)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/a2lix/AutoFormBundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/a2lix/AutoFormBundle/?branch=master)
Automate form building

[![Latest Stable Version](https://poser.pugx.org/a2lix/auto-form-bundle/v/stable)](https://packagist.org/packages/a2lix/auto-form-bundle)
[![Latest Unstable Version](https://poser.pugx.org/a2lix/auto-form-bundle/v/unstable)](https://packagist.org/packages/a2lix/auto-form-bundle)
[![License](https://poser.pugx.org/a2lix/auto-form-bundle/license)](https://packagist.org/packages/a2lix/auto-form-bundle)
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/c6e68536-570e-409b-99c0-528c3484ada7/mini.png)](https://insight.sensiolabs.com/projects/c6e68536-570e-409b-99c0-528c3484ada7)

[![Total Downloads](https://poser.pugx.org/a2lix/auto-form-bundle/downloads)](https://packagist.org/packages/a2lix/auto-form-bundle)
[![Monthly Downloads](https://poser.pugx.org/a2lix/auto-form-bundle/d/monthly)](https://packagist.org/packages/a2lix/auto-form-bundle)
[![Daily Downloads](https://poser.pugx.org/a2lix/auto-form-bundle/d/daily)](https://packagist.org/packages/a2lix/auto-form-bundle)

Branch | Travis | Coveralls | Scrutinizer
------ | ------ | --------- | ----------- |
master | [![Build Status][travis_unstable_badge]][travis_unstable_link] | [![Coverage Status][coveralls_unstable_badge]][coveralls_unstable_link] | [![Scrutinizer Status][scrutinizer_unstable_badge]][scrutinizer_unstable_link] |

## Documentation

Check out the documentation on the [official website](http://a2lix.fr/bundles/auto-form).

## License

This package is available under the [MIT license](LICENSE).

[travis_unstable_badge]: https://travis-ci.org/a2lix/AutoFormBundle.svg?branch=master
[travis_unstable_link]: https://travis-ci.org/a2lix/AutoFormBundle?branch=master

[coveralls_unstable_badge]: https://coveralls.io/repos/github/a2lix/AutoFormBundle/badge.svg?branch=master
[coveralls_unstable_link]: https://coveralls.io/github/a2lix/AutoFormBundle?branch=master

In progress
[scrutinizer_unstable_badge]: https://scrutinizer-ci.com/g/a2lix/AutoFormBundle/badges/quality-score.png?b=master
[scrutinizer_unstable_link]: https://scrutinizer-ci.com/g/a2lix/AutoFormBundle/?branch=master
33 changes: 20 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,42 @@
{
"name": "a2lix/auto-form-bundle",
"type": "symfony-bundle",
"description": "Automatize form creation",
"keywords": ["symfony2", "form", "field", "automatize", "automatization", "magic"],
"description": "Automate form building",
"keywords": ["symfony", "form", "field", "automate", "automation", "magic", "building"],
"homepage": "https://github.com/a2lix/AutoFormBundle",
"license": "MIT",
"authors": [
{
"name": "David ALLIX",
"homepage": "http://a2lix.fr"
},
{
"name": "Contributors",
"homepage": "https://github.com/a2lix/AutoFormBundle/contributors"
}
],
"require": {
"php": "^5.4 || ^7.0",
"symfony/form": "~2.8|~3.0",
"symfony/doctrine-bridge": "~2.8|~3.0"
"php": "^7.1.3",
"symfony/doctrine-bridge": "~3.4|~4.0",
"symfony/form": "~3.4|~4.0"
},
"require-dev": {
"symfony/validator": "~2.8|~3.0",
"phpunit/phpunit": "~4.1",
"friendsofphp/php-cs-fixer": "~1.10",
"doctrine/orm": "~2.4"
"doctrine/orm": "~2.4",
"friendsofphp/php-cs-fixer": "^2.10",
"symfony/phpunit-bridge": "^4.0",
"symfony/validator": "~3.4|~4.0"
},
"suggest": {
"a2lix/translation-form-bundle": "For translation form"
},
"config": {
"sort-packages": true
},
"autoload": {
"psr-4": { "A2lix\\AutoFormBundle\\": "" },
"exclude-from-classmap": [
"/Tests/"
]
"psr-4": { "A2lix\\AutoFormBundle\\": "src/" }
},
"autoload-dev": {
"psr-4": { "A2lix\\AutoFormBundle\\Tests\\": "tests/" }
},
"extra": {
"branch-alias": {
Expand Down
21 changes: 21 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.1/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
>
<php>
<ini name="error_reporting" value="-1" />
</php>

<testsuites>
<testsuite name="Project Test Suite">
<directory>tests/</directory>
<exclude>tests/fixtures</exclude>
<exclude>tests/tmp</exclude>
</testsuite>
</testsuites>
</phpunit>
9 changes: 4 additions & 5 deletions A2lixAutoFormBundle.php → src/A2lixAutoFormBundle.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<?php

declare(strict_types=1);

/*
* This file is part of A2lix projects.
* This file is part of the AutoFormBundle package.
*
* (c) David ALLIX
* (c) David ALLIX <http://a2lix.fr>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -13,9 +15,6 @@

use Symfony\Component\HttpKernel\Bundle\Bundle;

/**
* @author David ALLIX
*/
class A2lixAutoFormBundle extends Bundle
{
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<?php

declare(strict_types=1);

/*
* This file is part of A2lix projects.
* This file is part of the AutoFormBundle package.
*
* (c) David ALLIX
* (c) David ALLIX <http://a2lix.fr>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -19,16 +21,12 @@

class A2lixAutoFormExtension extends Extension
{
/**
* @param array $configs
* @param ContainerBuilder $container
*/
public function load(array $configs, ContainerBuilder $container)
public function load(array $configs, ContainerBuilder $container): void
{
$processor = new Processor();
$config = $processor->processConfiguration(new Configuration(), $configs);

$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('a2lix_form.xml');
$loader->load('object_info.xml');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<?php

declare(strict_types=1);

/*
* This file is part of A2lix projects.
* This file is part of the AutoFormBundle package.
*
* (c) David ALLIX
* (c) David ALLIX <http://a2lix.fr>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -16,10 +18,7 @@

class Configuration implements ConfigurationInterface
{
/**
* {@inheritdoc}
*/
public function getConfigTreeBuilder()
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('a2lix_auto_form');
Expand Down
Loading

0 comments on commit 1347f21

Please sign in to comment.