Skip to content

Commit

Permalink
Merge pull request #7 from 21TORR/symfony-v6
Browse files Browse the repository at this point in the history
Symfony v6
  • Loading branch information
21christiansc authored Feb 21, 2022
2 parents 2106c01 + 8fc849f commit 980bb2d
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 34 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:

strategy:
matrix:
php: ['7.4', '8.0']
php: ['8.0', '8.1']

steps:
- name: Checkout Code
Expand All @@ -20,7 +20,7 @@ jobs:
coverage: "none"
ini-values: "memory_limit=-1"
php-version: "${{ matrix.php }}"
tools: pecl
tools: "composer, composer-normalize, cs2pr"

- name: Display versions
run: |
Expand All @@ -29,17 +29,19 @@ jobs:
php -i
- name: Install Composer
uses: php-actions/composer@v1
run: composer install --optimize-autoloader --classmap-authoritative --no-interaction

- name: Composer Normalize
uses: "docker://ergebnis/composer-normalize-action:latest"
with:
args: "--indent-style tab --indent-size 1 --dry-run"
run: composer-normalize --indent-style tab --indent-size 1 --dry-run --ansi

- name: PHP CS Fixer
run: "./vendor/bin/php-cs-fixer fix --diff --config vendor-bin/test/vendor/21torr/php-cs/.php_cs.dist --dry-run --no-interaction"
run: "./vendor/bin/php-cs-fixer fix --diff --config vendor-bin/test/vendor/21torr/php-cs/.php-cs-fixer.dist.php --dry-run --no-interaction --ansi --format=checkstyle | cs2pr"
env:
PHP_CS_FIXER_IGNORE_ENV: 1

- name: PHPStan
run: "./vendor/bin/phpstan analyze -c vendor-bin/test/vendor/21torr/php-cs/phpstan/lib.neon ."
run: "./vendor/bin/phpstan analyze -c vendor-bin/test/vendor/21torr/php-cs/phpstan/lib.neon . --ansi --error-format=checkstyle | cs2pr"

- name: PHPUnit
# --teamcity output used by `mheap/phpunit-matcher-action`
run: "./vendor/bin/simple-phpunit --teamcity"
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/.php-cs-fixer.cache
/.php_cs.cache
/.phpunit.result.cache
/composer.lock
/studio.json
/vendor
/vendor-bin/*/composer.lock
/vendor-bin/*/vendor
/vendor-bin/*/vendor
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2.1.2
=====

* (improvement) Allow Symfony v6.


2.1.1
=====

Expand Down
35 changes: 19 additions & 16 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,25 @@
{
"name": "21torr/bundle-helpers",
"type": "library",
"description": "Helper classes specifically designed to ease implementation of Symfony bundles.",
"homepage": "https://github.com/21TORR/bundle-helpers",
"license": "BSD-3-Clause",
"type": "library",
"authors": [
{
"name": "21TORR",
"homepage": "https://www.21torr.com/"
}
],
"homepage": "https://github.com/21TORR/bundle-helpers",
"require": {
"php": "^7.4 || ^8.0",
"symfony/config": "^5.1",
"symfony/dependency-injection": "^5.1",
"symfony/http-kernel": "^5.1"
"php": "^8.0",
"symfony/config": "^5.1 || ^6.0",
"symfony/dependency-injection": "^5.1 || ^6.0",
"symfony/http-kernel": "^5.1 || ^6.0"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.4",
"roave/security-advisories": "dev-master",
"symfony/phpunit-bridge": "^5.1"
},
"config": {
"sort-packages": true
},
"extra": {
"branch-alias": {
"dev-next": "2.x-dev"
}
"roave/security-advisories": "dev-latest",
"symfony/phpunit-bridge": "^5.1 || ^6.0"
},
"autoload": {
"psr-4": {
Expand All @@ -39,6 +31,17 @@
"Tests\\Torr\\BundleHelpers\\": "tests/"
}
},
"config": {
"allow-plugins": {
"bamarni/composer-bin-plugin": true
},
"sort-packages": true
},
"extra": {
"branch-alias": {
"dev-next": "2.x-dev"
}
},
"scripts": {
"post-install-cmd": [
"@composer bin all install --ansi"
Expand Down
8 changes: 4 additions & 4 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
colors="true"
bootstrap="vendor/autoload.php"
>
Expand All @@ -9,12 +9,12 @@
<server name="APP_ENV" value="test" force="true" />
<server name="SHELL_VERBOSITY" value="-1" />
<server name="SYMFONY_PHPUNIT_REMOVE" value="" />
<server name="SYMFONY_PHPUNIT_VERSION" value="9.3" />
<server name="SYMFONY_PHPUNIT_VERSION" value="9.5" />
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[direct]=0"/>
</php>

<testsuites>
<testsuite name="Bundle tests">
<testsuite name="Bundle Tests">
<directory>tests</directory>
<exclude>tests/fixtures</exclude>
</testsuite>
Expand All @@ -23,4 +23,4 @@
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
</listeners>
</phpunit>
</phpunit>
10 changes: 7 additions & 3 deletions src/Bundle/BundleExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class BundleExtension extends Extension

public function __construct (
BundleInterface $bundle,
?string $alias = null
?string $alias = null,
)
{
$this->bundle = $bundle;
Expand Down Expand Up @@ -60,10 +60,14 @@ public function getAlias () : string
{
throw new BundleHelpersException(\sprintf(
"The bundle does not follow the naming convention; you must pass an explicit alias. Its name should end on 'Bundle', but it is '%s'.",
$className
$className,
));
}
$classBaseName = \substr(\strrchr($className, '\\'), 1, -6);

$classBaseNameForNamespacedClass = \strrchr($className, '\\');
$classBaseName = false !== $classBaseNameForNamespacedClass
? \substr($classBaseNameForNamespacedClass, 1, -6)
: $className;

return Container::underscore($classBaseName);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Bundle/ConfigurableBundleExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function __construct (
BundleInterface $bundle,
ConfigurationInterface $config,
callable $callback,
?string $alias = null
?string $alias = null,
)
{
parent::__construct($bundle, $alias);
Expand Down
5 changes: 5 additions & 0 deletions vendor-bin/cs-fixer/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"require": {
"friendsofphp/php-cs-fixer": "^3.6"
}
}
8 changes: 7 additions & 1 deletion vendor-bin/test/composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
{
"require": {
"21torr/php-cs": "^2.0.1"
"21torr/php-cs": "^4.0.4"
},
"config": {
"allow-plugins": {
"phpstan/extension-installer": true,
"ergebnis/composer-normalize": true
}
}
}

0 comments on commit 980bb2d

Please sign in to comment.