| Total Complexity | 6 |
| Total Lines | 53 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | trait ColumnsTrait |
||
| 9 | { |
||
| 10 | 7 | protected function translateColumn(TableSettings $settings, string $name) : ?string |
|
| 20 | 7 | }; |
|
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @param TableSettings $settings |
||
| 25 | * @param string $name |
||
| 26 | * @return string|null |
||
| 27 | * |
||
| 28 | * Okay, time to be ready for Reflection. |
||
| 29 | * When there is settings property with name the same as the entry's then get the value it contains and return it |
||
| 30 | */ |
||
| 31 | 6 | private function getNameBasedOnExtraSettings(TableSettings $settings, string $name) : ?string |
|
| 32 | { |
||
| 33 | 6 | if (property_exists($settings, $name)) { |
|
| 34 | 3 | if (is_null($settings->{$name})) { |
|
| 35 | 2 | return null; |
|
| 36 | } |
||
| 37 | |||
| 38 | 1 | return strval($settings->{$name}); |
|
| 39 | } |
||
| 40 | |||
| 41 | 4 | return $name; |
|
| 42 | } |
||
| 43 | |||
| 44 | 6 | protected function isColumnNameFromBasic(string $name) : bool |
|
| 50 | 6 | ]); |
|
| 51 | } |
||
| 52 | |||
| 53 | 4 | protected function isColumnNameFromTree(string $name) : bool |
|
| 61 | 4 | ]); |
|
| 62 | } |
||
| 64 |