| Conditions | 1 |
| Paths | 1 |
| Total Lines | 25 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 19 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 35 | 5 | public static function fromString(Str $string): Value |
|
| 36 | { |
||
| 37 | 5 | return new self( |
|
| 38 | ...$string |
||
| 39 | 5 | ->toEncoding('ASCII') |
|
| 40 | 5 | ->chunk() |
|
| 41 | 5 | ->reduce( |
|
| 42 | 5 | new Seq, |
|
| 43 | 5 | static function(Seq $bits, Str $bit): Seq { |
|
| 44 | 5 | return (new Str(decbin(ord((string) $bit)))) |
|
| 45 | 5 | ->chunk() |
|
| 46 | 5 | ->reduce( |
|
| 47 | 5 | $bits, |
|
| 48 | 5 | static function(Seq $bits, Str $bit): Seq { |
|
| 49 | 5 | return $bits->add((int) (string) $bit); |
|
| 50 | 5 | } |
|
| 51 | ); |
||
| 52 | 5 | } |
|
| 53 | ) |
||
| 54 | 5 | ->map(static function(int $bit): bool { |
|
| 55 | 5 | return (bool) $bit; |
|
| 56 | 5 | }) |
|
| 57 | 5 | ->reverse() |
|
| 58 | ); |
||
| 59 | } |
||
| 60 | |||
| 79 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.