| Conditions | 3 |
| Paths | 4 |
| Total Lines | 19 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 71 | protected function getFieldValue( |
||
| 72 | Crawler $node, |
||
| 73 | $defaultValue, |
||
| 74 | $callback = null, |
||
| 75 | $funcName = 'text', |
||
| 76 | $funcParam = '' |
||
| 77 | ) { |
||
| 78 | if ($callback == null) { |
||
| 79 | $callback = function ($value) { |
||
| 80 | return DefaultSanitizer::clean($value); |
||
| 81 | }; |
||
| 82 | } |
||
| 83 | |||
| 84 | if ($node->count()) { |
||
| 85 | return $callback($node->$funcName($funcParam)); |
||
| 86 | } |
||
| 87 | |||
| 88 | return $defaultValue; |
||
| 89 | } |
||
| 90 | |||
| 97 |