diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2ca2ce61f..d2c805140 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -34,5 +34,5 @@ jobs: - name: Run PHPUnit run: ./vendor/bin/phpunit --testdox - - name: Run PHPStan - run: ./vendor/bin/phpstan + - name: Run PHPCS + run: ./vendor/bin/phpcs --standard=PSR2 src/ --colors -n diff --git a/src/Collection/StaticBufferCollection.php b/src/Collection/StaticBufferCollection.php index a45decae6..451c4f78f 100644 --- a/src/Collection/StaticBufferCollection.php +++ b/src/Collection/StaticBufferCollection.php @@ -25,7 +25,7 @@ class StaticBufferCollection extends StaticCollection * StaticBufferCollection constructor. * @param BufferInterface ...$values */ - public function __construct(BufferInterface... $values) + public function __construct(BufferInterface ...$values) { $this->set = $values; } diff --git a/src/Key/Deterministic/HierarchicalKeySequence.php b/src/Key/Deterministic/HierarchicalKeySequence.php index eedf7269e..4d447f00b 100644 --- a/src/Key/Deterministic/HierarchicalKeySequence.php +++ b/src/Key/Deterministic/HierarchicalKeySequence.php @@ -64,7 +64,7 @@ public function decodeRelative(string $path): array * @param string ...$parts * @return int[] */ - private function decodeDerivation(string... $parts): array + private function decodeDerivation(string ...$parts): array { $indices = []; foreach ($parts as $i => $part) { diff --git a/src/Key/Deterministic/MultisigHD.php b/src/Key/Deterministic/MultisigHD.php index f7f950065..e040dd338 100644 --- a/src/Key/Deterministic/MultisigHD.php +++ b/src/Key/Deterministic/MultisigHD.php @@ -44,7 +44,7 @@ class MultisigHD * @param ScriptDataFactory $scriptDataFactory * @param HierarchicalKey ...$keys */ - public function __construct(ScriptDataFactory $scriptDataFactory, HierarchicalKey... $keys) + public function __construct(ScriptDataFactory $scriptDataFactory, HierarchicalKey ...$keys) { if (count($keys) < 1) { throw new \RuntimeException('Must have at least one HierarchicalKey for Multisig HD Script'); diff --git a/src/Key/KeyToScript/Factory/KeyToScriptDataFactory.php b/src/Key/KeyToScript/Factory/KeyToScriptDataFactory.php index 72ee33bfc..9c5989ea8 100644 --- a/src/Key/KeyToScript/Factory/KeyToScriptDataFactory.php +++ b/src/Key/KeyToScript/Factory/KeyToScriptDataFactory.php @@ -42,7 +42,7 @@ abstract protected function convertKeyToScriptData(PublicKeyInterface ...$keys): * @param KeyInterface ...$keys * @return ScriptAndSignData */ - public function convertKey(KeyInterface... $keys): ScriptAndSignData + public function convertKey(KeyInterface ...$keys): ScriptAndSignData { $pubs = []; foreach ($keys as $key) { diff --git a/src/Script/Factory/ScriptCreator.php b/src/Script/Factory/ScriptCreator.php index d037975e3..f0980a9dc 100644 --- a/src/Script/Factory/ScriptCreator.php +++ b/src/Script/Factory/ScriptCreator.php @@ -156,7 +156,7 @@ public function int(int $n) * @param string... $opNames * @return $this */ - public function op(string... $opNames) + public function op(string ...$opNames) { $opCodes = []; foreach ($opNames as $opName) { diff --git a/src/Script/Script.php b/src/Script/Script.php index eff156db6..3de59dda0 100644 --- a/src/Script/Script.php +++ b/src/Script/Script.php @@ -255,7 +255,7 @@ public function isPushOnly(array&$ops = null): bool * @param WitnessProgram|null $program * @return bool */ - public function isWitness(& $program = null): bool + public function isWitness(&$program = null): bool { $buffer = $this->getBuffer(); $size = $buffer->getSize(); @@ -286,7 +286,7 @@ public function isWitness(& $program = null): bool * @param BufferInterface $scriptHash * @return bool */ - public function isP2SH(& $scriptHash): bool + public function isP2SH(&$scriptHash): bool { if (strlen($this->script) === 23 && $this->script[0] = Opcodes::OP_HASH160 diff --git a/src/Script/ScriptInterface.php b/src/Script/ScriptInterface.php index e2e07b85b..b7a48f3c4 100644 --- a/src/Script/ScriptInterface.php +++ b/src/Script/ScriptInterface.php @@ -43,13 +43,13 @@ public function isPushOnly(array &$ops = null): bool; * @param WitnessProgram|null $witness * @return bool */ - public function isWitness(& $witness): bool; + public function isWitness(&$witness): bool; /** * @param BufferInterface $scriptHash * @return bool */ - public function isP2SH(& $scriptHash): bool; + public function isP2SH(&$scriptHash): bool; /** * @param bool $accurate