Skip to content

Commit

Permalink
chore: apply a micro-optimization to explode() calls (#5690)
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas committed Jul 24, 2023
1 parent f4dbd17 commit 370bd07
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Doctrine/Odm/Filter/RangeFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ protected function addMatch(Builder $aggregationBuilder, string $field, string $
{
switch ($operator) {
case self::PARAMETER_BETWEEN:
$rangeValue = explode('..', $value);
$rangeValue = explode('..', $value, 2);

$rangeValue = $this->normalizeBetweenValues($rangeValue);
if (null === $rangeValue) {
Expand Down
2 changes: 1 addition & 1 deletion src/Doctrine/Orm/Filter/RangeFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ protected function addWhere(QueryBuilder $queryBuilder, QueryNameGeneratorInterf

switch ($operator) {
case self::PARAMETER_BETWEEN:
$rangeValue = explode('..', $value);
$rangeValue = explode('..', $value, 2);

$rangeValue = $this->normalizeBetweenValues($rangeValue);
if (null === $rangeValue) {
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Routing/ApiLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function load(mixed $data, string $type = null): RouteCollection
}

if ($controller = $operation->getController()) {
$controllerId = explode('::', $controller)[0];
$controllerId = explode('::', $controller, 2)[0];
if (!$this->container->has($controllerId)) {
throw new RuntimeException(sprintf('Operation "%s" is defining an unknown service as controller "%s". Make sure it is properly registered in the dependency injection container.', $operationName, $controllerId));
}
Expand Down

0 comments on commit 370bd07

Please sign in to comment.