Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
10 | public static function processSeedFieldDirective( |
||
11 | SeedGenerator $generator, |
||
12 | \GraphQL\Type\Definition\FieldDefinition $field, |
||
13 | \GraphQL\Language\AST\Node $directive |
||
14 | ): void { |
||
15 | $type1 = $generator->lowerName; |
||
|
|||
16 | $type2 = mb_strtolower($generator->getInflector()->singularize($field->name)); |
||
17 | |||
18 | if (strcasecmp($type1, $type2) < 0) { // TODO: check this, might not work |
||
19 | $relationship = mb_strtolower($generator->getInflector()->pluralize($field->name)); |
||
20 | $generator->extraCode[] = self::makeManyToManySeed($type1, $type2, $relationship); |
||
21 | } |
||
42 |