| Conditions | 1 |
| Paths | 1 |
| Total Lines | 10 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | public function newRobotsTxtFromConfiguration(Collection $configuration): RobotsTxt |
||
| 13 | { |
||
| 14 | return new RobotsTxt( |
||
| 15 | $configuration['sitemap'], |
||
| 16 | new RulesSetCollection($configuration['rulesSetCollection']->map(function (Collection $rules) { |
||
| 17 | $rulesSet = new RulesSet($rules['User-Agent']); |
||
| 18 | $rulesSet->addAllowRules($rules['Allow']->toArray()); |
||
| 19 | $rulesSet->addDisallowRules($rules['Disallow']->toArray()); |
||
| 20 | |||
| 21 | return $rulesSet; |
||
| 22 | })) |
||
| 26 |