From 8333846003a045ba22d8fb8aec8270baa2591015 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 26 Feb 2020 09:13:59 +0100 Subject: [PATCH 1/2] Add PHP action workflow --- .github/workflows/php.yml | 47 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/php.yml diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 0000000..dff9dd8 --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,47 @@ +name: PHP Tests + +on: + push: + branches: + - master + - release/* + pull_request: + branches: + - master + +jobs: + lint: + name: Static analysis for php ${{ matrix.php }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4'] + os: ['ubuntu-latest'] + include: + - php: '5.6' + allow_failure: true + - php: '7.0' + allow_failure: true + + steps: + - name: Checkout code base + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v1 + with: + php-version: ${{ matrix.php }} + tools: phpcs + + - name: Setup dependencies + run: composer require -n --no-progress overtrue/phplint + + - name: PHP Lint + if: success() || matrix.allow_failure + run: ./vendor/bin/phplint -n --exclude={^vendor/.*} -- . + + - name: PHP CodeSniffer + if: success() || matrix.allow_failure + run: phpcs From 144bcdf852d7eddb3e08c89eea7006789bb5e96d Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 26 Feb 2020 09:19:31 +0100 Subject: [PATCH 2/2] Remove space after reference operators --- application/forms/AddNodeForm.php | 2 +- application/forms/EditNodeForm.php | 2 +- .../Businessprocess/Storage/LegacyConfigParser.php | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/application/forms/AddNodeForm.php b/application/forms/AddNodeForm.php index 2c0c36c..591f37a 100644 --- a/application/forms/AddNodeForm.php +++ b/application/forms/AddNodeForm.php @@ -452,7 +452,7 @@ class AddNodeForm extends QuickForm * @param BpNode $node * @param BpNode[] $parents */ - protected function collectAllParents(BpNode $node, array & $parents) + protected function collectAllParents(BpNode $node, array &$parents) { foreach ($node->getParents() as $parent) { $parents[$parent->getName()] = $parent; diff --git a/application/forms/EditNodeForm.php b/application/forms/EditNodeForm.php index 02f9337..429a8f2 100644 --- a/application/forms/EditNodeForm.php +++ b/application/forms/EditNodeForm.php @@ -375,7 +375,7 @@ class EditNodeForm extends QuickForm * @param BpNode $node * @param BpNode[] $parents */ - protected function collectAllParents(BpNode $node, array & $parents) + protected function collectAllParents(BpNode $node, array &$parents) { foreach ($node->getParents() as $parent) { $parents[$parent->getName()] = $parent; diff --git a/library/Businessprocess/Storage/LegacyConfigParser.php b/library/Businessprocess/Storage/LegacyConfigParser.php index 4293b1e..d4325cf 100644 --- a/library/Businessprocess/Storage/LegacyConfigParser.php +++ b/library/Businessprocess/Storage/LegacyConfigParser.php @@ -140,7 +140,7 @@ class LegacyConfigParser return $metadata; } - public static function readMetadataFromString($name, & $string) + public static function readMetadataFromString($name, &$string) { $metadata = new Metadata($name); @@ -201,7 +201,7 @@ class LegacyConfigParser * @param $line * @param BpConfig $bp */ - protected function parseDisplay(& $line, BpConfig $bp) + protected function parseDisplay(&$line, BpConfig $bp) { list($display, $name, $desc) = preg_split('~\s*;\s*~', substr($line, 8), 3); $bp->getBpNode($name)->setAlias($desc)->setDisplay($display); @@ -214,26 +214,26 @@ class LegacyConfigParser * @param $line * @param BpConfig $bp */ - protected function parseExternalInfo(& $line, BpConfig $bp) + protected function parseExternalInfo(&$line, BpConfig $bp) { list($name, $script) = preg_split('~\s*;\s*~', substr($line, 14), 2); $bp->getBpNode($name)->setInfoCommand($script); } - protected function parseExtraInfo(& $line, BpConfig $bp) + protected function parseExtraInfo(&$line, BpConfig $bp) { // TODO: Not yet // list($name, $script) = preg_split('~\s*;\s*~', substr($line, 14), 2); // $this->getNode($name)->setExtraInfo($script); } - protected function parseInfoUrl(& $line, BpConfig $bp) + protected function parseInfoUrl(&$line, BpConfig $bp) { list($name, $url) = preg_split('~\s*;\s*~', substr($line, 9), 2); $bp->getBpNode($name)->setInfoUrl($url); } - protected function parseExtraLine(& $line, $typeLength, BpConfig $bp) + protected function parseExtraLine(&$line, $typeLength, BpConfig $bp) { $type = substr($line, 0, $typeLength); if (substr($type, 0, 7) === 'display') { @@ -270,7 +270,7 @@ class LegacyConfigParser * * @throws ConfigurationError */ - protected function parseLine(& $line) + protected function parseLine(&$line) { $bp = $this->config; $line = trim($line);