| Total Complexity | 5 |
| Total Lines | 66 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | class BaseGenerator |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @var \Rougin\Describe\Describe |
||
| 17 | */ |
||
| 18 | protected $describe; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @var array |
||
| 22 | */ |
||
| 23 | protected $data = []; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @param \Rougin\Describe\Describe $describe |
||
| 27 | * @param array $data |
||
| 28 | */ |
||
| 29 | 24 | public function __construct(Describe $describe, array $data) |
|
| 30 | { |
||
| 31 | 24 | $this->describe = $describe; |
|
| 32 | 24 | $this->data = $data; |
|
| 33 | 24 | } |
|
| 34 | |||
| 35 | /** |
||
| 36 | * Gets the primary keys based on specified field. |
||
| 37 | * |
||
| 38 | * @param array $data |
||
| 39 | * @param string $field |
||
| 40 | * @param string $referencedTable |
||
| 41 | * @return array |
||
| 42 | */ |
||
| 43 | 15 | protected function getPrimaryKey(array $data, $field, $referencedTable) |
|
| 56 | } |
||
| 57 | |||
| 58 | /** |
||
| 59 | * Transforms the field into the template. |
||
| 60 | * |
||
| 61 | * @param string $field |
||
| 62 | * @param string $type |
||
| 63 | * @return array |
||
| 64 | */ |
||
| 65 | 15 | protected function transformField($field, $type) |
|
| 82 |