Skip to content

Commit 514d9c0

Browse files
authored
chore: adopt Nextcloud's coding standard, .editorconfig and NC 34 (#493)
* chore: adopt nextcloud/coding-standard, .editorconfig and NC 34 Configuration only. The reformat is the next commit on purpose, so .git-blame-ignore-revs can name a revision containing nothing but whitespace. - .php-cs-fixer.dist.php + conduction/coding-standard, which extends nextcloud/coding-standard and can only ADD to it — enforced by that package's invariant test, not by review. - cs:check / cs:fix now run php-cs-fixer. They were aliases for phpcs/phpcbf, so the documented Nextcloud command reformatted code AWAY from Nextcloud's standard. - nextcloud/coding-standard dropped as a direct dependency. It arrives transitively at a version conduction/coding-standard has tested against; declared directly it was a dead dependency with no config and no invocation. - phpcs.xml is now a stub over the shared semantics-only ruleset, and the local phpcs-custom-sniffs/ copy is gone. The fleet was carrying six divergent versions of NamedParametersSniff.php — a custom RULE, not a setting. - .editorconfig, verbatim from nextcloud/server. No fleet app had one, so an editor configured by someone's previous Nextcloud work defaulted to tabs, which the old ruleset then rejected. - nextcloud/ocp -> ^34.0 and PHPUnit -> stable34. This app declared support for NC 34 while being analysed against 31, so a symbol REMOVED in 32/33/34 was invisible to the type checker. That is why the NC 34 removal of \OC::$server needed a hand-written PHPCS sniff. - the stylelint glob is quoted, so stylelint expands it rather than the shell. Unquoted, src/**/ matches exactly one directory level and nested components are silently unlinted. gate-65 (coding-standard-adoption) enforces all of the above from ConductionNL/.github@main. This app failed it; with this commit it passes. * style: reformat with nextcloud/coding-standard — whitespace only Applied by php-cs-fixer with conduction/coding-standard. Tabs, same-line braces, (int)$x, single-space concatenation, ordered imports — Nextcloud's dialect, which this app now passes unchanged. 210 file(s), no behaviour change. Isolated from the configuration change so .git-blame-ignore-revs can name a revision that touches nothing but formatting. Reviewing it line by line is not a useful activity; the previous commit is the review. * chore: ignore the reformat commit in git blame a78e00a touches 210 files and changes no behaviour. Without this, every line it reflowed attributes to it and the real author is one --skip away. GitHub honours the file automatically; locally it needs `git config blame.ignoreRevsFile .git-blame-ignore-revs` once. * fix: regenerate composer.lock for the new constraints The previous commit changed composer.json without touching the lock, so `composer install` refused with exit 4 and EVERY PHP job failed: Required (in require-dev) package "conduction/coding-standard" is not present in the lock file. Required (in require-dev) package "conduction/hydra-gates" is not present in the lock file. Required (in require-dev) package "nextcloud/ocp" is in the lock file as "v31.0.9" but that does not satisfy your constraint "^34.0". Nothing was wrong with the reformat or the ruleset — the jobs never got as far as running a tool. Measured on larpingapp#313 before this fix: phpcs, psalm, phpstan and both PHPUnit legs red, all of them at `composer install`. Hydra Gates passed in the same run, because it does not install composer dependencies. Now locked at conduction/coding-standard v1.0.0, conduction/hydra-gates v1.7.0, nextcloud/ocp v34.0.2 — the last of which is the point of the exercise: this app declares support for NC 34 and is now analysed against it. * fix(appinfo): order info.xml elements per the App Store xs:sequence The App Store's info.xsd declares <info> and its children as xs:sequence, so element ORDER is significant. This file was rejected by `xmllint --noout --schema info.xsd appinfo/info.xml`. Nextcloud's lint-info-xml workflow validates against exactly that schema, and ConductionNL/.github#383 adds the same check to the shared pipeline. Elements were moved into the schema's order. Nothing was added, removed or reworded; <version> and the <nextcloud> min/max-version declaration are unchanged. Verified: `xmllint --noout --schema info.xsd appinfo/info.xml` reports "validates" (libxml2 2.12.10). The pre-change file failed the same command. * fix(static-analysis): repair what the nextcloud/ocp 31 -> 34 bump and the elseif normalisation surfaced PHPStan (5 errors), all from the OCP 31 -> 34 stub change: - IQueryBuilder::execute() is gone from the OCP 34 interface. The four call sites in OrganizationSyncService are all SELECTs, so they become executeQuery(); no behaviour change. - TemplateResponse's 4th constructor argument is $renderAs (a string enum), not the HTTP status; the 5th is int $status. The error branch in DashboardController passed '500' as $renderAs, so it rendered with an invalid layout and still returned HTTP 200. It now passes RENDER_AS_ERROR plus STATUS_INTERNAL_SERVER_ERROR. Psalm (2 ParadoxicalCondition errors): extractPropertyDefinitionMap in ArchiMateService and ArchiMateImportService each end with an elseif that repeats the opening if verbatim, so the third branch is unreachable. The duplicate is pre-existing (origin/development ArchiMateService.php:2437); what changed is that php-cs-fixer rewrote 'else if' to 'elseif', and Psalm reports the elseif form as ParadoxicalCondition but the 'else if' form as NoValue -- and psalm.xml suppresses NoValue. Verified with a two-file control. Removing the unreachable branch is behaviour-identical. * ci: re-trigger Code Quality The previous run produced zero jobs and concluded failure: it started inside the window where ConductionNL/.github@main carried the broken quality.yml splice from b745bf2f, repaired at 4118bca8. Nothing in this PR touches the workflow.
1 parent 088e14c commit 514d9c0

222 files changed

Lines changed: 85504 additions & 89248 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# https://editorconfig.org
2+
3+
# SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
4+
# SPDX-License-Identifier: AGPL-3.0-or-later
5+
6+
root = true
7+
8+
[*]
9+
charset = utf-8
10+
end_of_line = lf
11+
indent_size = 4
12+
indent_style = tab
13+
insert_final_newline = true
14+
trim_trailing_whitespace = true
15+
16+
[*.yml]
17+
indent_size = 2
18+
indent_style = space
19+
20+
[*.md]
21+
trim_trailing_whitespace = false
22+
23+
[*.svg]
24+
insert_final_newline = false
25+
26+
[package*.json]
27+
indent_size = 2
28+
indent_style = space
29+
30+
[build/psalm-baseline.xml]
31+
indent_size = 2
32+
indent_style = space
33+
34+
[config/*config.php]
35+
indent_size = 2
36+
indent_style = space

.git-blame-ignore-revs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,16 @@
1-
# Retrofit annotation commit (opsx-annotate, 2026-05-24)
2-
e7a6be7bfd26417b65dbca481ff0468821434f61
1+
# Revisions to skip in `git blame`.
2+
#
3+
# Enable locally, once:
4+
# git config blame.ignoreRevsFile .git-blame-ignore-revs
5+
#
6+
# GitHub reads this file automatically. Your terminal does not, until you run
7+
# the line above.
8+
#
9+
# Only ever add commits that change formatting and NOTHING else. A commit listed
10+
# here becomes invisible to blame, so a behaviour change hidden inside one would
11+
# be very hard to find later.
12+
13+
# style: reformat with nextcloud/coding-standard — whitespace only
14+
# The fleet-wide move from a PEAR-derived PHPCS ruleset (4 spaces, next-line
15+
# braces) to Nextcloud's own standard (tabs, same-line braces).
16+
a78e00aa9f0e963156dc4c58277776c783837a2d

.github/workflows/code-quality.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
with:
6161
app-name: softwarecatalog
6262
php-version: "8.3"
63-
nextcloud-test-refs: '["stable32"]'
63+
nextcloud-test-refs: '["stable34"]'
6464
enable-psalm: true
6565
enable-phpstan: true
6666
enable-phpmetrics: true

.php-cs-fixer.dist.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
// SPDX-FileCopyrightText: 2026 Conduction
4+
// SPDX-License-Identifier: EUPL-1.2
5+
6+
// The require_once is NOT optional. php-cs-fixer includes this file before the
7+
// app's autoloader runs, so without it the run dies with "Class not found" —
8+
// and in --format=json that fatal is reported as ZERO FILES NEEDING CHANGES,
9+
// which reads exactly like a clean tree.
10+
require_once __DIR__ . '/vendor/autoload.php';
11+
12+
$config = new Conduction\CodingStandard\Config();
13+
$config->getFinder()
14+
->notPath('vendor')
15+
->notPath('node_modules')
16+
->notPath('build')
17+
->in(__DIR__ . '/lib')
18+
->in(__DIR__ . '/tests');
19+
20+
return $config;

appinfo/info.xml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,20 @@ Vrij en open source onder de EUPL-licentie.
8787
CI already tests stable32 only, so this changes the advertised app-store
8888
range and nothing about what runs.
8989
-->
90-
<nextcloud min-version="32" max-version="34"/>
9190
<php min-version="8.3" min-int-size="64"/>
9291
<database min-version="10">pgsql</database>
9392
<database>sqlite</database>
9493
<database min-version="8.0">mysql</database>
94+
<nextcloud min-version="32" max-version="34"/>
9595
</dependencies>
9696

97+
<background-jobs>
98+
<job>OCA\SoftwareCatalog\BackgroundJob\OrganizationContactSyncJob</job>
99+
<job>OCA\SoftwareCatalog\BackgroundJob\ContractStatusJob</job>
100+
<job>OCA\SoftwareCatalog\BackgroundJob\FederationSyncJob</job>
101+
<job>OCA\SoftwareCatalog\BackgroundJob\EolSyncJob</job>
102+
</background-jobs>
103+
97104
<repair-steps>
98105
<post-migration>
99106
<step>OCA\SoftwareCatalog\Repair\InitializeSettings</step>
@@ -110,12 +117,10 @@ Vrij en open source onder de EUPL-licentie.
110117
</post-migration>
111118
</repair-steps>
112119

113-
<background-jobs>
114-
<job>OCA\SoftwareCatalog\BackgroundJob\OrganizationContactSyncJob</job>
115-
<job>OCA\SoftwareCatalog\BackgroundJob\ContractStatusJob</job>
116-
<job>OCA\SoftwareCatalog\BackgroundJob\FederationSyncJob</job>
117-
<job>OCA\SoftwareCatalog\BackgroundJob\EolSyncJob</job>
118-
</background-jobs>
120+
<settings>
121+
<admin>OCA\SoftwareCatalog\Settings\SoftwareCatalogAdmin</admin>
122+
<admin-section>OCA\SoftwareCatalog\Sections\SoftwareCatalogAdmin</admin-section>
123+
</settings>
119124

120125
<navigations>
121126
<navigation>
@@ -125,9 +130,4 @@ Vrij en open source onder de EUPL-licentie.
125130
<icon>app.svg</icon>
126131
</navigation>
127132
</navigations>
128-
129-
<settings>
130-
<admin>OCA\SoftwareCatalog\Settings\SoftwareCatalogAdmin</admin>
131-
<admin-section>OCA\SoftwareCatalog\Sections\SoftwareCatalogAdmin</admin-section>
132-
</settings>
133133
</info>

composer.json

Lines changed: 108 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -1,109 +1,110 @@
11
{
2-
"name": "conductionnl/softwarecatalog",
3-
"description": "Quickly build data registers based on schema.json",
4-
"license": "EUPL-1.2",
5-
"authors": [
6-
{
7-
"name": "Conduction b.v.",
8-
"email": "info@conduction.nl",
9-
"homepage": "https://conduction.nl"
10-
}
11-
],
12-
"autoload": {
13-
"psr-4": {
14-
"OCA\\SoftwareCatalog\\": "lib/"
15-
}
16-
},
17-
"scripts": {
18-
"post-install-cmd": [
19-
"@composer bin all install --ansi"
20-
],
21-
"post-update-cmd": [
22-
"@composer bin all update --ansi"
23-
],
24-
"lint": "find . -name \\*.php -not -path './vendor/*' -not -path './vendor-bin/*' -not -path './build/*' -print0 | xargs -0 -n1 php -l",
25-
"cs:check": "./vendor/bin/phpcs --standard=phpcs.xml",
26-
"cs:fix": "./vendor/bin/phpcbf --standard=phpcs.xml",
27-
"phpcs": "./vendor/bin/phpcs --standard=phpcs.xml",
28-
"phpcs:fix": "./vendor/bin/phpcbf --standard=phpcs.xml",
29-
"phpcs:output": "./vendor/bin/phpcs --standard=phpcs.xml --report=json lib/ 2>/dev/null | tail -1 > phpcs-output.json",
30-
"phpmd": "E=0; ./vendor/bin/phpmd lib text phpmd.xml --baseline-file phpmd.baseline.xml || E=$?; ./vendor/bin/phpmd lib text phpmd-unusedparams.xml --baseline-file phpmd.baseline.xml || E=$?; exit $E",
31-
"phpmetrics": "./vendor/bin/phpmetrics --report-html=phpmetrics lib/",
32-
"phpmetrics:violations": "./vendor/bin/phpmetrics --violations-xml=phpmetrics/violations.xml lib/",
33-
"psalm": "if [ -f vendor/bin/psalm ]; then ./vendor/bin/psalm --threads=1 --no-cache; else echo 'Psalm not installed, skipping...'; fi",
34-
"phpstan": "if [ -f vendor/bin/phpstan ]; then ./vendor/bin/phpstan analyse --memory-limit=1G; else echo 'PHPStan not installed, skipping...'; fi",
35-
"test:unit": "phpunit tests -c tests/phpunit.xml --colors=always --fail-on-warning --fail-on-risky",
36-
"test:all": "if [ ! -f vendor/bin/phpunit ]; then echo 'SKIPPED: phpunit not installed - run composer install'; elif [ ! -f ../../lib/base.php ]; then echo 'SKIPPED: tests/bootstrap.php requires a Nextcloud server tree (../../lib/base.php not found) - run from inside a Nextcloud checkout or in CI'; else ./vendor/bin/phpunit --colors=always; fi",
37-
"check": "E=0; for CMD in lint phpcs psalm test:unit; do echo; echo \"=== $CMD ===\"; composer $CMD || E=1; done; echo; if [ $E -eq 0 ]; then echo \"ALL CHECKS PASSED\"; else echo \"SOME CHECKS FAILED (see above)\"; fi; exit $E",
38-
"check:full": "E=0; for CMD in lint phpcs psalm phpstan test:all; do echo; echo \"=== $CMD ===\"; composer $CMD || E=1; done; echo; if [ $E -eq 0 ]; then echo \"ALL CHECKS PASSED\"; else echo \"SOME CHECKS FAILED (see above)\"; fi; exit $E",
39-
"check:strict": "E=0; for CMD in lint phpcs phpmd psalm phpstan test:all; do echo; echo \"=== $CMD ===\"; composer $CMD || E=1; done; echo; if [ $E -eq 0 ]; then echo \"ALL CHECKS PASSED\"; else echo \"SOME CHECKS FAILED (see above)\"; fi; exit $E",
40-
"fix": [
41-
"@cs:fix"
42-
],
43-
"openapi": "generate-spec",
44-
"phpqa": "./vendor/bin/phpqa --report --analyzedDirs lib --buildDir phpqa",
45-
"phpqa:full": "./vendor/bin/phpqa --report --analyzedDirs lib --buildDir phpqa --tools phpcs:0,phpmd:0,phploc:0,phpmetrics,phpcpd:0,parallel-lint:0",
46-
"phpqa:ci": "./vendor/bin/phpqa --report --analyzedDirs lib --buildDir phpqa --tools phpcs,phpmd,phploc,phpmetrics,phpcpd,parallel-lint",
47-
"qa:check": [
48-
"@phpqa"
49-
],
50-
"qa:full": [
51-
"@phpqa:full"
52-
],
53-
"test:coverage": "./vendor/bin/phpunit --coverage-html=coverage/html --coverage-clover=coverage/clover.xml --colors=always",
54-
"coverage:check": "php -r \"\\$xml = simplexml_load_file('coverage/clover.xml'); \\$metrics = \\$xml->project->metrics; \\$statements = (int)\\$metrics['statements']; \\$covered = (int)\\$metrics['coveredstatements']; \\$percentage = \\$statements > 0 ? round((\\$covered / \\$statements) * 100, 2) : 0; echo 'Coverage: ' . \\$percentage . '%' . PHP_EOL; exit(\\$percentage < 75 ? 1 : 0);\"",
55-
"quality:phpcs-score": "./vendor/bin/phpcs --standard=phpcs.xml --report=json lib/ | php -r \"\\$json = json_decode(file_get_contents('php://stdin'), true); \\$errors = \\$json['totals']['errors'] ?? 0; \\$warnings = \\$json['totals']['warnings'] ?? 0; \\$score = 1000 - \\$errors - (\\$warnings / 2); echo 'PHPCS Score: ' . \\$score . ' (Errors: ' . \\$errors . ', Warnings: ' . \\$warnings . ')' . PHP_EOL;\"",
56-
"quality:phpmd-score": "phpmd lib/ json phpmd.xml | php -r \"\\$input = file_get_contents('php://stdin'); \\$json = json_decode(\\$input, true); \\$violations = count(\\$json['files'] ?? []); \\$score = 1000 - (\\$violations * 10); echo 'PHPMD Score: ' . \\$score . ' (Violations: ' . \\$violations . ')' . PHP_EOL;\" || echo 'PHPMD not available'",
57-
"quality:psalm-score": "./vendor/bin/psalm --output-format=json --no-cache | php -r \"\\$input = file_get_contents('php://stdin'); \\$json = json_decode(\\$input, true); \\$errors = count(\\$json ?? []); \\$score = 1000 - (\\$errors * 5); echo 'Psalm Score: ' . \\$score . ' (Errors: ' . \\$errors . ')' . PHP_EOL;\" || echo 'Psalm not available'",
58-
"quality:phpstan-score": "./vendor/bin/phpstan analyse --memory-limit=1G --error-format=json --no-progress | php -r \"\\$input = file_get_contents('php://stdin'); \\$json = json_decode(\\$input, true); \\$errors = \\$json['totals']['file_errors'] ?? 0; \\$score = 1000 - (\\$errors * 5); echo 'PHPStan Score: ' . \\$score . ' (Errors: ' . \\$errors . ')' . PHP_EOL;\" || echo 'PHPStan not available'",
59-
"quality:score": [
60-
"@quality:phpcs-score",
61-
"@quality:phpmd-score",
62-
"@quality:psalm-score",
63-
"@quality:phpstan-score"
64-
]
65-
},
66-
"require": {
67-
"php": "^8.3",
68-
"adbario/php-dot-notation": "^3.3.0",
69-
"bamarni/composer-bin-plugin": "^1.8",
70-
"react/event-loop": "^1.5",
71-
"react/promise": "^3.2",
72-
"symfony/amazon-mailer": "^6.4",
73-
"symfony/http-client": "^6.4",
74-
"symfony/mailer": "^6.4",
75-
"symfony/mailgun-mailer": "^6.4",
76-
"symfony/mailjet-mailer": "^6.4",
77-
"symfony/postmark-mailer": "^6.4",
78-
"symfony/sendgrid-mailer": "^6.4",
79-
"twig/twig": "^3.27.0"
80-
},
81-
"require-dev": {
82-
"cyclonedx/cyclonedx-php-composer": "^6.2",
83-
"edgedesign/phpqa": "^1.27",
84-
"guzzlehttp/guzzle": "^7.8",
85-
"nextcloud/coding-standard": "^1.4",
86-
"nextcloud/ocp": "^31.0",
87-
"phpcsstandards/phpcsextra": "^1.4",
88-
"phpmd/phpmd": "^2.15",
89-
"phpmetrics/phpmetrics": "^2.8",
90-
"phpstan/phpstan": "^1.10",
91-
"phpunit/phpunit": "^10.5",
92-
"roave/security-advisories": "dev-latest",
93-
"squizlabs/php_codesniffer": "^3.9",
94-
"vimeo/psalm": "^5.26"
95-
},
96-
"config": {
97-
"allow-plugins": {
98-
"bamarni/composer-bin-plugin": true,
99-
"php-http/discovery": true,
100-
"dealerdirect/phpcodesniffer-composer-installer": true,
101-
"cyclonedx/cyclonedx-php-composer": true
102-
},
103-
"optimize-autoloader": true,
104-
"sort-packages": true,
105-
"platform": {
106-
"php": "8.3"
107-
}
108-
}
2+
"name": "conductionnl/softwarecatalog",
3+
"description": "Quickly build data registers based on schema.json",
4+
"license": "EUPL-1.2",
5+
"authors": [
6+
{
7+
"name": "Conduction b.v.",
8+
"email": "info@conduction.nl",
9+
"homepage": "https://conduction.nl"
10+
}
11+
],
12+
"autoload": {
13+
"psr-4": {
14+
"OCA\\SoftwareCatalog\\": "lib/"
15+
}
16+
},
17+
"scripts": {
18+
"post-install-cmd": [
19+
"@composer bin all install --ansi"
20+
],
21+
"post-update-cmd": [
22+
"@composer bin all update --ansi"
23+
],
24+
"lint": "find . -name \\*.php -not -path './vendor/*' -not -path './vendor-bin/*' -not -path './build/*' -print0 | xargs -0 -n1 php -l",
25+
"cs:check": "php-cs-fixer fix --dry-run --diff",
26+
"cs:fix": "php-cs-fixer fix",
27+
"phpcs": "./vendor/bin/phpcs --standard=phpcs.xml",
28+
"phpcs:fix": "./vendor/bin/phpcbf --standard=phpcs.xml",
29+
"phpcs:output": "./vendor/bin/phpcs --standard=phpcs.xml --report=json lib/ 2>/dev/null | tail -1 > phpcs-output.json",
30+
"phpmd": "E=0; ./vendor/bin/phpmd lib text phpmd.xml --baseline-file phpmd.baseline.xml || E=$?; ./vendor/bin/phpmd lib text phpmd-unusedparams.xml --baseline-file phpmd.baseline.xml || E=$?; exit $E",
31+
"phpmetrics": "./vendor/bin/phpmetrics --report-html=phpmetrics lib/",
32+
"phpmetrics:violations": "./vendor/bin/phpmetrics --violations-xml=phpmetrics/violations.xml lib/",
33+
"psalm": "if [ -f vendor/bin/psalm ]; then ./vendor/bin/psalm --threads=1 --no-cache; else echo 'Psalm not installed, skipping...'; fi",
34+
"phpstan": "if [ -f vendor/bin/phpstan ]; then ./vendor/bin/phpstan analyse --memory-limit=1G; else echo 'PHPStan not installed, skipping...'; fi",
35+
"test:unit": "phpunit tests -c tests/phpunit.xml --colors=always --fail-on-warning --fail-on-risky",
36+
"test:all": "if [ ! -f vendor/bin/phpunit ]; then echo 'SKIPPED: phpunit not installed - run composer install'; elif [ ! -f ../../lib/base.php ]; then echo 'SKIPPED: tests/bootstrap.php requires a Nextcloud server tree (../../lib/base.php not found) - run from inside a Nextcloud checkout or in CI'; else ./vendor/bin/phpunit --colors=always; fi",
37+
"check": "E=0; for CMD in lint phpcs psalm test:unit; do echo; echo \"=== $CMD ===\"; composer $CMD || E=1; done; echo; if [ $E -eq 0 ]; then echo \"ALL CHECKS PASSED\"; else echo \"SOME CHECKS FAILED (see above)\"; fi; exit $E",
38+
"check:full": "E=0; for CMD in lint phpcs psalm phpstan test:all; do echo; echo \"=== $CMD ===\"; composer $CMD || E=1; done; echo; if [ $E -eq 0 ]; then echo \"ALL CHECKS PASSED\"; else echo \"SOME CHECKS FAILED (see above)\"; fi; exit $E",
39+
"check:strict": "E=0; for CMD in lint phpcs phpmd psalm phpstan test:all; do echo; echo \"=== $CMD ===\"; composer $CMD || E=1; done; echo; if [ $E -eq 0 ]; then echo \"ALL CHECKS PASSED\"; else echo \"SOME CHECKS FAILED (see above)\"; fi; exit $E",
40+
"fix": [
41+
"@cs:fix"
42+
],
43+
"openapi": "generate-spec",
44+
"phpqa": "./vendor/bin/phpqa --report --analyzedDirs lib --buildDir phpqa",
45+
"phpqa:full": "./vendor/bin/phpqa --report --analyzedDirs lib --buildDir phpqa --tools phpcs:0,phpmd:0,phploc:0,phpmetrics,phpcpd:0,parallel-lint:0",
46+
"phpqa:ci": "./vendor/bin/phpqa --report --analyzedDirs lib --buildDir phpqa --tools phpcs,phpmd,phploc,phpmetrics,phpcpd,parallel-lint",
47+
"qa:check": [
48+
"@phpqa"
49+
],
50+
"qa:full": [
51+
"@phpqa:full"
52+
],
53+
"test:coverage": "./vendor/bin/phpunit --coverage-html=coverage/html --coverage-clover=coverage/clover.xml --colors=always",
54+
"coverage:check": "php -r \"\\$xml = simplexml_load_file('coverage/clover.xml'); \\$metrics = \\$xml->project->metrics; \\$statements = (int)\\$metrics['statements']; \\$covered = (int)\\$metrics['coveredstatements']; \\$percentage = \\$statements > 0 ? round((\\$covered / \\$statements) * 100, 2) : 0; echo 'Coverage: ' . \\$percentage . '%' . PHP_EOL; exit(\\$percentage < 75 ? 1 : 0);\"",
55+
"quality:phpcs-score": "./vendor/bin/phpcs --standard=phpcs.xml --report=json lib/ | php -r \"\\$json = json_decode(file_get_contents('php://stdin'), true); \\$errors = \\$json['totals']['errors'] ?? 0; \\$warnings = \\$json['totals']['warnings'] ?? 0; \\$score = 1000 - \\$errors - (\\$warnings / 2); echo 'PHPCS Score: ' . \\$score . ' (Errors: ' . \\$errors . ', Warnings: ' . \\$warnings . ')' . PHP_EOL;\"",
56+
"quality:phpmd-score": "phpmd lib/ json phpmd.xml | php -r \"\\$input = file_get_contents('php://stdin'); \\$json = json_decode(\\$input, true); \\$violations = count(\\$json['files'] ?? []); \\$score = 1000 - (\\$violations * 10); echo 'PHPMD Score: ' . \\$score . ' (Violations: ' . \\$violations . ')' . PHP_EOL;\" || echo 'PHPMD not available'",
57+
"quality:psalm-score": "./vendor/bin/psalm --output-format=json --no-cache | php -r \"\\$input = file_get_contents('php://stdin'); \\$json = json_decode(\\$input, true); \\$errors = count(\\$json ?? []); \\$score = 1000 - (\\$errors * 5); echo 'Psalm Score: ' . \\$score . ' (Errors: ' . \\$errors . ')' . PHP_EOL;\" || echo 'Psalm not available'",
58+
"quality:phpstan-score": "./vendor/bin/phpstan analyse --memory-limit=1G --error-format=json --no-progress | php -r \"\\$input = file_get_contents('php://stdin'); \\$json = json_decode(\\$input, true); \\$errors = \\$json['totals']['file_errors'] ?? 0; \\$score = 1000 - (\\$errors * 5); echo 'PHPStan Score: ' . \\$score . ' (Errors: ' . \\$errors . ')' . PHP_EOL;\" || echo 'PHPStan not available'",
59+
"quality:score": [
60+
"@quality:phpcs-score",
61+
"@quality:phpmd-score",
62+
"@quality:psalm-score",
63+
"@quality:phpstan-score"
64+
]
65+
},
66+
"require": {
67+
"php": "^8.3",
68+
"adbario/php-dot-notation": "^3.3.0",
69+
"bamarni/composer-bin-plugin": "^1.8",
70+
"react/event-loop": "^1.5",
71+
"react/promise": "^3.2",
72+
"symfony/amazon-mailer": "^6.4",
73+
"symfony/http-client": "^6.4",
74+
"symfony/mailer": "^6.4",
75+
"symfony/mailgun-mailer": "^6.4",
76+
"symfony/mailjet-mailer": "^6.4",
77+
"symfony/postmark-mailer": "^6.4",
78+
"symfony/sendgrid-mailer": "^6.4",
79+
"twig/twig": "^3.27.0"
80+
},
81+
"require-dev": {
82+
"conduction/coding-standard": "^1.0",
83+
"conduction/hydra-gates": "^1.0",
84+
"cyclonedx/cyclonedx-php-composer": "^6.2",
85+
"edgedesign/phpqa": "^1.27",
86+
"guzzlehttp/guzzle": "^7.8",
87+
"nextcloud/ocp": "^34.0",
88+
"phpcsstandards/phpcsextra": "^1.4",
89+
"phpmd/phpmd": "^2.15",
90+
"phpmetrics/phpmetrics": "^2.8",
91+
"phpstan/phpstan": "^1.10",
92+
"phpunit/phpunit": "^10.5",
93+
"roave/security-advisories": "dev-latest",
94+
"squizlabs/php_codesniffer": "^3.9",
95+
"vimeo/psalm": "^5.26"
96+
},
97+
"config": {
98+
"allow-plugins": {
99+
"bamarni/composer-bin-plugin": true,
100+
"php-http/discovery": true,
101+
"dealerdirect/phpcodesniffer-composer-installer": true,
102+
"cyclonedx/cyclonedx-php-composer": true
103+
},
104+
"optimize-autoloader": true,
105+
"sort-packages": true,
106+
"platform": {
107+
"php": "8.3"
108+
}
109+
}
109110
}

0 commit comments

Comments
 (0)