Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| DefinitionPart | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
2 | |
100.00% |
1 / 1 |
| __call | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
2 | |||
| sql | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | |||||
| 1 | <?php declare(strict_types=1); |
| 2 | /* |
| 3 | * This file is part of Aplus Framework Database Library. |
| 4 | * |
| 5 | * (c) Natan Felles <natanfelles@gmail.com> |
| 6 | * |
| 7 | * For the full copyright and license information, please view the LICENSE |
| 8 | * file that was distributed with this source code. |
| 9 | */ |
| 10 | namespace Framework\Database\Definition\Table; |
| 11 | |
| 12 | use BadMethodCallException; |
| 13 | |
| 14 | /** |
| 15 | * Class DefinitionPart. |
| 16 | * |
| 17 | * @package database |
| 18 | */ |
| 19 | abstract class DefinitionPart |
| 20 | { |
| 21 | /** |
| 22 | * @param string $method |
| 23 | * @param array<int,mixed> $arguments |
| 24 | * |
| 25 | * @return mixed |
| 26 | */ |
| 27 | public function __call(string $method, array $arguments) : mixed |
| 28 | { |
| 29 | if ($method === 'sql') { |
| 30 | return $this->sql(...$arguments); |
| 31 | } |
| 32 | throw new BadMethodCallException("Method not found or not allowed: {$method}"); |
| 33 | } |
| 34 | |
| 35 | abstract protected function sql() : string; |
| 36 | } |