Skip to content

Commit 6407a0a

Browse files
committed
format
1 parent a896cd9 commit 6407a0a

File tree

8 files changed

+27
-22
lines changed

8 files changed

+27
-22
lines changed

src/Network/Networks/Bitcoin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
class Bitcoin extends BitcoinAbstract
1212
{
1313
/**
14-
* @var bool
14+
* @var bool
1515
*/
1616
protected $hasSegwit = true;
1717

1818
/**
19-
* @var bool
19+
* @var bool
2020
*/
2121
protected $hasTaproot = true;
2222
}

src/Network/Networks/BitcoinAbstract.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ abstract class BitcoinAbstract implements NetworkInterface
2828
{
2929
const VERSION_SEGWIT = 0;
3030
const VERSION_TAPROOT = 1;
31-
31+
3232
/**
3333
* @var string
3434
*/
@@ -45,12 +45,12 @@ abstract class BitcoinAbstract implements NetworkInterface
4545
protected $prefixBech32 = 'bc';
4646

4747
/**
48-
* @var bool
48+
* @var bool
4949
*/
5050
protected $hasSegwit = false;
5151

5252
/**
53-
* @var bool
53+
* @var bool
5454
*/
5555
protected $hasTaproot = false;
5656

@@ -85,7 +85,7 @@ public function getAddressP2wpkh(string $pubKeyHash): string
8585
if (!$this->hasSegwit) {
8686
throw new Exception('Segwit is not supported.');
8787
}
88-
88+
8989
return encodeSegwit($this->prefixBech32, 0, $pubKeyHash, BECH32);
9090
}
9191

@@ -149,7 +149,7 @@ public function decodeAddress(string $address): OutputInterface
149149
if ($this->hasTaproot && 0 === strpos($address, $this->prefixBech32)) {
150150
try {
151151
list($version, $hash) = decodeSegwit($this->prefixBech32, $address, BECH32M);
152-
152+
153153
if ($version === static::VERSION_TAPROOT) {
154154
return new P2tr($hash);
155155
}

src/Network/Networks/BitcoinGold.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class BitcoinGold extends Bitcoin
2626
protected $prefixBech32 = 'btg';
2727

2828
/**
29-
* @var bool
29+
* @var bool
3030
*/
3131
protected $hasTaproot = false;
3232
}

src/Network/Networks/Viacoin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Viacoin extends Bitcoin
2626
protected $prefixBech32 = 'via';
2727

2828
/**
29-
* @var bool
29+
* @var bool
3030
*/
3131
protected $hasTaproot = false;
3232
}

src/Output/OutputInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ public function address(NetworkInterface $network = null): string;
5151

5252
/**
5353
* @param string $script
54-
* @throws Exception
5554
* @return void
55+
* @throws Exception
5656
*/
5757
static public function validateScript(string $script);
5858

src/Output/Outputs/P2sh.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ public function asm(): string
7272
}
7373

7474
/**
75-
* @return string
7675
* @param NetworkInterface|null $network
76+
* @return string
7777
* @throws \Exception
7878
*/
7979
public function address(NetworkInterface $network = null): string

src/Output/Outputs/P2wpkh.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ public function asm(): string
6868
}
6969

7070
/**
71-
* @return string
7271
* @param NetworkInterface|null $network
72+
* @return string
7373
*/
7474
public function address(NetworkInterface $network = null): string
7575
{

tests/BitcoinTest.php

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,24 +42,29 @@ public function testDecodeP2TR()
4242
{
4343
$this->assertInstanceOf(P2tr::class, NetworkFactory::bitcoin()->decodeAddress('bc1p5cyxnuxmeuwuvkwfem96lqzszd02n6xdcjrs20cac6yqjjwudpxqkedrcr'));
4444
}
45-
46-
public function testValidateAddress() {
45+
46+
public function testValidateAddress()
47+
{
4748
$this->assertFalse(NetworkFactory::bitcoin()->validateAddress('some'));
4849
}
49-
50-
public function testValidateAddressP2PKH() {
50+
51+
public function testValidateAddressP2PKH()
52+
{
5153
$this->assertTrue(NetworkFactory::bitcoin()->validateAddress('1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH'));
5254
}
53-
54-
public function testValidateAddressP2SH() {
55+
56+
public function testValidateAddressP2SH()
57+
{
5558
$this->assertTrue(NetworkFactory::bitcoin()->validateAddress('3DicS6C8JZm59RsrgXr56iVHzYdQngiehV'));
5659
}
57-
58-
public function testValidateAddressP2WSH() {
60+
61+
public function testValidateAddressP2WSH()
62+
{
5963
$this->assertTrue(NetworkFactory::bitcoin()->validateAddress('bc1q9qs9xv7mjghkd69fgx62xttxmeww5q7eekjxu0nxtzf4yu4ekf8s4plngs'));
6064
}
61-
62-
public function testValidateAddressP2TR() {
65+
66+
public function testValidateAddressP2TR()
67+
{
6368
$this->assertTrue(NetworkFactory::bitcoin()->validateAddress('bc1p5cyxnuxmeuwuvkwfem96lqzszd02n6xdcjrs20cac6yqjjwudpxqkedrcr'));
6469
}
6570
}

0 commit comments

Comments
 (0)