Skip to content

Commit 4a1b26d

Browse files
committed
Styles fix
1 parent f172efa commit 4a1b26d

File tree

6 files changed

+12
-56
lines changed

6 files changed

+12
-56
lines changed

Model/Builder/Builder.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,7 @@ public function getClassName(): string
5252
public function setClassName(string $className): self
5353
{
5454
if (!class_exists($className)) {
55-
throw new \InvalidArgumentException(sprintf(
56-
'Class %s does not exist',
57-
$className
58-
));
55+
throw new \InvalidArgumentException(sprintf('Class %s does not exist', $className));
5956
}
6057
$this->className = $className;
6158

Model/Filter/FilterInput.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,7 @@ public function setInputType(string $inputType): self
7070
private function validate()
7171
{
7272
if (!in_array($this->inputType, self::VALID_INPUT_TYPES)) {
73-
throw new \InvalidArgumentException(sprintf(
74-
'%s is not a valid input type'
75-
), $this->inputType);
73+
throw new \InvalidArgumentException(sprintf('%s is not a valid input type'), $this->inputType);
7674
}
7775
}
7876
}

Model/Filter/FilterOperators.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,7 @@ public function clearOperators(): self
9393
private function validateOperator(string $operator)
9494
{
9595
if (!in_array($operator, self::VALID_OPERATORS)) {
96-
throw new \InvalidArgumentException(sprintf(
97-
'%s is not a valid operator'
98-
), $operator);
96+
throw new \InvalidArgumentException(sprintf('%s is not a valid operator'), $operator);
9997
}
10098
}
10199
}

Service/JavascriptBuilders.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -258,21 +258,13 @@ private function validateValueCollectionAgainstInput(FilterValueCollection $coll
258258
in_array($input->getInputType(), FilterInput::INPUT_TYPES_REQUIRE_NO_VALUES) &&
259259
0 !== $collection->getFilterValues()->count()
260260
) {
261-
throw new \LogicException(sprintf(
262-
'Too many values found, While building, Builder with ID %s and Filter with ID %s.',
263-
$builderId,
264-
$filterId
265-
));
261+
throw new \LogicException(sprintf('Too many values found, While building, Builder with ID %s and Filter with ID %s.', $builderId, $filterId));
266262
}
267263
if (
268264
in_array($input->getInputType(), FilterInput::INPUT_TYPES_REQUIRE_MULTIPLE_VALUES) &&
269265
0 === $collection->getFilterValues()->count()
270266
) {
271-
throw new \LogicException(sprintf(
272-
'Not enough values found, While building, Builder with ID %s and Filter with ID %s.',
273-
$builderId,
274-
$filterId
275-
));
267+
throw new \LogicException(sprintf('Not enough values found, While building, Builder with ID %s and Filter with ID %s.', $builderId, $filterId));
276268
}
277269
}
278270

Service/JsonQueryParser/DoctrineORMParser.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,7 @@ public function parseJsonString(string $jsonString, string $entityClassName, arr
9191
private function newParser(string $className)
9292
{
9393
if (!array_key_exists($className, $this->classNameToDoctrineParser)) {
94-
throw new \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+
throw new \DomainException(sprintf('You have requested a Doctrine Parser for %s, but you have not defined a mapping for it in your configuration', $className));
9895
}
9996

10097
return $this->classNameToDoctrineParser[$className];

Util/Validator/BuildersToMappings.php

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,12 @@ final public static function validate(array $buildersConfig, array $classesAndMa
1919
{
2020
foreach ($buildersConfig as $builderId => $config) {
2121
if (!array_key_exists('class', $config)) {
22-
throw new \InvalidArgumentException(sprintf(
23-
'Builders Configuration: Expected a class in builder with ID %s',
24-
$builderId
25-
));
22+
throw new \InvalidArgumentException(sprintf('Builders Configuration: Expected a class in builder with ID %s', $builderId));
2623
}
2724
$builderClass = $config['class'];
2825

2926
if (!class_exists($builderClass)) {
30-
throw new \InvalidArgumentException(sprintf(
31-
'Builders Configuration: %s is not a valid class in builder with ID %s ',
32-
$builderClass,
33-
$builderId
34-
));
27+
throw new \InvalidArgumentException(sprintf('Builders Configuration: %s is not a valid class in builder with ID %s ', $builderClass, $builderId));
3528
}
3629

3730
foreach ($config['result_columns'] as $column) {
@@ -47,32 +40,20 @@ final public static function validate(array $buildersConfig, array $classesAndMa
4740

4841
foreach ($config['filters'] as $filter) {
4942
if (!array_key_exists($filter['id'], $mappingProperties)) {
50-
throw new \InvalidArgumentException(sprintf(
51-
'Builders Configuration: Invalid Mapping for filter with ID %s, in builder with ID %s ',
52-
$filter['id'],
53-
$builderId
54-
));
43+
throw new \InvalidArgumentException(sprintf('Builders Configuration: Invalid Mapping for filter with ID %s, in builder with ID %s ', $filter['id'], $builderId));
5544
}
5645
}
5746

5847
foreach ($config['result_columns'] as $column) {
5948
if (!array_key_exists($column['column_machine_name'], $mappingProperties)) {
60-
throw new \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+
throw new \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));
6650
}
6751
}
6852
}
6953
}
7054

7155
if (!$mappingClassFoundForBuilderClass) {
72-
throw new \InvalidArgumentException(sprintf(
73-
'Builder with class %s, but no corresponding mapping for this class',
74-
$builderClass
75-
));
56+
throw new \InvalidArgumentException(sprintf('Builder with class %s, but no corresponding mapping for this class', $builderClass));
7657
}
7758
}
7859
}
@@ -93,14 +74,7 @@ final private static function validateClassHasProperty(string $className, string
9374

9475
if (false === strpos($classProperty, '.')) { // not yet checking associations - Property Accessor can't do this
9576
if (!in_array($classProperty, $properties)) {
96-
throw new \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+
throw new \InvalidArgumentException(sprintf('Builder %s Bad Column Declared. Property %s is not accessible in %s.', $builderId, $classProperty, $className));
10478
}
10579
}
10680
}

0 commit comments

Comments
 (0)