| Total Complexity | 7 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | abstract class TwillBlock |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var array |
||
| 12 | * |
||
| 13 | * The validation rules for this block. |
||
| 14 | */ |
||
| 15 | protected $rules = []; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var array |
||
| 19 | * |
||
| 20 | * The validation rules for this block. |
||
| 21 | */ |
||
| 22 | protected $rulesForTranslatedFields = []; |
||
| 23 | |||
| 24 | public function __construct() |
||
| 25 | { |
||
| 26 | } |
||
| 27 | |||
| 28 | public function getData(Block $block, array $data): array |
||
|
|
|||
| 29 | { |
||
| 30 | return $data; |
||
| 31 | } |
||
| 32 | |||
| 33 | public function getRules(): array |
||
| 36 | } |
||
| 37 | |||
| 38 | public function getRulesForTranslatedFields(): array |
||
| 41 | } |
||
| 42 | |||
| 43 | public static function getBlockClassForName(string $name): ?TwillBlock |
||
| 44 | { |
||
| 45 | $transformed = Str::studly($name) . 'Block'; |
||
| 46 | $className = "\App\Twill\Block\\$transformed"; |
||
| 47 | if (class_exists($className)) { |
||
| 48 | return new $className(); |
||
| 49 | } |
||
| 50 | |||
| 51 | return null; |
||
| 52 | } |
||
| 53 | |||
| 54 | public static function getBlockClassForView(string $view): ?TwillBlock |
||
| 59 | } |
||
| 60 | } |
||
| 61 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.