Passed
Push — master ( c5030b...c13ec3 )
by Wilmer
09:57 queued 27s
created

TestSchemaTrait::normalizeConstraintPair()   A

Complexity

Conditions 5
Paths 5

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 5.3906

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 5
eloc 7
nc 5
nop 2
dl 0
loc 11
ccs 6
cts 8
cp 0.75
crap 5.3906
rs 9.6111
c 1
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Db\TestUtility;
6
7
use PDO;
8
use Yiisoft\Db\Constraint\CheckConstraint;
9
use Yiisoft\Db\Constraint\Constraint;
10
use Yiisoft\Db\Constraint\ForeignKeyConstraint;
11
use Yiisoft\Db\Constraint\IndexConstraint;
12
use Yiisoft\Db\Schema\ColumnSchema;
13
use Yiisoft\Db\Schema\Schema;
14
use Yiisoft\Db\Schema\TableSchema;
15
16
use function array_keys;
17
use function fclose;
18
use function fopen;
19
use function gettype;
20
use function is_array;
21
use function json_encode;
22
use function ksort;
23
use function print_r;
24
use function sort;
25
use function sprintf;
26
use function strtolower;
27
28
trait TestSchemaTrait
29
{
30 5
    public function testGetTableSchemasWithAttrCase(): void
31
    {
32 5
        $db = $this->getConnection(false);
0 ignored issues
show
Bug introduced by
It seems like getConnection() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

32
        /** @scrutinizer ignore-call */ 
33
        $db = $this->getConnection(false);
Loading history...
33
34 5
        $db->getSlavePdo()->setAttribute(PDO::ATTR_CASE, PDO::CASE_LOWER);
35
36 5
        $this->assertCount(count($db->getSchema()->getTableNames()), $db->getSchema()->getTableSchemas());
0 ignored issues
show
Bug introduced by
It seems like assertCount() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

36
        $this->/** @scrutinizer ignore-call */ 
37
               assertCount(count($db->getSchema()->getTableNames()), $db->getSchema()->getTableSchemas());
Loading history...
37
38 5
        $db->getSlavePdo()->setAttribute(PDO::ATTR_CASE, PDO::CASE_UPPER);
39
40 5
        $this->assertCount(count($db->getSchema()->getTableNames()), $db->getSchema()->getTableSchemas());
41 5
    }
42
43 5
    public function testGetNonExistingTableSchema(): void
44
    {
45 5
        $this->assertNull($this->getConnection()->getSchema()->getTableSchema('nonexisting_table'));
0 ignored issues
show
Bug introduced by
It seems like assertNull() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

45
        $this->/** @scrutinizer ignore-call */ 
46
               assertNull($this->getConnection()->getSchema()->getTableSchema('nonexisting_table'));
Loading history...
46 5
    }
47
48 5
    public function testSchemaCache(): void
49
    {
50 5
        $db = $this->getConnection();
51
52 5
        $schema = $db->getSchema();
53
54 5
        $db->getSchemaCache()->setEnable(true);
55
56 5
        $noCacheTable = $schema->getTableSchema('type', true);
57 5
        $cachedTable = $schema->getTableSchema('type', false);
58
59 5
        $this->assertEquals($noCacheTable, $cachedTable);
0 ignored issues
show
Bug introduced by
It seems like assertEquals() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

59
        $this->/** @scrutinizer ignore-call */ 
60
               assertEquals($noCacheTable, $cachedTable);
Loading history...
60
61 5
        $db->createCommand()->renameTable('type', 'type_test');
62
63 5
        $noCacheTable = $schema->getTableSchema('type', true);
64
65 5
        $this->assertNotSame($noCacheTable, $cachedTable);
0 ignored issues
show
Bug introduced by
It seems like assertNotSame() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

65
        $this->/** @scrutinizer ignore-call */ 
66
               assertNotSame($noCacheTable, $cachedTable);
Loading history...
66
67 5
        $db->createCommand()->renameTable('type_test', 'type');
68 5
    }
69
70
    /**
71
     * @depends testSchemaCache
72
     */
73 5
    public function testRefreshTableSchema(): void
74
    {
75 5
        $schema = $this->getConnection()->getSchema();
76
77 5
        $schema->getDb()->getSchemaCache()->setEnable(true);
78
79 5
        $noCacheTable = $schema->getTableSchema('type', true);
80
81 5
        $schema->refreshTableSchema('type');
82
83 5
        $refreshedTable = $schema->getTableSchema('type', false);
84
85 5
        $this->assertNotSame($noCacheTable, $refreshedTable);
86 5
    }
87
88 2
    public function testCompositeFk(): void
89
    {
90 2
        $schema = $this->getConnection()->getSchema();
91
92 2
        $table = $schema->getTableSchema('composite_fk');
93
94 2
        $fk = $table->getForeignKeys();
95
96 2
        $this->assertCount(1, $fk);
97 2
        $this->assertTrue(isset($fk['FK_composite_fk_order_item']));
0 ignored issues
show
Bug introduced by
It seems like assertTrue() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

97
        $this->/** @scrutinizer ignore-call */ 
98
               assertTrue(isset($fk['FK_composite_fk_order_item']));
Loading history...
98 2
        $this->assertEquals('order_item', $fk['FK_composite_fk_order_item'][0]);
99 2
        $this->assertEquals('order_id', $fk['FK_composite_fk_order_item']['order_id']);
100 2
        $this->assertEquals('item_id', $fk['FK_composite_fk_order_item']['item_id']);
101 2
    }
102
103 4
    public function testGetPDOType(): void
104
    {
105
        $values = [
106 4
            [null, PDO::PARAM_NULL],
107
            ['', PDO::PARAM_STR],
108
            ['hello', PDO::PARAM_STR],
109
            [0, PDO::PARAM_INT],
110
            [1, PDO::PARAM_INT],
111
            [1337, PDO::PARAM_INT],
112
            [true, PDO::PARAM_BOOL],
113
            [false, PDO::PARAM_BOOL],
114 4
            [$fp = fopen(__FILE__, 'rb'), PDO::PARAM_LOB],
115
        ];
116
117 4
        $schema = $this->getConnection()->getSchema();
118
119 4
        foreach ($values as $value) {
120 4
            $this->assertEquals($value[1], $schema->getPdoType($value[0]), 'type for value ' . print_r($value[0], true) . ' does not match.');
121
        }
122
123 4
        fclose($fp);
0 ignored issues
show
Bug introduced by
It seems like $fp can also be of type false; however, parameter $handle of fclose() does only seem to accept resource, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

123
        fclose(/** @scrutinizer ignore-type */ $fp);
Loading history...
124 4
    }
125
126 5
    public function testColumnSchema(): void
127
    {
128 5
        $columns = $this->getExpectedColumns();
0 ignored issues
show
Bug introduced by
It seems like getExpectedColumns() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

128
        /** @scrutinizer ignore-call */ 
129
        $columns = $this->getExpectedColumns();
Loading history...
129
130 5
        $table = $this->getConnection(false)->getSchema()->getTableSchema('type', true);
131
132 5
        $expectedColNames = array_keys($columns);
133
134 5
        sort($expectedColNames);
135
136 5
        $colNames = $table->getColumnNames();
137
138 5
        sort($colNames);
139
140 5
        $this->assertEquals($expectedColNames, $colNames);
141
142 5
        foreach ($table->getColumns() as $name => $column) {
143 5
            $expected = $columns[$name];
144 5
            $this->assertSame(
0 ignored issues
show
Bug introduced by
It seems like assertSame() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

144
            $this->/** @scrutinizer ignore-call */ 
145
                   assertSame(
Loading history...
145 5
                $expected['dbType'],
146 5
                $column->getDbType(),
147 5
                "dbType of column $name does not match. type is {$column->getType()}, dbType is {$column->getDbType()}."
148
            );
149 5
            $this->assertSame(
150 5
                $expected['phpType'],
151 5
                $column->getPhpType(),
152 5
                "phpType of column $name does not match. type is {$column->getType()}, dbType is {$column->getDbType()}."
153
            );
154 5
            $this->assertSame($expected['type'], $column->getType(), "type of column $name does not match.");
155 5
            $this->assertSame(
156 5
                $expected['allowNull'],
157 5
                $column->isAllowNull(),
158 5
                "allowNull of column $name does not match."
159
            );
160 5
            $this->assertSame(
161 5
                $expected['autoIncrement'],
162 5
                $column->isAutoIncrement(),
163 5
                "autoIncrement of column $name does not match."
164
            );
165 5
            $this->assertSame(
166 5
                $expected['enumValues'],
167 5
                $column->getEnumValues(),
168 5
                "enumValues of column $name does not match."
169
            );
170 5
            $this->assertSame($expected['size'], $column->getSize(), "size of column $name does not match.");
171 5
            $this->assertSame(
172 5
                $expected['precision'],
173 5
                $column->getPrecision(),
174 5
                "precision of column $name does not match."
175
            );
176 5
            $this->assertSame($expected['scale'], $column->getScale(), "scale of column $name does not match.");
177 5
            if (\is_object($expected['defaultValue'])) {
178 3
                $this->assertIsObject(
0 ignored issues
show
Bug introduced by
It seems like assertIsObject() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

178
                $this->/** @scrutinizer ignore-call */ 
179
                       assertIsObject(
Loading history...
179 3
                    $column->getDefaultValue(),
180 3
                    "defaultValue of column $name is expected to be an object but it is not."
181
                );
182 3
                $this->assertEquals(
183 3
                    (string) $expected['defaultValue'],
184 3
                    (string) $column->getDefaultValue(),
185 3
                    "defaultValue of column $name does not match."
186
                );
187
            } else {
188 5
                $this->assertEquals(
189 5
                    $expected['defaultValue'],
190 5
                    $column->getDefaultValue(),
191 5
                    "defaultValue of column $name does not match."
192
                );
193
            }
194
            /* Pgsql only */
195 5
            if (isset($expected['dimension'])) {
196 1
                $this->assertSame(
197 1
                    $expected['dimension'],
198 1
                    $column->getDimension(),
199 1
                    "dimension of column $name does not match"
200
                );
201
            }
202
        }
203 5
    }
204
205 5
    public function testColumnSchemaDbTypecastWithEmptyCharType(): void
206
    {
207 5
        $columnSchema = new ColumnSchema();
208
209 5
        $columnSchema->setType(Schema::TYPE_CHAR);
210
211 5
        $this->assertSame('', $columnSchema->dbTypecast(''));
212 5
    }
213
214 5
    public function testNegativeDefaultValues(): void
215
    {
216 5
        $schema = $this->getConnection()->getSchema();
217
218 5
        $table = $schema->getTableSchema('negative_default_values');
219
220 5
        $this->assertEquals(-123, $table->getColumn('tinyint_col')->getDefaultValue());
221 5
        $this->assertEquals(-123, $table->getColumn('smallint_col')->getDefaultValue());
222 5
        $this->assertEquals(-123, $table->getColumn('int_col')->getDefaultValue());
223 5
        $this->assertEquals(-123, $table->getColumn('bigint_col')->getDefaultValue());
224 5
        $this->assertEquals(-12345.6789, $table->getColumn('float_col')->getDefaultValue());
225 5
        $this->assertEquals(-33.22, $table->getColumn('numeric_col')->getDefaultValue());
226 5
    }
227
228 5
    public function testContraintTablesExistance(): void
229
    {
230
        $tableNames = [
231 5
            'T_constraints_1',
232
            'T_constraints_2',
233
            'T_constraints_3',
234
            'T_constraints_4',
235
        ];
236
237 5
        $schema = $this->getConnection()->getSchema();
238
239 5
        foreach ($tableNames as $tableName) {
240 5
            $tableSchema = $schema->getTableSchema($tableName);
241 5
            $this->assertInstanceOf(TableSchema::class, $tableSchema, $tableName);
0 ignored issues
show
Bug introduced by
It seems like assertInstanceOf() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

241
            $this->/** @scrutinizer ignore-call */ 
242
                   assertInstanceOf(TableSchema::class, $tableSchema, $tableName);
Loading history...
242
        }
243 5
    }
244
245 240
    private function assertMetadataEquals($expected, $actual): void
246
    {
247 240
        switch (strtolower(gettype($expected))) {
248 240
            case 'object':
249 45
                $this->assertIsObject($actual);
250 45
                break;
251 195
            case 'array':
252 180
                $this->assertIsArray($actual);
0 ignored issues
show
Bug introduced by
It seems like assertIsArray() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

252
                $this->/** @scrutinizer ignore-call */ 
253
                       assertIsArray($actual);
Loading history...
253 180
                break;
254 15
            case 'null':
255 15
                $this->assertNull($actual);
256 15
                break;
257
        }
258
259 240
        if (is_array($expected)) {
260 180
            $this->normalizeArrayKeys($expected, false);
261 180
            $this->normalizeArrayKeys($actual, false);
262
        }
263
264 240
        $this->normalizeConstraints($expected, $actual);
265
266 240
        if (is_array($expected)) {
267 180
            $this->normalizeArrayKeys($expected, true);
268 180
            $this->normalizeArrayKeys($actual, true);
269
        }
270
271 240
        $this->assertEquals($expected, $actual);
272 240
    }
273
274 180
    private function normalizeArrayKeys(array &$array, bool $caseSensitive): void
275
    {
276 180
        $newArray = [];
277
278 180
        foreach ($array as $value) {
279 117
            if ($value instanceof Constraint) {
280 117
                $key = (array) $value;
281
                unset(
282 117
                    $key["\000Yiisoft\Db\Constraint\Constraint\000name"],
283 117
                    $key["\u0000Yiisoft\\Db\\Constraint\\ForeignKeyConstraint\u0000foreignSchemaName"]
284
                );
285
286 117
                foreach ($key as $keyName => $keyValue) {
287 117
                    if ($keyValue instanceof AnyCaseValue) {
288
                        $key[$keyName] = $keyValue->value;
289 117
                    } elseif ($keyValue instanceof AnyValue) {
290
                        $key[$keyName] = '[AnyValue]';
291
                    }
292
                }
293
294 117
                ksort($key, SORT_STRING);
295
296 117
                $newArray[$caseSensitive
297 117
                    ? json_encode($key, JSON_THROW_ON_ERROR)
298 117
                    : strtolower(json_encode($key, JSON_THROW_ON_ERROR))] = $value;
299
            } else {
300
                $newArray[] = $value;
301
            }
302
        }
303
304 180
        ksort($newArray, SORT_STRING);
305
306 180
        $array = $newArray;
307 180
    }
308
309 240
    private function normalizeConstraints(&$expected, &$actual): void
310
    {
311 240
        if (is_array($expected)) {
312 180
            foreach ($expected as $key => $value) {
313 117
                if (!$value instanceof Constraint || !isset($actual[$key]) || !$actual[$key] instanceof Constraint) {
314
                    continue;
315
                }
316
317 117
                $this->normalizeConstraintPair($value, $actual[$key]);
318
            }
319 60
        } elseif ($expected instanceof Constraint && $actual instanceof Constraint) {
320 45
            $this->normalizeConstraintPair($expected, $actual);
321
        }
322 240
    }
323
324 162
    private function normalizeConstraintPair(Constraint $expectedConstraint, Constraint $actualConstraint): void
325
    {
326 162
        if (get_class($expectedConstraint) !== get_class($actualConstraint)) {
327
            return;
328
        }
329
330 162
        foreach (array_keys((array) $expectedConstraint) as $name) {
331 162
            if ($expectedConstraint->getName() instanceof AnyValue) {
332 87
                $actualConstraint->name($expectedConstraint->getName());
333 102
            } elseif ($expectedConstraint->getName() instanceof AnyCaseValue) {
334
                $actualConstraint->name(new AnyCaseValue($actualConstraint->getName()));
0 ignored issues
show
Bug introduced by
It seems like $actualConstraint->getName() can also be of type object; however, parameter $value of Yiisoft\Db\TestUtility\AnyCaseValue::__construct() does only seem to accept string|string[], maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

334
                $actualConstraint->name(new AnyCaseValue(/** @scrutinizer ignore-type */ $actualConstraint->getName()));
Loading history...
335
            }
336
        }
337 162
    }
338
339
    public function constraintsProviderTrait(): array
340
    {
341
        return [
342
            '1: primary key' => [
343
                'T_constraints_1',
344
                'primaryKey',
345
                (new Constraint())
346
                    ->name(AnyValue::getInstance())
347
                    ->columnNames(['C_id']),
348
            ],
349
            '1: check' => [
350
                'T_constraints_1',
351
                'checks',
352
                [
353
                    (new CheckConstraint())
354
                        ->name(AnyValue::getInstance())
355
                        ->columnNames(['C_check'])
356
                        ->expression("C_check <> ''"),
357
                ],
358
            ],
359
            '1: unique' => [
360
                'T_constraints_1',
361
                'uniques',
362
                [
363
                    (new Constraint())
364
                        ->name('CN_unique')
365
                        ->columnNames(['C_unique']),
366
                ],
367
            ],
368
            '1: index' => [
369
                'T_constraints_1',
370
                'indexes',
371
                [
372
                    (new IndexConstraint())
373
                        ->name(AnyValue::getInstance())
374
                        ->columnNames(['C_id'])
375
                        ->unique(true)
376
                        ->primary(true),
377
                    (new IndexConstraint())
378
                        ->name('CN_unique')
379
                        ->columnNames(['C_unique'])
380
                        ->primary(false)
381
                        ->unique(true),
382
                ],
383
            ],
384
            '1: default' => ['T_constraints_1', 'defaultValues', false],
385
386
            '2: primary key' => [
387
                'T_constraints_2',
388
                'primaryKey',
389
                (new Constraint())
390
                    ->name('CN_pk')
391
                    ->columnNames(['C_id_1', 'C_id_2']),
392
            ],
393
            '2: unique' => [
394
                'T_constraints_2',
395
                'uniques',
396
                [
397
                    (new Constraint())
398
                        ->name('CN_constraints_2_multi')
399
                        ->columnNames(['C_index_2_1', 'C_index_2_2']),
400
                ],
401
            ],
402
            '2: index' => [
403
                'T_constraints_2',
404
                'indexes',
405
                [
406
                    (new IndexConstraint())
407
                        ->name(AnyValue::getInstance())
408
                        ->columnNames(['C_id_1', 'C_id_2'])
409
                        ->unique(true)
410
                        ->primary(true),
411
                    (new IndexConstraint())
412
                        ->name('CN_constraints_2_single')
413
                        ->columnNames(['C_index_1'])
414
                        ->primary(false)
415
                        ->unique(false),
416
                    (new IndexConstraint())
417
                        ->name('CN_constraints_2_multi')
418
                        ->columnNames(['C_index_2_1', 'C_index_2_2'])
419
                        ->primary(false)
420
                        ->unique(true),
421
                ],
422
            ],
423
            '2: check' => ['T_constraints_2', 'checks', []],
424
            '2: default' => ['T_constraints_2', 'defaultValues', false],
425
426
            '3: primary key' => ['T_constraints_3', 'primaryKey', null],
427
            '3: foreign key' => [
428
                'T_constraints_3',
429
                'foreignKeys',
430
                [
431
                    (new ForeignKeyConstraint())
432
                        ->name('CN_constraints_3')
433
                        ->columnNames(['C_fk_id_1', 'C_fk_id_2'])
434
                        ->foreignTableName('T_constraints_2')
435
                        ->foreignColumnNames(['C_id_1', 'C_id_2'])
436
                        ->onDelete('CASCADE')
437
                        ->onUpdate('CASCADE'),
438
                ],
439
            ],
440
            '3: unique' => ['T_constraints_3', 'uniques', []],
441
            '3: index' => [
442
                'T_constraints_3',
443
                'indexes',
444
                [
445
                    (new IndexConstraint())
446
                        ->name('CN_constraints_3')
447
                        ->columnNames(['C_fk_id_1', 'C_fk_id_2'])
448
                        ->unique(false)
449
                        ->primary(false),
450
                ],
451
            ],
452
            '3: check' => ['T_constraints_3', 'checks', []],
453
            '3: default' => ['T_constraints_3', 'defaultValues', false],
454
455
            '4: primary key' => [
456
                'T_constraints_4',
457
                'primaryKey',
458
                (new Constraint())
459
                    ->name(AnyValue::getInstance())
460
                    ->columnNames(['C_id']),
461
            ],
462
            '4: unique' => [
463
                'T_constraints_4',
464
                'uniques',
465
                [
466
                    (new Constraint())
467
                        ->name('CN_constraints_4')
468
                        ->columnNames(['C_col_1', 'C_col_2']),
469
                ],
470
            ],
471
            '4: check' => ['T_constraints_4', 'checks', []],
472
            '4: default' => ['T_constraints_4', 'defaultValues', false],
473
        ];
474
    }
475
476
    public function pdoAttributesProviderTrait(): array
477
    {
478
        return [
479
            [[PDO::ATTR_EMULATE_PREPARES => true]],
480
            [[PDO::ATTR_EMULATE_PREPARES => false]],
481
        ];
482
    }
483
484
    public function tableSchemaCachePrefixesProviderTrait(): array
485
    {
486
        $configs = [
487
            [
488
                'prefix' => '',
489
                'name' => 'type',
490
            ],
491
            [
492
                'prefix' => '',
493
                'name' => '{{%type}}',
494
            ],
495
            [
496
                'prefix' => 'ty',
497
                'name' => '{{%pe}}',
498
            ],
499
        ];
500
501
        $data = [];
502
        foreach ($configs as $config) {
503
            foreach ($configs as $testConfig) {
504
                if ($config === $testConfig) {
505
                    continue;
506
                }
507
508
                $description = sprintf(
509
                    "%s (with '%s' prefix) against %s (with '%s' prefix)",
510
                    $config['name'],
511
                    $config['prefix'],
512
                    $testConfig['name'],
513
                    $testConfig['prefix']
514
                );
515
                $data[$description] = [
516
                    $config['prefix'],
517
                    $config['name'],
518
                    $testConfig['prefix'],
519
                    $testConfig['name'],
520
                ];
521
            }
522
        }
523
524
        return $data;
525
    }
526
527
    public function lowercaseConstraintsProviderTrait(): array
528
    {
529
        return $this->constraintsProvider();
0 ignored issues
show
Bug introduced by
The method constraintsProvider() does not exist on Yiisoft\Db\TestUtility\TestSchemaTrait. Did you maybe mean constraintsProviderTrait()? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

529
        return $this->/** @scrutinizer ignore-call */ constraintsProvider();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
530
    }
531
532
    public function uppercaseConstraintsProviderTrait(): array
533
    {
534
        return $this->constraintsProvider();
535
    }
536
}
537