| Total Complexity | 4 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | abstract class ModelBuilder implements ModelBuilderInterface |
||
| 10 | { |
||
| 11 | public const BUILD_FOR_CREATE = 'create'; |
||
| 12 | public const BUILD_FOR_UPDATE = 'update'; |
||
| 13 | public const BUILD_FOR_PATCH = 'patch'; |
||
| 14 | |||
| 15 | protected $params = []; |
||
| 16 | |||
| 17 | 19 | public function build(string $buildType = self::BUILD_FOR_CREATE): array |
|
| 22 | } |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Defined the required fields for the given build type. |
||
| 26 | * |
||
| 27 | * @param string $buildType the build type see BUILD_FOR_* consts |
||
| 28 | */ |
||
| 29 | abstract protected function getRequiredFields(string $buildType = self::BUILD_FOR_CREATE): array; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Validate the parameters. |
||
| 33 | * |
||
| 34 | * @param string $buildType the build type to validate the parameters |
||
| 35 | */ |
||
| 36 | 19 | protected function validate(string $buildType = self::BUILD_FOR_CREATE): void |
|
| 50 |