Skip to content

Commit

Permalink
Use PHPCS (and fix PSR2 style)
Browse files Browse the repository at this point in the history
  • Loading branch information
BafS committed Oct 17, 2023
1 parent 2a77dd1 commit a411c19
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/Collection/StaticBufferCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Key/Deterministic/HierarchicalKeySequence.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/Key/Deterministic/MultisigHD.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion src/Key/KeyToScript/Factory/KeyToScriptDataFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/Script/Factory/ScriptCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions src/Script/Script.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/Script/ScriptInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a411c19

Please sign in to comment.