Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated code standards. #89

Merged
merged 3 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "drevops/git-artifact",
"type": "package",
"description": "Build artifact from your codebase in CI and push it to a separate git repo.",
"license": "GPL-2.0-or-later",
"type": "package",
"authors": [
{
"name": "Alex Skrypnyk",
Expand All @@ -28,6 +28,7 @@
"bamarni/composer-bin-plugin": "^1.8",
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
"drupal/coder": "^8.3",
"ergebnis/composer-normalize": "^2.43",
"phpmd/phpmd": "^2.15",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^10.5",
Expand All @@ -43,13 +44,22 @@
"DrevOps\\GitArtifact\\Tests\\": "tests/phpunit"
}
},
"bin": [
"git-artifact"
],
"config": {
"allow-plugins": {
"bamarni/composer-bin-plugin": true,
"dealerdirect/phpcodesniffer-composer-installer": true
"dealerdirect/phpcodesniffer-composer-installer": true,
"ergebnis/composer-normalize": true
}
},
"scripts": {
"build": [
"@composer bin box require --dev humbug/box",
"box validate",
"box compile"
],
"lint": [
"phpcs",
"phpmd --exclude vendor,vendor-bin,node_modules . text phpmd.xml",
Expand All @@ -60,14 +70,7 @@
"rector --clear-cache",
"phpcbf"
],
"test": "if [ \"${XDEBUG_MODE}\" = 'coverage' ]; then phpunit; else phpunit --no-coverage; fi",
"build": [
"@composer bin box require --dev humbug/box",
"box validate",
"box compile"
]
},
"bin": [
"git-artifact"
]
"reset": "rm -rf vendor vendor-bin composer.lock",
"test": "if [ \"${XDEBUG_MODE}\" = 'coverage' ]; then phpunit; else phpunit --no-coverage; fi"
}
}
2 changes: 1 addition & 1 deletion src/Traits/TokenTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ trait TokenTrait {
protected function tokenProcess(string $string): ?string {
/* @phpstan-ignore-next-line */
return preg_replace_callback('/(?:\[([^\]]+)\])/', function (array $match) {
if (count($match) > 1) {
if (!empty($match[1])) {
$parts = explode(':', $match[1], 2);
$token = $parts[0] ?? NULL;
$argument = $parts[1] ?? NULL;
Expand Down
Loading