-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
style #166 Style and strict improvements (sstok)
This PR was merged into the 2.0-dev branch. Discussion ---------- | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Commits ------- 24f0510 Mark more classes as final 52e2d3d Clean-up useless comments (fix author(s)) f22a08a Mark all tests as internal
- Loading branch information
Showing
131 changed files
with
363 additions
and
294 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ | |
* | ||
* @author Sebastiaan Stok <[email protected]> | ||
*/ | ||
class ChainOptimizer implements SearchConditionOptimizer | ||
final class ChainOptimizer implements SearchConditionOptimizer | ||
{ | ||
/** | ||
* @var array<SearchConditionOptimizerInterface[]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,19 +38,13 @@ | |
* | ||
* @author Sebastiaan Stok <[email protected]> | ||
*/ | ||
class DuplicateRemover implements SearchConditionOptimizer | ||
final class DuplicateRemover implements SearchConditionOptimizer | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function process(SearchCondition $condition) | ||
{ | ||
$this->removeDuplicatesInGroup($condition->getValuesGroup(), $condition->getFieldSet()); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getPriority(): int | ||
{ | ||
return 5; | ||
|
@@ -83,13 +77,6 @@ private function removeDuplicatesInValuesBag(FieldConfig $config, ValuesBag $val | |
$this->removeDuplicateMatchers($valuesBag, $comparator, $options); | ||
} | ||
|
||
/** | ||
* @param array $values | ||
* @param ValuesBag $valuesBag | ||
* @param ValueComparator $comparator | ||
* @param array $options | ||
* @param bool $exclude | ||
*/ | ||
private function removeDuplicateValues( | ||
array $values, | ||
ValuesBag $valuesBag, | ||
|
@@ -152,11 +139,6 @@ private function removeDuplicateRanges( | |
} | ||
} | ||
|
||
/** | ||
* @param ValuesBag $valuesBag | ||
* @param ValueComparator $comparator | ||
* @param array $options | ||
*/ | ||
private function removeDuplicateComparisons(ValuesBag $valuesBag, ValueComparator $comparator, array $options) | ||
{ | ||
/** @var Compare[] $comparisons */ | ||
|
@@ -178,11 +160,6 @@ private function removeDuplicateComparisons(ValuesBag $valuesBag, ValueComparato | |
} | ||
} | ||
|
||
/** | ||
* @param ValuesBag $valuesBag | ||
* @param ValueComparator $comparator | ||
* @param array $options | ||
*/ | ||
private function removeDuplicateMatchers(ValuesBag $valuesBag, ValueComparator $comparator, array $options) | ||
{ | ||
/** @var PatternMatch[] $matchers */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,11 +28,8 @@ | |
* | ||
* @author Sebastiaan Stok <[email protected]> | ||
*/ | ||
class RangeOptimizer implements SearchConditionOptimizer | ||
final class RangeOptimizer implements SearchConditionOptimizer | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function process(SearchCondition $condition) | ||
{ | ||
$fieldSet = $condition->getFieldSet(); | ||
|
@@ -54,9 +51,6 @@ public function process(SearchCondition $condition) | |
$this->normalizeRangesInGroup($condition->getValuesGroup(), $fieldSet); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getPriority(): int | ||
{ | ||
return -5; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,13 +28,10 @@ | |
* | ||
* @author Sebastiaan Stok <[email protected]> | ||
*/ | ||
class ValuesToRange implements SearchConditionOptimizer | ||
final class ValuesToRange implements SearchConditionOptimizer | ||
{ | ||
private $comparators = []; | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function process(SearchCondition $condition) | ||
{ | ||
$fieldSet = $condition->getFieldSet(); | ||
|
@@ -61,9 +58,6 @@ public function process(SearchCondition $condition) | |
$this->optimizeValuesInGroup($valuesGroup, $fieldSet); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getPriority(): int | ||
{ | ||
// run before range optimizer | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,9 @@ | |
|
||
namespace Rollerworks\Component\Search; | ||
|
||
/** | ||
* @author Sebastiaan Stok <[email protected]> | ||
*/ | ||
final class ErrorList extends \ArrayObject | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,9 @@ | |
|
||
namespace Rollerworks\Component\Search\Exception; | ||
|
||
class BadMethodCallException extends \BadMethodCallException implements SearchException | ||
/** | ||
* @author Sebastiaan Stok <[email protected]> | ||
*/ | ||
final class BadMethodCallException extends \BadMethodCallException implements SearchException | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,9 @@ | |
|
||
use Rollerworks\Component\Search\ConditionErrorMessage; | ||
|
||
/** | ||
* @author Sebastiaan Stok <[email protected]> | ||
*/ | ||
final class InvalidSearchConditionException extends \InvalidArgumentException implements SearchException | ||
{ | ||
private $errors; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,6 @@ | |
/** | ||
* @author Sebastiaan Stok <[email protected]> | ||
*/ | ||
class TransformationFailedException extends \RuntimeException implements SearchException | ||
final class TransformationFailedException extends \RuntimeException implements SearchException | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,9 @@ | |
|
||
namespace Rollerworks\Component\Search\Exception; | ||
|
||
/** | ||
* @author Sebastiaan Stok <[email protected]> | ||
*/ | ||
final class UnsupportedFieldSetException extends InvalidArgumentException | ||
{ | ||
public function __construct(array $expected, string $provided) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,6 @@ | |
|
||
use Rollerworks\Component\Search\DataTransformer; | ||
use Rollerworks\Component\Search\Exception\InvalidArgumentException; | ||
use Rollerworks\Component\Search\Exception\UnexpectedTypeException; | ||
|
||
/** | ||
* @author Bernhard Schussek <[email protected]> | ||
|
@@ -46,8 +45,6 @@ abstract class BaseDateTimeTransformer implements DataTransformer | |
* | ||
* @param string|null $inputTimezone The name of the input timezone | ||
* @param string|null $outputTimezone The name of the output timezone | ||
* | ||
* @throws UnexpectedTypeException if a timezone is not a string | ||
*/ | ||
public function __construct(?string $inputTimezone = null, ?string $outputTimezone = null) | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ | |
* | ||
* @author Bernhard Schussek <[email protected]> | ||
*/ | ||
class IntegerToLocalizedStringTransformer extends NumberToLocalizedStringTransformer | ||
final class IntegerToLocalizedStringTransformer extends NumberToLocalizedStringTransformer | ||
{ | ||
/** | ||
* Constructs a transformer. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ | |
* | ||
* @author Bernhard Schussek <[email protected]> | ||
*/ | ||
class IntegerToStringTransformer extends NumberToStringTransformer | ||
final class IntegerToStringTransformer extends NumberToStringTransformer | ||
{ | ||
/** | ||
* Constructs a transformer. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,8 +23,6 @@ | |
/** | ||
* Transforms between a normalized format and a money string. | ||
* | ||
* @author Bernhard Schussek <[email protected]> | ||
* @author Florian Eckerstorfer <[email protected]> | ||
* @author Sebastiaan Stok <[email protected]> | ||
*/ | ||
final class MoneyToStringTransformer implements DataTransformer | ||
|
@@ -33,11 +31,6 @@ final class MoneyToStringTransformer implements DataTransformer | |
private $moneyParser; | ||
private $formatter; | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @param string $defaultCurrency | ||
*/ | ||
public function __construct(string $defaultCurrency) | ||
{ | ||
$this->defaultCurrency = $defaultCurrency; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.