Skip to content

Commit

Permalink
Merge PR #43 from @zonky2
Browse files Browse the repository at this point in the history
Fix composer for phpsq
  • Loading branch information
stefanheimes committed Jul 30, 2024
2 parents 2b887be + 5fc2a61 commit 4501309
Show file tree
Hide file tree
Showing 26 changed files with 732 additions and 465 deletions.
28 changes: 28 additions & 0 deletions .composer-require-checker.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"symbol-whitelist": [
"array", "bool", "false", "int", "null", "self", "static", "parent", "string", "true", "void", "mixed",
"ampersand", "array_insert", "array_is_assoc", "nl2br_html5", "TL_ERROR",
"BackendTemplate",
"ContaoCommunityAlliance\\Contao\\Bindings\\ContaoEvents",
"ContaoCommunityAlliance\\Contao\\Bindings\\Events\\Widget\\GetAttributesFromDcaEvent",
"Contao\\ManagerBundle\\ContaoManagerBundle",
"Contao\\ManagerPlugin\\Bundle\\BundlePluginInterface",
"Contao\\ManagerPlugin\\Bundle\\Config\\BundleConfig",
"Contao\\ManagerPlugin\\Bundle\\Parser\\ParserInterface",
"Doctrine\\DBAL\\ArrayParameterType",
"Doctrine\\DBAL\\Connection",
"Doctrine\\DBAL\\Platforms\\AbstractPlatform",
"FrontendUser",
"Psr\\EventDispatcher\\EventDispatcherInterface",
"Symfony\\Component\\Config\\FileLocator",
"Symfony\\Component\\DependencyInjection\\ContainerBuilder",
"Symfony\\Component\\DependencyInjection\\Extension\\Extension",
"Symfony\\Component\\DependencyInjection\\Loader\\YamlFileLoader",
"Symfony\\Component\\Filesystem\\Filesystem",
"Symfony\\Component\\HttpFoundation\\Request",
"Symfony\\Component\\HttpFoundation\\RequestStack",
"Symfony\\Component\\HttpKernel\\Bundle\\Bundle",
"Symfony\\Contracts\\EventDispatcher\\EventDispatcherInterface",
"Symfony\\Contracts\\Translation\\TranslatorInterface"
]
}
69 changes: 47 additions & 22 deletions .github/workflows/diagnostics.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,75 @@
name: DC General Contao Frontend
name: Code Quality Diagnostics

on:
push:
pull_request:
push:
branches:

jobs:
build:
runs-on: ubuntu-latest
name: 'PHP: ${{ matrix.php }} Contao: ${{ matrix.contao }}'
strategy:
fail-fast: false
matrix:
php: [8.1]
contao: [~4.13.0]
php: [ '8.1', '8.2' ]
contao: [ '~4.13.0' ]
phpcq_install: [ 'update' ]
output: [ '-o github-action -o default' ]

steps:
- name: PHP ${{ matrix.php }} ${{ matrix.contao }} Pull source
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Pull source
uses: actions/checkout@v3

# see https://github.com/shivammathur/setup-php
- name: PHP ${{ matrix.php }} ${{ matrix.contao }} Setup PHP.
- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none

- name: PHP ${{ matrix.php }} ${{ matrix.contao }} Cache composer cache directory
uses: actions/cache@v1
# setup caches
- name: Cache composer cache directory
uses: actions/cache@v3
env:
cache-name: composer-cache-dir
with:
path: ~/.cache/composer
key: ${{ runner.os }}-build-${{ env.cache-name }}
key: ${{ runner.os }}-${{ matrix.php }}-build-${{ env.cache-name }}

- name: PHP ${{ matrix.php }} ${{ matrix.contao }} Cache vendor directory
- name: Cache vendor directory
uses: actions/cache@v3
env:
cache-name: composer-vendor
cache-name: vendor
with:
path: vendor
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.lock') }}
key: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.contao }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-${{ matrix.php }}-${{ matrix.contao }}-build-${{ env.cache-name }}-
- name: PHP ${{ matrix.php }} ${{ matrix.contao }} Install composer dependencies
run: composer update --prefer-dist --no-interaction --no-suggest
- name: Cache phpcq directory
uses: actions/cache@v3
env:
cache-name: phpcq
with:
path: .phpcq
key: ${{ runner.os }}-${{ matrix.php }}-build-${{ env.cache-name }}-${{ hashFiles('**/.phpcq.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.php }}-build-${{ env.cache-name }}-
# install dependencies and tools
- name: Install composer dependencies
run: |
composer require contao/core-bundle ${{ matrix.contao }} --no-update
composer install
- name: Install phpcq toolchain
run: ./vendor/bin/phpcq ${{ matrix.phpcq_install }} -v

- name: PHP ${{ matrix.php }} ${{ matrix.contao }} Run tests
run: ant -keep-going
# run tests
- name: Run tests
run: ./vendor/bin/phpcq run -v ${{ matrix.output }}

- name: Upload build directory to artifact
uses: actions/upload-artifact@v3
if: ${{ success() }} || ${{ failure() }}
with:
name: phpcq-builds-php-${{ matrix.php }}-${{ matrix.contao }}
path: .phpcq/build/
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.DS_Store
Thumbs.db

# IDEs
# IDEs
.buildpath
.project
.settings/
Expand All @@ -14,3 +14,4 @@ nbproject/
# composer related
vendor/
composer.lock
.phpcq/
1 change: 1 addition & 0 deletions .phpcq.lock
Original file line number Diff line number Diff line change
@@ -0,0 +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.20","url":"https://phar.phpunit.de/phpunit-9.6.20.phar","requirements":{"php":{"php":">=7.3","ext-dom":"*","ext-json":"*","ext-libxml":"*","ext-mbstring":"*","ext-xml":"*","ext-xmlwriter":"*"}},"checksum":{"type":"sha-256","value":"4b49fdf48a3fdb5f4f4b5b18c43a542e75787edaf6a6ab39713f579d0a018210"},"signature":"https://phar.phpunit.de/phpunit-9.6.20.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.25.0","url":"https://github.com/vimeo/psalm/releases/download/5.25.0/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.25.0/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.11.0","url":"https://github.com/maglnet/ComposerRequireChecker/releases/download/4.11.0/composer-require-checker.phar","requirements":{"php":{"php":"~8.2.0 || ~8.3.0","ext-phar":"*"}},"checksum":null,"signature":"https://github.com/maglnet/ComposerRequireChecker/releases/download/4.11.0/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.2.0.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/phpcs/phpcs-1.2.0.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":"b6ed00306e76068a6af5e3b1dec837724f9e1900ef1049ce88e7ce195b0583524ca33a73613fba13244307a7ca853b6ddaa14ded69f651c3f184ac130bd1aaad"},"tools":{"phpcs":{"version":"3.10.2","url":"https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/download/3.10.2/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.10.2/phpcs.phar.asc"},"phpcbf":{"version":"3.10.2","url":"https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/download/3.10.2/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.10.2/phpcbf.phar.asc"}},"composerLock":null},"composer-normalize":{"api-version":"1.0.0","version":"1.1.1.0","type":"php-file","url":"https://phpcq.github.io/repository/plugin/composer-normalize/composer-normalize-1.1.1.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-json":"*"},"tool":{"composer-normalize":"^2.1"}},"checksum":{"type":"sha-512","value":"d9abda440b85d501c58abf9c81bf76f417594b397129215ffa8b777e9bb5e5eda37d7661d661db3c8d11c24f20345bc6fbe56f013b3b9435d459d2b94f086e0f"},"tools":{"composer-normalize":{"version":"2.43.0","url":"https://github.com/ergebnis/composer-normalize/releases/download/2.43.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.43.0/composer-normalize.phar.asc"}},"composerLock":null}},"tools":[]}
3 changes: 2 additions & 1 deletion .phpcq.yaml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ phpcq:
requirements:
composer-require-checker:
signed: false
version: ^3.3
version: ^4.0
phpmd:
version: ^1.0
signed: false
Expand Down Expand Up @@ -51,6 +51,7 @@ phpcq:
- D2CCAC42F6295E7D
# PHP_CodeSniffer
- 31C7E470E2138192
- A978220305CD5C32
# Composer normalize
- C00543248C87FB13
# phpmd
Expand Down
12 changes: 0 additions & 12 deletions build.xml

This file was deleted.

67 changes: 36 additions & 31 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,59 +1,64 @@
{
"name":"contao-community-alliance/dc-general-contao-frontend",
"description":"DcGeneral frontend editing feature",
"keywords":["contao", "dc-general"],
"type":"contao-bundle",
"homepage":"https://c-c-a.org/",
"license":"LGPL-3.0-or-later",
"authors":[
"name": "contao-community-alliance/dc-general-contao-frontend",
"description": "DcGeneral frontend editing feature",
"license": "LGPL-3.0-or-later",
"type": "contao-bundle",
"keywords": [
"contao",
"dc-general",
"frontend"
],
"authors": [
{
"name":"Christian Schiffler",
"email":"c.schiffler@cyberspectrum.de",
"homepage":"https://www.cyberspectrum.de",
"role":"Developer"
"name": "Christian Schiffler",
"email": "c.schiffler@cyberspectrum.de",
"homepage": "https://www.cyberspectrum.de",
"role": "Developer"
},
{
"name":"Stefan Heimes",
"email":"stefan_heimes@hotmail.com",
"role":"Developer"
"name": "Stefan Heimes",
"email": "stefan_heimes@hotmail.com",
"role": "Developer"
}
],
"homepage": "https://c-c-a.org/",
"support": {
"email":"info@contao-community-alliance.org",
"issues":"https://github.com/contao-community-alliance/dc-general-contao-frontend/issues",
"wiki":"https://github.com/contao-community-alliance/dc-general-contao-frontend/wiki",
"irc":"irc://irc.freenode.org/contao.cca",
"source":"https://github.com/contao-community-alliance/dc-general-contao-frontend"
"email": "info@contao-community-alliance.org",
"issues": "https://github.com/contao-community-alliance/dc-general-contao-frontend/issues",
"wiki": "https://github.com/contao-community-alliance/dc-general-contao-frontend/wiki",
"source": "https://github.com/contao-community-alliance/dc-general-contao-frontend"
},
"require": {
"php": "^8.1",
"contao-community-alliance/dc-general": "^2.3",
"contao-community-alliance/translator": "^2.4.2",
"contao-community-alliance/url-builder": "^1.3",
"contao-community-alliance/translator": "^2.3",
"contao/core-bundle": "^4.13.0, <5.0",
"contao/core-bundle": "^4.13.0 <5.0",
"symfony/event-dispatcher": "^5.4"
},
"require-dev": {
"contao/manager-plugin": "^2.8",
"phpcq/runner-bootstrap": "^1.0@dev"
"contao/manager-bundle": "^4.13.0 <5.0",
"phpcq/runner-bootstrap": "^1.0@dev",
"roave/security-advisories": "dev-latest"
},
"autoload": {
"psr-4": {
"ContaoCommunityAlliance\\DcGeneral\\ContaoFrontend\\": "src"
}
},
"extra":{
"contao-manager-plugin": "ContaoCommunityAlliance\\DcGeneral\\ContaoFrontend\\ContaoManager\\Plugin",
"branch-alias": {
"dev-feature/2.3.0": "2.3.x-dev"
}
},
"config": {
"allow-plugins": {
"contao-components/installer": false,
"contao/manager-plugin": false,
"ocramius/package-versions": false,
"contao/manager-plugin": false
"php-http/discovery": true
}
},
"extra": {
"branch-alias": {
"dev-feature/2.3.0": "2.3.x-dev",
"dev-hotfix/update_phpcq": "2.3.x-dev"
},
"sort-packages": true
"contao-manager-plugin": "ContaoCommunityAlliance\\DcGeneral\\ContaoFrontend\\ContaoManager\\Plugin"
}
}
22 changes: 22 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0"?>
<psalm
errorLevel="3"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
>
<projectFiles>
<directory name="src"/>
<ignoreFiles>
<directory name="src/Resources"/>
</ignoreFiles>
</projectFiles>
<issueHandlers>
<TooManyArguments>
<errorLevel type="suppress">
<referencedFunction name="Doctrine\DBAL\Query\QueryBuilder::select"/>
</errorLevel>
</TooManyArguments>
</issueHandlers>
</psalm>
6 changes: 3 additions & 3 deletions src/CcaDcGeneralContaoFrontendBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* This file is part of contao-community-alliance/dc-general-contao-frontend.
*
* (c) 2015-2017 Contao Community Alliance.
* (c) 2015-2023 Contao Community Alliance.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -12,7 +12,8 @@
*
* @package contao-community-alliance/dc-general-contao-frontend
* @author Richard Henkenjohann <richardhenkenjohann@googlemail.com>
* @copyright 2015-2017 Contao Community Alliance.
* @author Ingolf Steinhardt <info@e-spin.de>
* @copyright 2015-2023 Contao Community Alliance.
* @license https://github.com/contao-community-alliance/dc-general-contao-frontend/blob/master/LICENSE LGPL-3.0
* @filesource
*/
Expand All @@ -26,5 +27,4 @@
*/
class CcaDcGeneralContaoFrontendBundle extends Bundle
{

}
10 changes: 5 additions & 5 deletions src/DependencyInjection/CcaDcGeneralContaoFrontendExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* This file is part of contao-community-alliance/dc-general-contao-frontend.
*
* (c) 2015-2017 Contao Community Alliance.
* (c) 2015-2023 Contao Community Alliance.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -12,7 +12,8 @@
*
* @package contao-community-alliance/dc-general-contao-frontend
* @author Richard Henkenjohann <richardhenkenjohann@googlemail.com>
* @copyright 2015-2017 Contao Community Alliance.
* @author Ingolf Steinhardt <info@e-spin.de>
* @copyright 2015-2023 Contao Community Alliance.
* @license https://github.com/contao-community-alliance/dc-general-contao-frontend/blob/master/LICENSE LGPL-3.0
* @filesource
*/
Expand All @@ -29,11 +30,10 @@
*/
class CcaDcGeneralContaoFrontendExtension extends Extension
{

/**
* The files to load.
*
* @var array
* @var string[]
*/
private static $files = [
'listeners.yml',
Expand All @@ -43,7 +43,7 @@ class CcaDcGeneralContaoFrontendExtension extends Extension
/**
* {@inheritDoc}
*/
public function load(array $configs, ContainerBuilder $container)
public function load(array $configs, ContainerBuilder $container): void
{
$loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
foreach (static::$files as $file) {
Expand Down
Loading

0 comments on commit 4501309

Please sign in to comment.