Skip to content
This repository was archived by the owner on Apr 30, 2019. It is now read-only.

Commit 03c1a3d

Browse files
committed
feature #5 Update for SF 4 compat (ogizanagi)
This PR was merged into the 1.0.x-dev branch. Discussion ---------- Update for SF 4 compat Commits ------- 6909d0b Sf 4 compat & minor tweaks
2 parents 5895159 + 6909d0b commit 03c1a3d

32 files changed

+106
-67
lines changed

.php_cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,23 @@
33
$header = <<<'EOF'
44
This file is part of the "elao/form-simple-object-mapper" package.
55
6-
Copyright (C) 2016 Elao
6+
Copyright (C) Elao
77
88
@author Elao <contact@elao.com>
99
EOF;
1010

1111
$finder = PhpCsFixer\Finder::create()
1212
->in(__DIR__)
13-
->exclude(__DIR__ . '/tests/Fixtures/Integration/Symfony/app/cache')
13+
->exclude('tests/Fixtures/Integration/Symfony/app/cache')
1414
;
1515

1616
return PhpCsFixer\Config::create()
17+
->setRiskyAllowed(true)
1718
->setUsingCache(true)
1819
->setFinder($finder)
1920
->setRules([
2021
'@Symfony' => true,
22+
'php_unit_namespaced' => true,
2123
'psr0' => false,
2224
'concat_space' => ['spacing' => 'one'],
2325
'phpdoc_summary' => false,
@@ -27,5 +29,6 @@ return PhpCsFixer\Config::create()
2729
'ordered_imports' => true,
2830
'simplified_null_return' => false,
2931
'header_comment' => ['header' => $header],
32+
'yoda_style' => null,
3033
])
3134
;

.travis.yml

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,49 @@ env:
1010
- CHECK_PHP_SYNTAX="no"
1111
- ENABLE_CODE_COVERAGE="no"
1212
- COMPOSER_FLAGS=""
13+
- SYMFONY_VERSION=""
1314

1415
matrix:
1516
fast_finish: true
1617
include:
18+
# coverage
19+
- php: 7.2
20+
env: ENABLE_CODE_COVERAGE="yes"
21+
22+
# oldest supported versions
1723
- php: 5.6
1824
env: COMPOSER_FLAGS="--prefer-lowest"
19-
- php: 7.0
20-
env: ENABLE_CODE_COVERAGE="yes"
25+
26+
# common versions
2127
- php: 7.1
22-
env: CHECK_PHP_SYNTAX="yes"
28+
env:
29+
- SYMFONY_VERSION="3.4.*"
30+
- CHECK_CODE_STYLE="yes"
31+
- php: 7.2
32+
env: SYMFONY_VERSION="4.0.*"
33+
34+
# bleeding edge (unreleased dev versions where failures are allowed)
35+
- php: nightly
36+
env: SYMFONY_VERSION="4.1.*"
37+
allow_failures:
38+
- php: nightly
2339

2440
cache:
2541
directories:
2642
- $HOME/.composer/cache
2743

2844
before_install:
29-
- if [[ "$ENABLE_CODE_COVERAGE" != "yes" ]]; then phpenv config-rm xdebug.ini || true; fi;
45+
- if [[ "$ENABLE_CODE_COVERAGE" != "yes" ]]; then phpenv config-rm xdebug.ini || true; fi;
46+
- if [[ "$SYMFONY_VERSION" != "" ]]; then composer require "symfony/symfony:${SYMFONY_VERSION}" --no-update; fi;
47+
- if [[ "$CHECK_CODE_STYLE" != "yes" ]]; then composer remove "friendsofphp/php-cs-fixer" --no-update --no-interaction --dev; fi;
3048

3149
install:
32-
- composer update --prefer-dist --no-interaction --optimize-autoloader --prefer-stable --no-progress $COMPOSER_FLAGS
33-
- if [[ "$ENABLE_CODE_COVERAGE" == "yes" ]]; then composer require --dev satooshi/php-coveralls; fi
50+
- composer update --prefer-dist --no-interaction --optimize-autoloader --prefer-stable --no-progress $COMPOSER_FLAGS
51+
- if [[ "$ENABLE_CODE_COVERAGE" == "yes" ]]; then composer require --dev satooshi/php-coveralls; fi;
3452

3553
script:
36-
- if [[ "$ENABLE_CODE_COVERAGE" == "yes" ]]; then vendor/bin/phpunit --coverage-text --coverage-clover build/logs/clover.xml; else vendor/bin/phpunit; fi;
37-
- if [[ "$CHECK_PHP_SYNTAX" == "yes" ]]; then vendor/bin/php-cs-fixer fix --config=.php_cs --dry-run --no-interaction --diff --path-mode=intersection; fi;
54+
- if [[ "$ENABLE_CODE_COVERAGE" == "yes" ]]; then vendor/bin/simple-phpunit --coverage-text --coverage-clover build/logs/clover.xml; else vendor/bin/simple-phpunit; fi;
55+
- if [[ "$CHECK_CODE_STYLE" == "yes" ]]; then PHP_CS_FIXER_FUTURE_MODE=1 vendor/bin/php-cs-fixer fix --config=.php_cs --dry-run --no-interaction --diff; fi;
3856

3957
after_success:
40-
- if [[ "$ENABLE_CODE_COVERAGE" == "yes" ]]; then php vendor/bin/coveralls -v; fi;
58+
- if [[ "$ENABLE_CODE_COVERAGE" == "yes" ]]; then php vendor/bin/coveralls -v; fi;

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@ Symfony Form Simple Object Mapper
44
[![Latest Stable Version](https://poser.pugx.org/elao/form-simple-object-mapper/v/stable?format=flat-square)](https://packagist.org/packages/elao/form-simple-object-mapper)
55
[![Total Downloads](https://poser.pugx.org/elao/form-simple-object-mapper/downloads?format=flat-square)](https://packagist.org/packages/elao/form-simple-object-mapper)
66
[![Monthly Downloads](https://poser.pugx.org/elao/form-simple-object-mapper/d/monthly?format=flat-square)](https://packagist.org/packages/elao/form-simple-object-mapper)
7-
[![Latest Unstable Version](https://poser.pugx.org/elao/form-simple-object-mapper/v/unstable?format=flat-square)](https://packagist.org/packages/elao/form-simple-object-mapper)
8-
[![License](https://poser.pugx.org/elao/form-simple-object-mapper/license?format=flat-square)](https://packagist.org/packages/elao/form-simple-object-mapper)
97
[![Build Status](https://img.shields.io/travis/Elao/FormSimpleObjectMapper/master.svg?style=flat-square)](https://travis-ci.org/Elao/FormSimpleObjectMapper)
108
[![Coveralls](https://img.shields.io/coveralls/Elao/FormSimpleObjectMapper.svg?style=flat-square)](https://coveralls.io/github/Elao/FormSimpleObjectMapper)
119
[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/Elao/FormSimpleObjectMapper.svg?style=flat-square)](https://scrutinizer-ci.com/g/Elao/FormSimpleObjectMapper/?branch=master)
12-
[![Symfony](https://img.shields.io/badge/Symfony-%202.8%2F3.1%2B-green.svg?style=flat-square "Available for Symfony 2.8 and 3.1+")](https://symfony.com)
10+
[![Symfony](https://img.shields.io/badge/Symfony-%202.8%2F3.4%2F4.0%2B-green.svg?style=flat-square "Available for Symfony 2.8, 3.4 and 4.0+")](https://symfony.com)
1311
[![php](https://img.shields.io/badge/PHP-7-green.svg?style=flat-square "Available for PHP 7+")](http://php.net/)
1412

1513
This library aims to ease immutable or value objects mapping with the Symfony Form component, based on [Bernhard Schussek (Webmozart)](https://github.com/webmozart)'s blog post: ["Value Objects in Symfony Forms"](https://webmozart.io/blog/2015/09/09/value-objects-in-symfony-forms/), until a decision on https://github.com/symfony/symfony/pull/19367 is made.

composer.json

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,33 @@
2525
},
2626
"prefer-stable": true,
2727
"minimum-stability": "dev",
28+
"config": {
29+
"sort-packages": true
30+
},
2831
"require": {
2932
"php": ">=5.6",
30-
"symfony/form": "^2.8|^3.1"
33+
"symfony/form": "^2.8|^3.1|^4.0"
3134
},
3235
"require-dev": {
33-
"friendsofphp/php-cs-fixer": "^2.0",
34-
"phpunit/phpunit": "^5.6",
35-
"symfony/browser-kit": "^2.8|^3.1",
36-
"symfony/css-selector": "^2.8|^3.1",
37-
"symfony/dom-crawler": "^2.8|^3.1",
38-
"symfony/filesystem": "^2.8|^3.1",
39-
"symfony/framework-bundle": "^2.8|^3.1",
40-
"symfony/http-foundation": "^2.8|^3.1",
41-
"symfony/phpunit-bridge": "^2.8|^3.1",
42-
"symfony/twig-bundle": "^2.8|^3.1",
43-
"symfony/validator": "^2.8|^3.1",
44-
"symfony/var-dumper": "^2.8.11|^3.1",
45-
"symfony/templating": "^2.8|^3.1"
36+
"friendsofphp/php-cs-fixer": "^2.8",
37+
"phpspec/prophecy": "~1.0",
38+
"symfony/browser-kit": "^2.8|^3.4|^4.0",
39+
"symfony/css-selector": "^2.8|^3.4|^4.0",
40+
"symfony/dom-crawler": "^2.8|^3.4|^4.0",
41+
"symfony/finder": "^2.8.11|^3.4|^4.0",
42+
"symfony/filesystem": "^2.8|^3.4|^4.0",
43+
"symfony/framework-bundle": "^2.8|^3.4|^4.0",
44+
"symfony/http-foundation": "^2.8|^3.4|^4.0",
45+
"symfony/phpunit-bridge": "^3.4|^4.0",
46+
"symfony/templating": "^2.8|^3.4|^4.0",
47+
"symfony/twig-bundle": "^2.8|^3.4|^4.0",
48+
"symfony/validator": "^2.8|^3.4|^4.0",
49+
"symfony/var-dumper": "^2.8.11|^3.4|^4.0",
50+
"symfony/yaml": "^2.8.11|^3.4|^4.0"
4651
},
4752
"extra": {
4853
"branch-alias": {
49-
"dev-master": "1.0.x-dev"
54+
"dev-master": "1.1.x-dev"
5055
}
5156
}
5257
}

phpunit.xml.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
>
1414
<php>
1515
<server name="KERNEL_DIR" value="tests/Fixtures/Integration/Symfony/app/" />
16+
<server name="KERNEL_CLASS" value="AppKernel" />
1617
</php>
1718
<testsuites>
1819
<testsuite name="Elao Symfony Form Simple Object Mapper Test Suite">

src/Bridge/Symfony/Bundle/ElaoFormSimpleObjectMapperBundle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the "elao/form-simple-object-mapper" package.
55
*
6-
* Copyright (C) 2016 Elao
6+
* Copyright (C) Elao
77
*
88
* @author Elao <contact@elao.com>
99
*/

src/DataMapper/CallbackFormDataToObjectConverter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the "elao/form-simple-object-mapper" package.
55
*
6-
* Copyright (C) 2016 Elao
6+
* Copyright (C) Elao
77
*
88
* @author Elao <contact@elao.com>
99
*/

src/DataMapper/FormDataToObjectConverterInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the "elao/form-simple-object-mapper" package.
55
*
6-
* Copyright (C) 2016 Elao
6+
* Copyright (C) Elao
77
*
88
* @author Elao <contact@elao.com>
99
*/

src/DataMapper/ObjectToFormDataConverterInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the "elao/form-simple-object-mapper" package.
55
*
6-
* Copyright (C) 2016 Elao
6+
* Copyright (C) Elao
77
*
88
* @author Elao <contact@elao.com>
99
*/

src/DataMapper/SimpleObjectMapper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the "elao/form-simple-object-mapper" package.
55
*
6-
* Copyright (C) 2016 Elao
6+
* Copyright (C) Elao
77
*
88
* @author Elao <contact@elao.com>
99
*/

src/Type/Extension/SimpleObjectMapperTypeExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the "elao/form-simple-object-mapper" package.
55
*
6-
* Copyright (C) 2016 Elao
6+
* Copyright (C) Elao
77
*
88
* @author Elao <contact@elao.com>
99
*/

tests/Fixtures/Integration/Symfony/Acme/Command/AddItemToCartCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the "elao/form-simple-object-mapper" package.
55
*
6-
* Copyright (C) 2016 Elao
6+
* Copyright (C) Elao
77
*
88
* @author Elao <contact@elao.com>
99
*/

tests/Fixtures/Integration/Symfony/TestBundle/Controller/CartController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the "elao/form-simple-object-mapper" package.
55
*
6-
* Copyright (C) 2016 Elao
6+
* Copyright (C) Elao
77
*
88
* @author Elao <contact@elao.com>
99
*/

tests/Fixtures/Integration/Symfony/TestBundle/Controller/MediaController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the "elao/form-simple-object-mapper" package.
55
*
6-
* Copyright (C) 2016 Elao
6+
* Copyright (C) Elao
77
*
88
* @author Elao <contact@elao.com>
99
*/

tests/Fixtures/Integration/Symfony/TestBundle/Form/Type/AddItemToCartType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the "elao/form-simple-object-mapper" package.
55
*
6-
* Copyright (C) 2016 Elao
6+
* Copyright (C) Elao
77
*
88
* @author Elao <contact@elao.com>
99
*/

tests/Fixtures/Integration/Symfony/TestBundle/TestBundle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the "elao/form-simple-object-mapper" package.
55
*
6-
* Copyright (C) 2016 Elao
6+
* Copyright (C) Elao
77
*
88
* @author Elao <contact@elao.com>
99
*/

tests/Fixtures/Integration/Symfony/app/AppKernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the "elao/form-simple-object-mapper" package.
55
*
6-
* Copyright (C) 2016 Elao
6+
* Copyright (C) Elao
77
*
88
* @author Elao <contact@elao.com>
99
*/

tests/Fixtures/Integration/Symfony/app/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the "elao/form-simple-object-mapper" package.
55
*
6-
* Copyright (C) 2016 Elao
6+
* Copyright (C) Elao
77
*
88
* @author Elao <contact@elao.com>
99
*/
Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
framework:
2-
secret: 'elao'
3-
form: true
2+
secret: 'elao'
3+
form: true
44
router:
5-
resource: '%kernel.root_dir%/config/routing.yml'
6-
strict_requirements: '%kernel.debug%'
7-
test: ~
5+
resource: '%kernel.root_dir%/config/routing.yml'
6+
strict_requirements: '%kernel.debug%'
7+
test: ~
88
session:
9-
storage_id: 'session.storage.mock_file'
9+
storage_id: 'session.storage.mock_file'
1010
templating:
11-
engines: ['twig']
11+
engines: ['twig']
1212
assets: false
13-
annotations: false
13+
validation: { enable_annotations: false }
14+
15+
twig:
16+
strict_variables: true
17+
18+
services:
19+
logger:
20+
class: Psr\Log\NullLogger
21+
public: false
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
add_item_to_cart:
22
path: '/cart/add-item'
3-
defaults: { _controller: 'TestBundle:Cart:addItem' }
3+
defaults:
4+
_controller: 'Elao\FormSimpleObjectMapper\Tests\Fixtures\Integration\Symfony\TestBundle\Controller\CartController::addItemAction'
45

56
edit_media:
67
path: '/media/edit'
7-
defaults: { _controller: 'TestBundle:Media:edit' }
8+
defaults:
9+
_controller: 'Elao\FormSimpleObjectMapper\Tests\Fixtures\Integration\Symfony\TestBundle\Controller\MediaController::editAction'

tests/Fixtures/Media/Book.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the "elao/form-simple-object-mapper" package.
55
*
6-
* Copyright (C) 2016 Elao
6+
* Copyright (C) Elao
77
*
88
* @author Elao <contact@elao.com>
99
*/

tests/Fixtures/Media/Media.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the "elao/form-simple-object-mapper" package.
55
*
6-
* Copyright (C) 2016 Elao
6+
* Copyright (C) Elao
77
*
88
* @author Elao <contact@elao.com>
99
*/

tests/Fixtures/Media/MediaConverter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the "elao/form-simple-object-mapper" package.
55
*
6-
* Copyright (C) 2016 Elao
6+
* Copyright (C) Elao
77
*
88
* @author Elao <contact@elao.com>
99
*/

tests/Fixtures/Media/Movie.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the "elao/form-simple-object-mapper" package.
55
*
6-
* Copyright (C) 2016 Elao
6+
* Copyright (C) Elao
77
*
88
* @author Elao <contact@elao.com>
99
*/

tests/Fixtures/Money.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the "elao/form-simple-object-mapper" package.
55
*
6-
* Copyright (C) 2016 Elao
6+
* Copyright (C) Elao
77
*
88
* @author Elao <contact@elao.com>
99
*/

tests/Fixtures/MoneyType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the "elao/form-simple-object-mapper" package.
55
*
6-
* Copyright (C) 2016 Elao
6+
* Copyright (C) Elao
77
*
88
* @author Elao <contact@elao.com>
99
*/

tests/Fixtures/MoneyTypeConverter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the "elao/form-simple-object-mapper" package.
55
*
6-
* Copyright (C) 2016 Elao
6+
* Copyright (C) Elao
77
*
88
* @author Elao <contact@elao.com>
99
*/

tests/Fixtures/SimpleObjectMapperFormExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the "elao/form-simple-object-mapper" package.
55
*
6-
* Copyright (C) 2016 Elao
6+
* Copyright (C) Elao
77
*
88
* @author Elao <contact@elao.com>
99
*/

0 commit comments

Comments
 (0)