You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Service/JsonQueryParser/DoctrineORMParser.php
+1-4Lines changed: 1 addition & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -91,10 +91,7 @@ public function parseJsonString(string $jsonString, string $entityClassName, arr
91
91
privatefunctionnewParser(string$className)
92
92
{
93
93
if (!array_key_exists($className, $this->classNameToDoctrineParser)) {
94
-
thrownew \DomainException(sprintf(
95
-
'You have requested a Doctrine Parser for %s, but you have not defined a mapping for it in your configuration',
96
-
$className
97
-
));
94
+
thrownew \DomainException(sprintf('You have requested a Doctrine Parser for %s, but you have not defined a mapping for it in your configuration', $className));
'Builders Configuration: Expected a class in builder with ID %s',
24
-
$builderId
25
-
));
22
+
thrownew \InvalidArgumentException(sprintf('Builders Configuration: Expected a class in builder with ID %s', $builderId));
26
23
}
27
24
$builderClass = $config['class'];
28
25
29
26
if (!class_exists($builderClass)) {
30
-
thrownew \InvalidArgumentException(sprintf(
31
-
'Builders Configuration: %s is not a valid class in builder with ID %s ',
32
-
$builderClass,
33
-
$builderId
34
-
));
27
+
thrownew \InvalidArgumentException(sprintf('Builders Configuration: %s is not a valid class in builder with ID %s ', $builderClass, $builderId));
35
28
}
36
29
37
30
foreach ($config['result_columns'] as$column) {
@@ -47,32 +40,20 @@ final public static function validate(array $buildersConfig, array $classesAndMa
47
40
48
41
foreach ($config['filters'] as$filter) {
49
42
if (!array_key_exists($filter['id'], $mappingProperties)) {
50
-
thrownew \InvalidArgumentException(sprintf(
51
-
'Builders Configuration: Invalid Mapping for filter with ID %s, in builder with ID %s ',
52
-
$filter['id'],
53
-
$builderId
54
-
));
43
+
thrownew \InvalidArgumentException(sprintf('Builders Configuration: Invalid Mapping for filter with ID %s, in builder with ID %s ', $filter['id'], $builderId));
55
44
}
56
45
}
57
46
58
47
foreach ($config['result_columns'] as$column) {
59
48
if (!array_key_exists($column['column_machine_name'], $mappingProperties)) {
60
-
thrownew \InvalidArgumentException(sprintf(
61
-
'Builders Configuration: Result Column with machine name %s, in builder with ID %s, must exist in mapping for class %s ',
62
-
$column['column_machine_name'],
63
-
$builderId,
64
-
$mappingClass
65
-
));
49
+
thrownew \InvalidArgumentException(sprintf('Builders Configuration: Result Column with machine name %s, in builder with ID %s, must exist in mapping for class %s ', $column['column_machine_name'], $builderId, $mappingClass));
66
50
}
67
51
}
68
52
}
69
53
}
70
54
71
55
if (!$mappingClassFoundForBuilderClass) {
72
-
thrownew \InvalidArgumentException(sprintf(
73
-
'Builder with class %s, but no corresponding mapping for this class',
74
-
$builderClass
75
-
));
56
+
thrownew \InvalidArgumentException(sprintf('Builder with class %s, but no corresponding mapping for this class', $builderClass));
76
57
}
77
58
}
78
59
}
@@ -93,14 +74,7 @@ final private static function validateClassHasProperty(string $className, string
93
74
94
75
if (false === strpos($classProperty, '.')) { // not yet checking associations - Property Accessor can't do this
95
76
if (!in_array($classProperty, $properties)) {
96
-
thrownew \InvalidArgumentException(
97
-
sprintf(
98
-
'Builder %s Bad Column Declared. Property %s is not accessible in %s.',
99
-
$builderId,
100
-
$classProperty,
101
-
$className
102
-
)
103
-
);
77
+
thrownew \InvalidArgumentException(sprintf('Builder %s Bad Column Declared. Property %s is not accessible in %s.', $builderId, $classProperty, $className));
0 commit comments