| Total Complexity | 4 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class SimpleInfector implements InflectorInterface |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * The inflector instance |
||
| 15 | * |
||
| 16 | * @var InflectorObject |
||
| 17 | */ |
||
| 18 | private $inflector; |
||
| 19 | |||
| 20 | 2 | public function __construct(?InflectorObject $inflector = null) |
|
| 21 | { |
||
| 22 | 2 | $this->inflector = $inflector ?? InflectorFactory::create()->build(); |
|
| 23 | 2 | } |
|
| 24 | |||
| 25 | /** |
||
| 26 | * {@inheritdoc} |
||
| 27 | */ |
||
| 28 | 2 | public function getClassName($table) |
|
| 29 | { |
||
| 30 | 2 | return $this->inflector->classify($this->inflector->singularize(strtolower($table))); |
|
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * {@inheritdoc} |
||
| 35 | */ |
||
| 36 | 2 | public function getPropertyName($table, $field) |
|
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * {@inheritdoc} |
||
| 43 | */ |
||
| 44 | 2 | public function getSequenceName($table) |
|
| 47 | } |
||
| 48 | } |