|
8 | 8 |
|
9 | 9 | class Schema |
10 | 10 | { |
11 | | - public static function register() |
| 11 | + public static function register(): void |
12 | 12 | { |
13 | | - PostgresGrammar::macro('typeVector', function (ColumnDefinition $column) { |
| 13 | + PostgresGrammar::macro('typeVector', function (ColumnDefinition $column): string { |
14 | 14 | if ($column->get('dimensions')) { |
15 | 15 | return 'vector(' . intval($column->get('dimensions')) . ')'; |
16 | 16 | } else { |
17 | 17 | return 'vector'; |
18 | 18 | } |
19 | 19 | }); |
20 | 20 |
|
21 | | - PostgresGrammar::macro('typeHalfvec', function (ColumnDefinition $column) { |
| 21 | + PostgresGrammar::macro('typeHalfvec', function (ColumnDefinition $column): string { |
22 | 22 | if ($column->get('dimensions')) { |
23 | 23 | return 'halfvec(' . intval($column->get('dimensions')) . ')'; |
24 | 24 | } else { |
25 | 25 | return 'halfvec'; |
26 | 26 | } |
27 | 27 | }); |
28 | 28 |
|
29 | | - PostgresGrammar::macro('typeBit', function (ColumnDefinition $column) { |
| 29 | + PostgresGrammar::macro('typeBit', function (ColumnDefinition $column): string { |
30 | 30 | if ($column->get('length')) { |
31 | 31 | return 'bit(' . intval($column->get('length')) . ')'; |
32 | 32 | } else { |
33 | 33 | return 'bit'; |
34 | 34 | } |
35 | 35 | }); |
36 | 36 |
|
37 | | - PostgresGrammar::macro('typeSparsevec', function (ColumnDefinition $column) { |
| 37 | + PostgresGrammar::macro('typeSparsevec', function (ColumnDefinition $column): string { |
38 | 38 | if ($column->get('dimensions')) { |
39 | 39 | return 'sparsevec(' . intval($column->get('dimensions')) . ')'; |
40 | 40 | } else { |
41 | 41 | return 'sparsevec'; |
42 | 42 | } |
43 | 43 | }); |
44 | 44 |
|
45 | | - Blueprint::macro('vector', function ($column, $dimensions = null) { |
| 45 | + Blueprint::macro('vector', function (string $column, mixed $dimensions = null): ColumnDefinition { |
46 | 46 | return $this->addColumn('vector', $column, compact('dimensions')); |
47 | 47 | }); |
48 | 48 |
|
49 | | - Blueprint::macro('halfvec', function ($column, $dimensions = null) { |
| 49 | + Blueprint::macro('halfvec', function (string $column, mixed $dimensions = null): ColumnDefinition { |
50 | 50 | return $this->addColumn('halfvec', $column, compact('dimensions')); |
51 | 51 | }); |
52 | 52 |
|
53 | | - Blueprint::macro('bit', function ($column, $length = null) { |
| 53 | + Blueprint::macro('bit', function (string $column, mixed $length = null): ColumnDefinition { |
54 | 54 | return $this->addColumn('bit', $column, compact('length')); |
55 | 55 | }); |
56 | 56 |
|
57 | | - Blueprint::macro('sparsevec', function ($column, $dimensions = null) { |
| 57 | + Blueprint::macro('sparsevec', function (string $column, mixed $dimensions = null): ColumnDefinition { |
58 | 58 | return $this->addColumn('sparsevec', $column, compact('dimensions')); |
59 | 59 | }); |
60 | 60 | } |
|
0 commit comments