| Total Complexity | 5 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Coverage | 92.31% |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 15 | abstract class AbstractMapper implements UrlMapperInterface |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * @var array|\string[] |
||
| 19 | */ |
||
| 20 | protected $contentTypes; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @var string |
||
| 24 | */ |
||
| 25 | protected $pattern; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Constructor |
||
| 29 | * |
||
| 30 | * @param string[] $contentTypes |
||
| 31 | * @param string $pattern |
||
| 32 | */ |
||
| 33 | 8 | public function __construct(array $contentTypes, $pattern) |
|
| 34 | { |
||
| 35 | 8 | $this->contentTypes = $contentTypes; |
|
| 36 | 8 | $this->pattern = $pattern; |
|
| 37 | 8 | } |
|
| 38 | |||
| 39 | /** |
||
| 40 | * Check if the mapper supports the given contentType |
||
| 41 | * |
||
| 42 | * @param string $contentType |
||
| 43 | * |
||
| 44 | * @return boolean |
||
| 45 | */ |
||
| 46 | 3 | public function supports($contentType) |
|
| 47 | { |
||
| 48 | 3 | return in_array($contentType, $this->contentTypes); |
|
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * @{inheritDoc} |
||
| 53 | */ |
||
| 54 | 5 | public function processAliasing($content, $mode, Rewriter $rewriter) |
|
| 66 | } |
||
| 67 | } |
||
| 68 |