Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a9eae20

Browse files
Error identifiers
1 parent 804902a commit a9eae20

8 files changed

+15
-9
lines changed

‎src/Rules/Doctrine/ORM/DqlRule.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ public function processNode(Node $node, Scope $scope): array
7878
$query->getAST();
7979
} catch (QueryException $e) {
8080
$messages[] = RuleErrorBuilder::message(sprintf('DQL: %s', $e->getMessage()))
81+
->identifier('doctrine.dql')
8182
->build();
8283
} catch (AssertionError $e) {
8384
continue;

‎src/Rules/Doctrine/ORM/EntityColumnRule.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public function processNode(Node $node, Scope $scope): array
107107
$className,
108108
$propertyName,
109109
$fieldMapping['type']
110-
))->build(),
110+
))->identifier('doctrine.descriptorNotFound')->build(),
111111
] : [];
112112
}
113113

@@ -128,7 +128,7 @@ public function processNode(Node $node, Scope $scope): array
128128
$backedEnumType->describe(VerbosityLevel::typeOnly()),
129129
$enumReflection->getDisplayName(),
130130
$writableToDatabaseType->describe(VerbosityLevel::typeOnly())
131-
))->build();
131+
))->identifier('doctrine.enumType')->build();
132132
}
133133
}
134134
}
@@ -179,7 +179,7 @@ public function processNode(Node $node, Scope $scope): array
179179
$propertyName,
180180
$writableToPropertyType->describe(VerbosityLevel::getRecommendedLevelByType($propertyTransformedType, $writableToPropertyType)),
181181
$propertyType->describe(VerbosityLevel::getRecommendedLevelByType($propertyTransformedType, $writableToPropertyType))
182-
))->build();
182+
))->identifier('doctrine.columnType')->build();
183183
}
184184

185185
if (
@@ -195,7 +195,7 @@ public function processNode(Node $node, Scope $scope): array
195195
$propertyName,
196196
$propertyTransformedType->describe(VerbosityLevel::getRecommendedLevelByType($writableToDatabaseType, $propertyType)),
197197
$writableToDatabaseType->describe(VerbosityLevel::getRecommendedLevelByType($writableToDatabaseType, $propertyType))
198-
))->build();
198+
))->identifier('doctrine.columnType')->build();
199199
}
200200
return $errors;
201201
}

‎src/Rules/Doctrine/ORM/EntityConstructorNotFinalRule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function processNode(Node $node, Scope $scope): array
5858
RuleErrorBuilder::message(sprintf(
5959
'Constructor of class %s is final which can cause problems with proxies.',
6060
$classReflection->getDisplayName()
61-
))->build(),
61+
))->identifier('doctrine.finalConstructor')->build(),
6262
];
6363
}
6464

‎src/Rules/Doctrine/ORM/EntityMappingExceptionRule.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public function processNode(Node $node, Scope $scope): array
6060
return [
6161
RuleErrorBuilder::message($e->getMessage())
6262
->nonIgnorable()
63+
->identifier('doctrine.mapping')
6364
->build(),
6465
];
6566
}

‎src/Rules/Doctrine/ORM/EntityNotFinalRule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function processNode(Node $node, Scope $scope): array
5353
RuleErrorBuilder::message(sprintf(
5454
'Entity class %s is final which can cause problems with proxies.',
5555
$classReflection->getDisplayName()
56-
))->build(),
56+
))->identifier('doctrine.finalEntity')->build(),
5757
];
5858
}
5959

‎src/Rules/Doctrine/ORM/EntityRelationRule.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public function processNode(Node $node, Scope $scope): array
135135
$propertyName,
136136
$columnType->describe(VerbosityLevel::typeOnly()),
137137
$propertyType->describe(VerbosityLevel::typeOnly())
138-
))->build();
138+
))->identifier('doctrine.associationType')->build();
139139
}
140140
if (
141141
!$columnType->isSuperTypeOf(
@@ -150,7 +150,7 @@ public function processNode(Node $node, Scope $scope): array
150150
$propertyName,
151151
$propertyType->describe(VerbosityLevel::typeOnly()),
152152
$columnType->describe(VerbosityLevel::typeOnly())
153-
))->build();
153+
))->identifier('doctrine.associationType')->build();
154154
}
155155
}
156156

‎src/Rules/Doctrine/ORM/QueryBuilderDqlRule.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public function processNode(Node $node, Scope $scope): array
6464
) {
6565
return [
6666
RuleErrorBuilder::message('Could not analyse QueryBuilder with unknown beginning.')
67+
->identifier('doctrine.queryBuilderDynamic')
6768
->build(),
6869
];
6970
}
@@ -76,6 +77,7 @@ public function processNode(Node $node, Scope $scope): array
7677
return [
7778
RuleErrorBuilder::message(sprintf('Internal error: %s', $e->getMessage()))
7879
->nonIgnorable()
80+
->identifier('doctrine.internalError')
7981
->build(),
8082
];
8183
}
@@ -85,6 +87,7 @@ public function processNode(Node $node, Scope $scope): array
8587
if ($this->reportDynamicQueryBuilders) {
8688
return [
8789
RuleErrorBuilder::message('Could not analyse QueryBuilder with dynamic arguments.')
90+
->identifier('doctrine.queryBuilderDynamicArgument')
8891
->build(),
8992
];
9093
}
@@ -115,6 +118,7 @@ public function processNode(Node $node, Scope $scope): array
115118
}
116119

117120
$messages[] = RuleErrorBuilder::message($message)
121+
->identifier('doctrine.dql')
118122
->build();
119123
} catch (AssertionError $e) {
120124
continue;

‎src/Rules/Doctrine/ORM/RepositoryMethodCallRule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function processNode(Node $node, Scope $scope): array
8383
$methodName,
8484
$entityClassNames[0],
8585
$fieldName->getValue()
86-
))->build();
86+
))->identifier(sprintf('doctrine.%sArgument', $methodName))->build();
8787
}
8888
}
8989
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /