| Total Complexity | 3 |
| Total Lines | 64 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php namespace norsys\score\php\string\recipient\buffer\prefix; |
||
| 7 | class provider |
||
| 8 | implements |
||
| 9 | php\string\recipient, |
||
| 10 | php\string\provider |
||
| 11 | { |
||
| 12 | private |
||
| 13 | $provider, |
||
| 14 | $buffer |
||
| 15 | ; |
||
| 16 | |||
| 17 | function __construct(php\string\provider $provider, string $buffer = null) |
||
| 18 | { |
||
| 19 | $this->provider = $provider; |
||
| 20 | $this->buffer = $buffer; |
||
| 21 | } |
||
| 22 | |||
| 23 | function stringIs(string $string) :void |
||
|
|
|||
| 24 | { |
||
| 25 | $this->provider |
||
| 26 | ->recipientOfStringIs( |
||
| 27 | new functor( |
||
| 28 | function($prefix) use ($string) |
||
| 29 | { |
||
| 30 | ( |
||
| 31 | new php\string\recipient\prefix( |
||
| 32 | $prefix, |
||
| 33 | new functor( |
||
| 34 | function($prefixedString) |
||
| 35 | { |
||
| 36 | ( |
||
| 37 | new php\string\recipient\prefix( |
||
| 38 | (string) $this->buffer, |
||
| 39 | new functor( |
||
| 40 | function($buffer) |
||
| 41 | { |
||
| 42 | $this->buffer = $buffer; |
||
| 43 | } |
||
| 44 | ) |
||
| 45 | ) |
||
| 46 | ) |
||
| 47 | ->stringIs($prefixedString) |
||
| 48 | ; |
||
| 49 | } |
||
| 50 | ) |
||
| 51 | ) |
||
| 52 | ) |
||
| 53 | ->stringIs($string) |
||
| 54 | ; |
||
| 55 | } |
||
| 56 | ) |
||
| 57 | ) |
||
| 58 | ; |
||
| 59 | } |
||
| 60 | |||
| 61 | function recipientOfStringIs(php\string\recipient $recipient) :void |
||
| 71 | } |
||
| 72 | ) |
||
| 73 | ) |
||
| 77 |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.