| 1 | <?php |
||
| 7 | class ConfigValueGuesser |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var Config |
||
| 11 | */ |
||
| 12 | protected $config; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @var MatcherInterface |
||
| 16 | */ |
||
| 17 | protected $matcher; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @param Config $config |
||
| 21 | * @param MatcherInterface $matcher |
||
| 22 | */ |
||
| 23 | public function __construct(Config $config, MatcherInterface $matcher) |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @param string $type |
||
| 31 | * |
||
| 32 | * @return boolean |
||
| 33 | */ |
||
| 34 | public function supports($type) |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @param string $field |
||
| 41 | * @param mixed $value |
||
| 42 | * |
||
| 43 | * @throws \OutOfBoundsException When given a invalid numeric value |
||
| 44 | * @throws \BadMethodCallException When field is not part of the config |
||
| 45 | * |
||
| 46 | * @return integer|null |
||
| 47 | */ |
||
| 48 | public function guess($field, $value) |
||
| 75 | |||
| 76 | /** |
||
| 77 | * @param string $type |
||
| 78 | * |
||
| 79 | * @return array|null |
||
| 80 | */ |
||
| 81 | protected function getConfigValues($type) |
||
| 85 | } |
||
| 86 |