| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | 3 | public function fromParser(Parser $parser) |
|
| 34 | 3 | { |
|
| 35 | 3 | $detailBuffer = $this->varstring->read($parser); |
|
| 36 | $detail = $this->detail->fromParser(new Parser($detailBuffer)); |
||
| 37 | |||
| 38 | $sigBuffer = $this->varstring->read($parser); |
||
| 39 | $adapter = Bitcoin::getEcAdapter(); |
||
| 40 | $serializer = EcSerializer::getSerializer('BitWasp\Bitcoin\Crypto\EcAdapter\Serializer\Signature\DerSignatureSerializerInterface', true, $adapter); |
||
| 41 | $sig = $serializer->parse($sigBuffer); |
||
| 42 | 3 | ||
| 43 | return new Alert( |
||
| 44 | 3 | $detail, |
|
| 45 | $sig |
||
| 46 | 3 | ); |
|
| 47 | 3 | } |
|
| 48 | 3 | ||
| 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: