| Total Complexity | 3 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | class DataList extends BaseDataList |
||
| 15 | { |
||
| 16 | protected ?GridField $gridField = null; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * HasOneSelectorDataList constructor. |
||
| 20 | */ |
||
| 21 | 8 | public function __construct(GridField $gridField) |
|
| 22 | { |
||
| 23 | 8 | $this->gridField = $gridField; |
|
| 24 | |||
| 25 | 8 | parent::__construct($gridField->getDataClass()); |
|
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Set the current selected record into the has one relation. |
||
| 30 | * |
||
| 31 | * @param DataObject $item |
||
| 32 | * |
||
| 33 | * @throws Exception |
||
| 34 | */ |
||
| 35 | 1 | public function add($item): void |
|
| 36 | { |
||
| 37 | 1 | $this->gridField->setRecord($item); |
|
|
|
|||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Clear the record within the has one relation. |
||
| 42 | * |
||
| 43 | * @param DataObject $item |
||
| 44 | * |
||
| 45 | * @throws Exception |
||
| 46 | */ |
||
| 47 | 1 | public function remove($item): void |
|
| 50 | } |
||
| 51 | } |
||
| 52 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.