Skip to content

Commit

Permalink
Merge pull request #21 from clickbar/subquery-geoparam-fix
Browse files Browse the repository at this point in the history
Fixed missing unwrapping of geoparam in case of queryable
  • Loading branch information
ahawlitschek authored Feb 7, 2023
2 parents 99132e1 + aa2b600 commit cb31be7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Laravel 10 support
- PHP 8.2 support

### Fixed
- Typing bug when trying to use a Closure as Geoparam

## [1.0.2](https://github.com/clickbar/laravel-magellan/tree/1.0.2) - 2023-01-05

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions src/Database/Builder/BuilderUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ protected static function prepareParams(array $params, $builder, $invadedBuilder
if ($value instanceof MagellanBaseExpression) {
$invoked = $value->invoke($builder, $bindingType, null);
array_splice($params, $i, 1, [GeoParam::wrap(new Expression("{$invoked}$geometryTypeCastAppend"))]);
} elseif ($invadedBuilder->isQueryable($param)) {
[$sub, $bindings] = $invadedBuilder->createSub($param);
} elseif ($invadedBuilder->isQueryable($value)) {
[$sub, $bindings] = $invadedBuilder->createSub($value);
array_splice($params, $i, 1, [GeoParam::wrap(new Expression("($sub)$geometryTypeCastAppend"))]);
$invadedBuilder->addBinding($bindings, $bindingType);
} elseif (is_array($value)) {
Expand Down

0 comments on commit cb31be7

Please sign in to comment.