Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: apply a micro-optimization to explode() calls #5690

Merged
merged 1 commit into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
{
switch ($operator) {
case self::PARAMETER_BETWEEN:
$rangeValue = explode('..', $value);
$rangeValue = explode('..', $value, 2);

Check warning on line 73 in src/Doctrine/Odm/Filter/RangeFilter.php

View check run for this annotation

Codecov / codecov/patch

src/Doctrine/Odm/Filter/RangeFilter.php#L73

Added line #L73 was not covered by tests

$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
Loading