We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Conditions | 6 |
| Paths | 6 |
| Total Lines | 20 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 16 | public function validateRules(string $attribute, mixed $value): array |
||
| 17 | { |
||
| 18 | $entry = CrudPanelFacade::getCurrentEntry(); |
||
|
|
|||
| 19 | |||
| 20 | if (! Arr::has($this->data, $attribute)) { |
||
| 21 | $attributeValueForDataArray = null; |
||
| 22 | $requestAttributeValue = Arr::get($this->data, '_order_'.$attribute); |
||
| 23 | if ($entry && Str::contains($attribute, '.')) { |
||
| 24 | $attributeValueForDataArray = $requestAttributeValue; |
||
| 25 | } |
||
| 26 | Arr::set($this->data, $attribute, $attributeValueForDataArray); |
||
| 27 | } |
||
| 28 | |||
| 29 | $fieldErrors = $this->validateFieldRules($attribute, $value); |
||
| 30 | |||
| 31 | if (! empty($value) && ! empty($this->getFileRules())) { |
||
| 32 | $fileErrors = $this->validateFileRules($attribute, $value); |
||
| 33 | } |
||
| 34 | |||
| 35 | return array_merge($fieldErrors, $fileErrors ?? []); |
||
| 36 | } |
||
| 43 |