Skip to content

Commit 1baad09

Browse files
committed
Fixes for PHPCQ2
1 parent 5440e90 commit 1baad09

File tree

12 files changed

+242
-96
lines changed

12 files changed

+242
-96
lines changed

.composer-require-checker.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"symbol-whitelist": [
3+
"array", "bool", "false", "int", "null", "self", "static", "parent", "string", "true", "void", "mixed",
4+
"Contao\\ManagerBundle\\ContaoManagerBundle",
5+
"Contao\\ManagerPlugin\\Bundle\\BundlePluginInterface",
6+
"Contao\\ManagerPlugin\\Bundle\\Config\\BundleConfig",
7+
"Contao\\ManagerPlugin\\Bundle\\Parser\\ParserInterface",
8+
"Contao\\ManagerPlugin\\Routing\\RoutingPluginInterface",
9+
"Doctrine\\Bundle\\DoctrineBundle\\DoctrineBundle",
10+
"Symfony\\Component\\Config\\FileLocator",
11+
"Symfony\\Component\\EventDispatcher\\EventDispatcherInterface",
12+
"tl_user_group"
13+
]
14+
}

.phpcq.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"plugins":{"phpunit":{"api-version":"1.0.0","version":"1.0.0.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/phpunit/phpunit-1.0.0.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0"},"tool":{"phpunit":"^6.0 || ^7.0 || ^8.0 || ^9.0"}},"checksum":{"type":"sha-512","value":"c73f15658e3ba62665f09492ec91c3a6a715760bfaa88473a987538439fff442540148e086e46a6aa18ce55a3ea2fbf76caaa581384cb84a38859fcc609ae7e4"},"tools":{"phpunit":{"version":"9.6.16","url":"https://phar.phpunit.de/phpunit-9.6.16.phar","requirements":{"php":{"php":">=7.3","ext-dom":"*","ext-json":"*","ext-libxml":"*","ext-mbstring":"*","ext-xml":"*","ext-xmlwriter":"*"}},"checksum":{"type":"sha-256","value":"891d46f06284db3695498aff5dfd6a944f835e07db2981295db2c2bcf6cfd338"},"signature":"https://phar.phpunit.de/phpunit-9.6.16.phar.asc"}},"composerLock":null},"psalm":{"api-version":"1.0.0","version":"1.2.0.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/psalm/psalm-1.2.0.0.php","signature":null,"requirements":{"php":{"php":"^7.4 || ^8.0","ext-dom":"*"},"tool":{"psalm":"^3.0 || ^4.0 || ^5.0"}},"checksum":{"type":"sha-512","value":"4a550c9226d7bca582d7c10bd87cce01190c96398936b1613421640c83df62ed1c6e0d44c1b39635414ea8cf4a892a6458d27590793238add24e7cb5547e6ffd"},"tools":{"psalm":{"version":"5.21.1","url":"https://github.com/vimeo/psalm/releases/download/5.21.1/psalm.phar","requirements":{"php":{"php":"^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0","ext-SimpleXML":"*","ext-ctype":"*","ext-dom":"*","ext-json":"*","ext-libxml":"*","ext-mbstring":"*","ext-tokenizer":"*"}},"checksum":null,"signature":"https://github.com/vimeo/psalm/releases/download/5.21.1/psalm.phar.asc"}},"composerLock":null},"composer-require-checker":{"api-version":"1.0.0","version":"1.1.1.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/composer-require-checker/composer-require-checker-1.1.1.0.php","signature":null,"requirements":{"php":{"php":"^7.4 || ^8.0"},"tool":{"composer-require-checker":"^3.8 || ^4.0"}},"checksum":{"type":"sha-512","value":"d5415bddfe024c5749d894034583882aee4e5c3e1087815d9fdd81cb5e71630f631a0e35de0ff84b97fbbf738c16ece5f83bd8c00695913eb846aa6f04577dc2"},"tools":{"composer-require-checker":{"version":"4.7.1","url":"https://github.com/maglnet/ComposerRequireChecker/releases/download/4.7.1/composer-require-checker.phar","requirements":{"php":{"php":"~8.1.0 || ~8.2.0 || ~8.3.0","ext-phar":"*"}},"checksum":null,"signature":"https://github.com/maglnet/ComposerRequireChecker/releases/download/4.7.1/composer-require-checker.phar.asc"}},"composerLock":null},"phpmd":{"api-version":"1.0.0","version":"1.0.2.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/phpmd/phpmd-1.0.2.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-dom":"*"},"tool":{"phpmd":"^2.6.1"}},"checksum":{"type":"sha-512","value":"f22280a6dec8dbdd2ec1d83b294f23237fe32c34f4a298e52038e0a7a0074d541635b2b488b1a6098a42d8418a6cd8eb804406ea82b91e362be2b5d11a0915b0"},"tools":{"phpmd":{"version":"2.15.0","url":"https://github.com/phpmd/phpmd/releases/download/2.15.0/phpmd.phar","requirements":{"php":{"php":">=5.3.9","ext-xml":"*"}},"checksum":null,"signature":"https://github.com/phpmd/phpmd/releases/download/2.15.0/phpmd.phar.asc"}},"composerLock":null},"phpcpd":{"api-version":"1.0.0","version":"1.1.1.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/phpcpd/phpcpd-1.1.1.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-dom":"*"},"tool":{"phpcpd":"^6.0"}},"checksum":{"type":"sha-512","value":"1189ce0bf3fade4cb4241f1d96f915ef8fc7651f4450dc79fdf464ee3d6be3009316f0d423ce2d4af9d76ad50807b7fdf4d77bfa6d9ee2c91d6eda32ea214433"},"tools":{"phpcpd":{"version":"6.0.3","url":"https://phar.phpunit.de/phpcpd-6.0.3.phar","requirements":{"php":{"php":">=7.3","ext-dom":"*"}},"checksum":{"type":"sha-256","value":"2cbaea7cfda1bb4299d863eb075e977c3f49055dd16d88529fae5150d48a84cb"},"signature":"https://phar.phpunit.de/phpcpd-6.0.3.phar.asc"}},"composerLock":null},"phploc":{"api-version":"1.0.0","version":"1.0.0.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/phploc/phploc-1.0.0.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-dom":"*","ext-json":"*"},"tool":{"phploc":"^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0"}},"checksum":{"type":"sha-512","value":"f67b02d494796adf553cb3dd13ec06c1cb8e53c799954061749424251379541637538199afb3afa3c7a01cabd1cb6f1c53eb621f015dff9644c6c7cbf10c56d1"},"tools":{"phploc":{"version":"7.0.2","url":"https://phar.phpunit.de/phploc-7.0.2.phar","requirements":{"php":{"php":">=7.3","ext-dom":"*","ext-json":"*"}},"checksum":{"type":"sha-256","value":"3d59778ec86faf25fd00e3a329b2f9ad4a3c751ca91601ea7dab70f887b0bf46"},"signature":"https://phar.phpunit.de/phploc-7.0.2.phar.asc"}},"composerLock":null},"phpcs":{"api-version":"1.0.0","version":"1.1.1.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/phpcs/phpcs-1.1.1.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-dom":"*"},"tool":{"phpcs":"^3.0 || ^2.0","phpcbf":"^3.0 || ^2.0"}},"checksum":{"type":"sha-512","value":"2737022369da1318cc4e0ea194e8a81019f7b079080d869aab878b7486052fdbe68fee3f28131f35573226def1aabd4bd005e038ee7b767c137b1107c1492a83"},"tools":{"phpcs":{"version":"3.8.1","url":"https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/download/3.8.1/phpcs.phar","requirements":{"php":{"php":">=5.4.0","ext-simplexml":"*","ext-tokenizer":"*","ext-xmlwriter":"*"}},"checksum":null,"signature":"https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/download/3.8.1/phpcs.phar.asc"},"phpcbf":{"version":"3.8.1","url":"https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/download/3.8.1/phpcbf.phar","requirements":{"php":{"php":">=5.4.0","ext-simplexml":"*","ext-tokenizer":"*","ext-xmlwriter":"*"}},"checksum":null,"signature":"https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/download/3.8.1/phpcbf.phar.asc"}},"composerLock":null},"composer-normalize":{"api-version":"1.0.0","version":"1.1.0.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/composer-normalize/composer-normalize-1.1.0.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-json":"*"},"tool":{"composer-normalize":"^2.1"}},"checksum":{"type":"sha-512","value":"d59d3557cb20630734878a9115df5dd32d5aff815e5b15be36f6fb5d6e9d83dd36efd84215ab6529edcc924f600946f739a0d9e67723deff95c88346ab502498"},"tools":{"composer-normalize":{"version":"2.42.0","url":"https://github.com/ergebnis/composer-normalize/releases/download/2.42.0/composer-normalize.phar","requirements":{"php":{"php":"~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0","ext-json":"*"}},"checksum":null,"signature":"https://github.com/ergebnis/composer-normalize/releases/download/2.42.0/composer-normalize.phar.asc"}},"composerLock":null}},"tools":[]}

.phpcq.yaml.dist

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
phpcq:
2+
repositories:
3+
- https://phpcq.github.io/repository/repository.json
4+
directories:
5+
- src
6+
- tests
7+
artifact: .phpcq/build
8+
composer:
9+
autodiscover: false
10+
11+
plugins:
12+
phpunit:
13+
version: ^1.0
14+
signed: false
15+
psalm:
16+
version: ^1.0
17+
signed: false
18+
composer-require-checker:
19+
version: ^1.0
20+
signed: false
21+
phpmd:
22+
version: ^1.0
23+
signed: false
24+
phpcpd:
25+
version: ^1.1
26+
signed: false
27+
phploc:
28+
version: ^1.0
29+
signed: false
30+
phpcs:
31+
version: ^1.0
32+
signed: false
33+
composer-normalize:
34+
version: ^1.0
35+
signed: false
36+
trusted-keys:
37+
# composer-require-checker
38+
- 033E5F8D801A2F8D
39+
# sb@sebastian-bergmann.de
40+
- 4AA394086372C20A
41+
# psalm
42+
- 8A03EA3B385DBAA1
43+
- 12CE0F1D262429A5
44+
# magl@magll.net
45+
- D2CCAC42F6295E7D
46+
# PHP_CodeSniffer
47+
- 31C7E470E2138192
48+
# Composer normalize
49+
- C00543248C87FB13
50+
# phpmd
51+
- A4E55EA12C7C085C
52+
- 9093F8B32E4815AA
53+
54+
tasks:
55+
fix:
56+
- composer-normalize-fix
57+
- phpcbf
58+
59+
verify:
60+
- composer-require-checker
61+
- composer-normalize
62+
63+
analyze:
64+
- phploc
65+
- phpcpd
66+
- phpmd
67+
- phpcs
68+
- psalm
69+
- phpunit
70+
71+
default:
72+
- verify
73+
- analyze
74+
75+
phpcpd:
76+
plugin: phpcpd
77+
config:
78+
exclude:
79+
- tests
80+
- src/CoreBundle/EventListener/DcGeneral/DefinitionBuilder
81+
- src/CoreBundle/Resources/contao/dca
82+
83+
phpmd:
84+
plugin: phpmd
85+
config:
86+
ruleset:
87+
- ./.phpmd.xml
88+
89+
composer-require-checker:
90+
plugin: composer-require-checker
91+
config:
92+
config_file: '.composer-require-checker.json'
93+
94+
phpcs:
95+
plugin: phpcs
96+
config: &phpcs-config
97+
standard: PSR12
98+
excluded:
99+
- '*/Resources/contao/dca/*'
100+
- '*/Resources/contao/languages/*'
101+
- '*/Resources/public/*'
102+
103+
phpcbf:
104+
plugin: phpcs
105+
config:
106+
<<: *phpcs-config
107+
fix: true
108+
109+
composer-normalize-fix:
110+
plugin: composer-normalize
111+
config:
112+
dry_run: false

.phpmd.xml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="PHPMD rule set"
3+
xmlns="http://pmd.sf.net/ruleset/1.0.0"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
6+
xsi:noNamespaceSchemaLocation=" http://pmd.sf.net/ruleset_xml_schema.xsd">
7+
<description>
8+
PHPMD rule set
9+
</description>
10+
11+
<rule ref="rulesets/codesize.xml"/>
12+
<rule ref="rulesets/controversial.xml">
13+
<exclude name="CamelCaseVariableName"/>
14+
</rule>
15+
<rule ref="rulesets/controversial.xml/CamelCaseVariableName">
16+
<properties>
17+
<property name="allow-underscore" value="true"/>
18+
</properties>
19+
</rule>
20+
<rule ref="rulesets/design.xml"/>
21+
<rule ref="rulesets/naming.xml">
22+
<exclude name="ShortVariable" />
23+
</rule>
24+
<rule ref="rulesets/naming.xml/ShortVariable">
25+
<properties>
26+
<property name="exceptions" value="id" />
27+
</properties>
28+
</rule>
29+
<rule ref="rulesets/unusedcode.xml">
30+
<exclude name="UnusedLocalVariable"/>
31+
</rule>
32+
<rule ref="rulesets/unusedcode.xml/UnusedLocalVariable">
33+
<properties>
34+
<property name="allow-unused-foreach-variables" value="true"/>
35+
</properties>
36+
</rule>
37+
</ruleset>

build.default.properties

Lines changed: 0 additions & 11 deletions
This file was deleted.

build.xml

Lines changed: 0 additions & 12 deletions
This file was deleted.

composer.json

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
{
22
"name": "metamodels/filter_checkbox",
33
"description": "MetaModels checkbox filter",
4+
"license": "LGPL-3.0-or-later",
5+
"type": "contao-bundle",
46
"keywords": [
57
"contao",
68
"metamodels",
79
"filter",
810
"checkbox"
911
],
10-
"type": "contao-bundle",
11-
"homepage": "https://now.metamodel.me/",
12-
"license": "LGPL-3.0-or-later",
1312
"authors": [
1413
{
1514
"name": "Christian Schiffler",
@@ -23,6 +22,7 @@
2322
"role": "Developer"
2423
}
2524
],
25+
"homepage": "https://now.metamodel.me/",
2626
"support": {
2727
"email": "mail@metamodel.me",
2828
"issues": "https://github.com/MetaModels/filter_checkbox/issues",
@@ -31,18 +31,24 @@
3131
"source": "https://github.com/MetaModels/filter_checkbox"
3232
},
3333
"require": {
34-
"php": "^7.4 || ^8.0",
35-
"contao-community-alliance/dc-general": "^2.3@dev",
36-
"contao/core-bundle": "^4.13.0, <5.0",
34+
"php": "^8.1",
35+
"contao-community-alliance/dc-general": "^2.3",
36+
"contao/core-bundle": "^4.13.0 <5.0",
3737
"metamodels/core": "^2.3@dev",
3838
"symfony/dependency-injection": "^5.4",
3939
"symfony/http-kernel": "^5.4"
4040
},
4141
"require-dev": {
4242
"contao/manager-plugin": "^2.1",
4343
"menatwork/contao-multicolumnwizard-bundle": "^3.4",
44-
"phpcq/all-tasks": "^1.2"
44+
"phpcq/runner-bootstrap": "^1.0@dev"
4545
},
46+
"repositories": [
47+
{
48+
"type": "composer",
49+
"url": "https://packages.cyberspectrum.de/r"
50+
}
51+
],
4652
"autoload": {
4753
"psr-4": {
4854
"MetaModels\\FilterCheckboxBundle\\": "src"
@@ -56,17 +62,18 @@
5662
"MetaModels\\FilterCheckboxBundle\\Test\\": "tests"
5763
}
5864
},
59-
"extra": {
60-
"contao-manager-plugin": "MetaModels\\FilterCheckboxBundle\\ContaoManager\\Plugin",
61-
"branch-alias": {
62-
"dev-feature/2.3.0": "2.3.x-dev"
63-
}
64-
},
6565
"config": {
6666
"allow-plugins": {
6767
"contao-components/installer": false,
68-
"contao/manager-plugin": false
68+
"contao/manager-plugin": false,
69+
"php-http/discovery": true
6970
},
7071
"sort-packages": true
72+
},
73+
"extra": {
74+
"branch-alias": {
75+
"dev-feature/2.3.0": "2.3.x-dev"
76+
},
77+
"contao-manager-plugin": "MetaModels\\FilterCheckboxBundle\\ContaoManager\\Plugin"
7178
}
7279
}

psalm.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0"?>
2+
<psalm
3+
errorLevel="3"
4+
resolveFromConfigFile="true"
5+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6+
xmlns="https://getpsalm.org/schema/config"
7+
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
8+
>
9+
<projectFiles>
10+
<directory name="src" />
11+
<ignoreFiles>
12+
<directory name="src/Resources/contao/dca"/>
13+
<directory name="src/Resources/contao/languages"/>
14+
</ignoreFiles>
15+
</projectFiles>
16+
</psalm>

src/DependencyInjection/MetaModelsFilterCheckboxExtension.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* This file is part of MetaModels/filter_checkbox.
55
*
6-
* (c) 2012-2019 The MetaModels team.
6+
* (c) 2012-2024 The MetaModels team.
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.
@@ -13,7 +13,8 @@
1313
* @package MetaModels/filter_checkbox
1414
* @author Christian Schiffler <c.schiffler@cyberspectrum.de>
1515
* @author Richard Henkenjohann <richardhenkenjohann@googlemail.com>
16-
* @copyright 2012-2019 The MetaModels team.
16+
* @author Ingolf Steinhardt <info@e-spin.de>
17+
* @copyright 2012-2024 The MetaModels team.
1718
* @license https://github.com/MetaModels/filter_checkbox/blob/master/LICENSE LGPL-3.0-or-later
1819
* @filesource
1920
*/
@@ -33,7 +34,7 @@ class MetaModelsFilterCheckboxExtension extends Extension
3334
/**
3435
* {@inheritDoc}
3536
*/
36-
public function load(array $configs, ContainerBuilder $container)
37+
public function load(array $configs, ContainerBuilder $container): void
3738
{
3839
$loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
3940
$loader->load('services.yml');

0 commit comments

Comments
 (0)