Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit 2e7dd5f

Browse files
committed
DevKit updates
1 parent 05b850b commit 2e7dd5f

File tree

11 files changed

+191
-41
lines changed

11 files changed

+191
-41
lines changed

.php_cs.dist

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?php
2+
3+
/**
4+
* DO NOT EDIT THIS FILE!
5+
*
6+
* It's auto-generated by sonata-project/dev-kit package.
7+
*/
8+
9+
$header = <<<'HEADER'
10+
This file is part of the Symfony CMF package.
11+
12+
(c) Symfony CMF
13+
14+
For the full copyright and license information, please view the LICENSE
15+
file that was distributed with this source code.
16+
HEADER;
17+
18+
$rules = [
19+
'@Symfony' => true,
20+
'@Symfony:risky' => true,
21+
'array_syntax' => [
22+
'syntax' => 'short',
23+
],
24+
'combine_consecutive_issets' => true,
25+
'combine_consecutive_unsets' => true,
26+
'header_comment' => [
27+
'header' => $header,
28+
],
29+
'no_extra_blank_lines' => true,
30+
'no_php4_constructor' => true,
31+
'no_useless_else' => true,
32+
'no_useless_return' => true,
33+
'ordered_class_elements' => true,
34+
'ordered_imports' => true,
35+
'phpdoc_order' => true,
36+
'@PHP56Migration' => true,
37+
'@PHP56Migration:risky' => true,
38+
'@PHPUnit57Migration:risky' => true,
39+
'@PHP70Migration' => true,
40+
'@PHP70Migration:risky' => true,
41+
'@PHPUnit60Migration:risky' => true,
42+
'@PHP71Migration' => true,
43+
'@PHP71Migration:risky' => true,
44+
'compact_nullable_typehint' => true,
45+
'void_return' => null,
46+
'strict_comparison' => true,
47+
'strict_param' => true,
48+
];
49+
50+
51+
$finder = PhpCsFixer\Finder::create()
52+
->in(__DIR__)
53+
->exclude('Tests/Fixtures')
54+
->exclude('tests/Fixtures')
55+
->exclude('Resources/skeleton')
56+
->exclude('Resources/public/vendor')
57+
;
58+
59+
return PhpCsFixer\Config::create()
60+
->setFinder($finder)
61+
->setRiskyAllowed(true)
62+
->setRules($rules)
63+
->setUsingCache(true)
64+
;

.styleci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
############################################################################
88
# This file is part of the Symfony CMF package. #
99
# #
10-
# (c) 2011-2017 Symfony CMF #
10+
# (c) Symfony CMF #
1111
# #
1212
# For the full copyright and license information, please view the LICENSE #
1313
# file that was distributed with this source code. #

.travis.yml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
############################################################################
88
# This file is part of the Symfony CMF package. #
99
# #
10-
# (c) 2011-2017 Symfony CMF #
10+
# (c) Symfony CMF #
1111
# #
1212
# For the full copyright and license information, please view the LICENSE #
1313
# file that was distributed with this source code. #
@@ -29,21 +29,22 @@ cache:
2929
env:
3030
matrix: SYMFONY_VERSION=4.2.*
3131
global:
32-
- SYMFONY_DEPRECATIONS_HELPER=weak
32+
- SYMFONY_DEPRECATIONS_HELPER="/.*each.*/"
3333
- SYMFONY_PHPUNIT_DIR=.phpunit SYMFONY_PHPUNIT_REMOVE="symfony/yaml"
34-
- SYMFONY_PHPUNIT_VERSION=6
35-
- TEST_INSTALLATION=false
34+
- SYMFONY_PHPUNIT_VERSION=7
35+
- PHPUNIT_VERSION=7
36+
- TARGET=test
3637

3738
matrix:
3839
include:
40+
- env: TARGET=lint
3941
- php: 7.3
4042
env: STABILITY="dev" SYMFONY_VERSION=4.3.*
4143
- php: 7.3
4244
env: SYMFONY_VERSION=4.2.*
4345
- php: 7.1
44-
env: COMPOSER_FLAGS="--prefer-lowest" SYMFONY_VERSION=3.4.* SYMFONY_DEPRECATIONS_HELPER=weak
45-
- php: 7.2
46-
env: SYMFONY_VERSION=4.0.*
46+
env: COMPOSER_FLAGS="--prefer-lowest" SYMFONY_VERSION=3.4.* SYMFONY_DEPRECATIONS_HELPER="/.*each.*/"
47+
4748
- php: 7.2
4849
env: SYMFONY_VERSION=4.1.*
4950
fast_finish: true
@@ -59,9 +60,13 @@ before_install:
5960
- if [ "$SYMFONY_VERSION" != "" ]; then composer require symfony/symfony:${SYMFONY_VERSION} --no-update; fi
6061
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
6162

62-
install: travis_wait composer update --prefer-dist $COMPOSER_FLAGS
63-
script:
64-
- if [ "${TEST_INSTALLATION}" == true ]; then make test_installation; else make test; fi
63+
install:
64+
- if [ -x .travis/install_${TARGET}.sh ]; then .travis/install_${TARGET}.sh; fi;
65+
66+
script: make $TARGET
67+
68+
after_success:
69+
- if [ -x .travis/after_success_${TARGET}.sh ]; then .travis/after_success_${TARGET}.sh; fi;
6570

6671
notifications:
6772
irc: "irc.freenode.org#symfony-cmf"

.travis/after_success_test.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
#!/usr/bin/env sh
3+
set -ev
4+
5+
coveralls -v

.travis/install_lint.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env sh
2+
set -ev
3+
4+
mkdir --parents "${HOME}/bin"
5+
6+
wget "http://cs.sensiolabs.org/download/php-cs-fixer-v2.phar" --output-document="${HOME}/bin/php-cs-fixer"
7+
chmod u+x "${HOME}/bin/php-cs-fixer"
8+
9+
composer global require sllh/composer-lint:@stable --prefer-dist --no-interaction
10+
11+
gem install yaml-lint

.travis/install_test.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env sh
2+
set -ev
3+
4+
mkdir --parents "${HOME}/bin"
5+
6+
wget "https://phar.phpunit.de/phpunit-${PHPUNIT_VERSION}.phar" --output-document="${HOME}/bin/phpunit"
7+
chmod u+x "${HOME}/bin/phpunit"
8+
9+
# Coveralls client install
10+
wget https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar --output-document="${HOME}/bin/coveralls"
11+
chmod u+x "${HOME}/bin/coveralls"
12+
13+
# To be removed when these issues are resolved:
14+
# https://github.com/composer/composer/issues/5355
15+
if [ "${COMPOSER_FLAGS}" = '--prefer-lowest' ]; then
16+
composer update --prefer-dist --no-interaction --prefer-stable --quiet
17+
fi
18+
19+
composer update --prefer-dist --no-interaction --prefer-stable ${COMPOSER_FLAGS}

Makefile

Lines changed: 48 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,71 @@
77
############################################################################
88
# This file is part of the Symfony CMF package. #
99
# #
10-
# (c) 2011-2017 Symfony CMF #
10+
# (c) Symfony CMF #
1111
# #
1212
# For the full copyright and license information, please view the LICENSE #
1313
# file that was distributed with this source code. #
1414
############################################################################
1515

1616
TESTING_SCRIPTS_DIR=vendor/symfony-cmf/testing/bin
17-
18-
SYMFONY_PHPUNIT_VERSION=6
19-
SYMFONY_DEPRECATIONS_HELPER==weak
2017
CONSOLE=${TESTING_SCRIPTS_DIR}/console
21-
SYMFONY_PHPUNIT_DIR=.phpunit
22-
SYMFONY_PHPUNIT_REMOVE="symfony/yaml"
2318
VERSION=dev-master
2419
ifdef BRANCH
2520
VERSION=dev-${BRANCH}
2621
endif
2722
PACKAGE=symfony-cmf/menu-bundle
23+
HAS_XDEBUG=$(shell php --modules|grep --quiet xdebug;echo $$?)
2824

2925
list:
3026
@echo 'test: will run all tests'
3127
@echo 'unit_tests: will run unit tests only'
3228
@echo 'functional_tests_phpcr: will run functional tests with PHPCR'
3329

34-
35-
include ${TESTING_SCRIPTS_DIR}/make/unit_tests.mk
36-
include ${TESTING_SCRIPTS_DIR}/make/functional_tests_phpcr.mk
30+
TEST_DEPENDENCIES := ""
31+
EXTRA_INCLUDES:=$(wildcard ${TESTING_SCRIPTS_DIR}/make/unit_tests.mk)
32+
ifneq ($(strip $(EXTRA_INCLUDES)),)
33+
contents := $(shell echo including extra rules $(EXTRA_INCLUDES))
34+
include $(EXTRA_INCLUDES)
35+
TEST_DEPENDENCIES := $(TEST_DEPENDENCIES)" unit_tests"
36+
endif
37+
EXTRA_INCLUDES:=$(wildcard ${TESTING_SCRIPTS_DIR}/make/functional_tests_phpcr.mk)
38+
ifneq ($(strip $(EXTRA_INCLUDES)),)
39+
contents := $(shell echo including extra rules $(EXTRA_INCLUDES))
40+
include $(EXTRA_INCLUDES)
41+
TEST_DEPENDENCIES := $(TEST_DEPENDENCIES)" functional_tests_phpcr"
42+
endif
3743

3844
.PHONY: test
39-
test: unit_tests functional_tests_phpcr
45+
test: build/xdebug-filter.php$
46+
ifneq ($(strip $(wildcard ${TESTING_SCRIPTS_DIR}/make/unit_tests.mk)),)
47+
@make unit_tests
48+
endif
49+
ifneq ($(strip $(wildcard ${TESTING_SCRIPTS_DIR}/make/functional_tests_phpcr.mk)),)
50+
@make functional_tests_phpcr
51+
endif
52+
53+
lint-php:
54+
php-cs-fixer fix --ansi --verbose --diff --dry-run
55+
.PHONY: lint-php
56+
57+
lint: lint-composer lint-php
58+
.PHONY: lint
59+
60+
lint-composer:
61+
composer validate
62+
.PHONY: lint-composer
63+
64+
cs-fix: cs-fix-php
65+
.PHONY: cs-fix
66+
67+
cs-fix-php:
68+
php-cs-fixer fix --verbose
69+
.PHONY: cs-fix-php
70+
71+
build:
72+
mkdir $@
73+
74+
build/xdebug-filter.php: phpunit.xml.dist build
75+
ifeq ($(HAS_XDEBUG), 0)
76+
phpunit --dump-xdebug-filter $@
77+
endif

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The MenuBundle provides menus from a doctrine object manager with the help of Kn
2323
## Requirements
2424

2525
* PHP 7.1 / 7.2 / 7.3
26-
* Symfony 3.4 / 4.0 / 4.1 / 4.2
26+
* Symfony 3.4 / 4.1 / 4.2
2727
* See also the `require` section of [composer.json](composer.json)
2828

2929
## Documentation

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
],
1717
"require": {
1818
"php": "^7.1",
19-
"symfony/framework-bundle": "^3.4 || ^4.0",
20-
"symfony/validator": "^3.4 || ^4.0",
19+
"symfony/framework-bundle": "^3.4 || ^4.1",
20+
"symfony/validator": "^3.4 || ^4.1",
2121
"knplabs/knp-menu-bundle": "^2.2.0",
2222
"knplabs/knp-menu": "^2.0.0"
2323
},

phpunit.xml.dist

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,35 @@
22

33
<!-- http://www.phpunit.de/manual/current/en/appendixes.configuration.html -->
44
<phpunit
5-
colors="true"
6-
bootstrap="vendor/symfony-cmf/testing/bootstrap/bootstrap.php"
7-
>
5+
colors="true"
6+
bootstrap="vendor/symfony-cmf/testing/bootstrap/bootstrap.php"
7+
>
88

9-
<testsuites>
10-
<testsuite name="unit tests">
9+
<testsuites>
10+
11+
12+
<testsuite name="unit tests">
1113
<directory>./tests/Unit</directory>
1214
</testsuite>
13-
15+
1416
<testsuite name="functional tests with phpcr">
1517
<directory>./tests/Functional</directory>
18+
<exclude>./tests/Functional/Doctrine/Orm</exclude>
1619
</testsuite>
17-
</testsuites>
20+
21+
</testsuites>
22+
23+
<filter>
24+
<whitelist addUncoveredFilesFromWhitelist="true">
25+
<directory>src/</directory>
26+
<exclude>
27+
<directory>Resources/</directory>
28+
</exclude>
29+
</whitelist>
30+
</filter>
31+
32+
<php>
1833

19-
<filter>
20-
<whitelist addUncoveredFilesFromWhitelist="true">
21-
<directory>src</directory>
22-
<exclude>
23-
<file>*Bundle.php</file>
24-
<directory>Resources/</directory>
25-
</exclude>
26-
</whitelist>
27-
</filter>
34+
<env name="KERNEL_CLASS" value="\Symfony\Cmf\Bundle\MenuBundle\Tests\Fixtures\App\Kernel" />
35+
</php>
2836
</phpunit>

0 commit comments

Comments
 (0)