| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | 8 | public function fromParser(Parser $parser) |
|
| 34 | { |
||
| 35 | 8 | $detailBuffer = $this->varstring->read($parser); |
|
| 36 | 8 | $detail = $this->detail->fromParser(new Parser($detailBuffer)); |
|
| 37 | |||
| 38 | 8 | $sigBuffer = $this->varstring->read($parser); |
|
| 39 | 8 | $adapter = Bitcoin::getEcAdapter(); |
|
| 40 | 8 | $serializer = EcSerializer::getSerializer('BitWasp\Bitcoin\Crypto\EcAdapter\Serializer\Signature\DerSignatureSerializerInterface', true, $adapter); |
|
| 41 | 8 | $sig = $serializer->parse($sigBuffer); |
|
| 42 | |||
| 43 | 8 | return new Alert( |
|
| 44 | 8 | $detail, |
|
| 45 | 5 | $sig |
|
| 46 | 3 | ); |
|
| 47 | } |
||
| 48 | |||
| 67 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: