Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
7 / 7 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| ListLength | |
100.00% |
7 / 7 |
|
100.00% |
1 / 1 |
3 | |
100.00% |
1 / 1 |
| renderLength | |
100.00% |
7 / 7 |
|
100.00% |
1 / 1 |
3 | |||
| 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\Columns\Traits; |
| 11 | |
| 12 | /** |
| 13 | * Trait ListLength. |
| 14 | * |
| 15 | * @package database |
| 16 | */ |
| 17 | trait ListLength |
| 18 | { |
| 19 | protected function renderLength() : ?string |
| 20 | { |
| 21 | if (empty($this->length)) { |
| 22 | return null; |
| 23 | } |
| 24 | $values = []; |
| 25 | foreach ($this->length as $length) { |
| 26 | $values[] = $this->database->quote($length); |
| 27 | } |
| 28 | $values = \implode(', ', $values); |
| 29 | return "({$values})"; |
| 30 | } |
| 31 | } |