Skip to content

Commit

Permalink
style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
wickedOne committed Jul 19, 2020
1 parent 2f66d19 commit 3d607d0
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 7 deletions.
7 changes: 7 additions & 0 deletions src/Builder/Select/ExpressionBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

declare(strict_types=1);

/*
* This file is part of the Solarium package.
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code.
*/

namespace Solarium\Builder\Select;

use Solarium\Builder\Comparison;
Expand Down
7 changes: 7 additions & 0 deletions src/Builder/Select/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

declare(strict_types=1);

/*
* This file is part of the Solarium package.
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code.
*/

namespace Solarium\Builder\Select;

use Solarium\Builder\ExpressionInterface;
Expand Down
11 changes: 9 additions & 2 deletions src/Builder/Select/QueryExpressionVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

declare(strict_types=1);

/*
* This file is part of the Solarium package.
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code.
*/

namespace Solarium\Builder\Select;

use Solarium\Builder\AbstractExpressionVisitor;
Expand Down Expand Up @@ -104,7 +111,7 @@ public function walkExpression(ExpressionInterface $expression)
case Comparison::EMPTY:
return sprintf('(*:* NOT %s:*)', $field);
default:
throw new RuntimeException('Unknown comparison operator: '.$expression->getOperator());
throw new RuntimeException(sprintf('Unknown comparison operator: %s', $expression->getOperator()));
}
}

Expand Down Expand Up @@ -135,7 +142,7 @@ public function walkCompositeExpression(ExpressionInterface $expr)
case CompositeComparison::TYPE_OR:
return implode(' OR ', $comparisons);
default:
throw new RuntimeException('Unknown composite '.$expr->getType());
throw new RuntimeException(sprintf('Unknown composite %s', $expr->getType()));
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/Component/QueryTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ public function setQuery(string $query, array $bind = null): QueryInterface
/**
* @param \Solarium\Builder\Select\QueryBuilder $builder
*
* @return \Solarium\Component\QueryInterface
*
* @throws \Solarium\Exception\RuntimeException
*
* @return \Solarium\Component\QueryInterface
*/
public function setQueryFromQueryBuilder(QueryBuilder $builder): QueryInterface
{
if (1 !== count($builder->getExpressions())) {
if (1 !== \count($builder->getExpressions())) {
throw new RuntimeException('The QueryBuilder can only contain one expression when setting the query. Use ExpressionBuilder::andX or ExpressionBuilder::orX to combine expressions.');
}

Expand Down
4 changes: 2 additions & 2 deletions src/QueryType/Select/Query/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -598,9 +598,9 @@ public function addFilterQueries(array $filterQueries): self
*
* @param \Solarium\Builder\Select\QueryBuilder $builder
*
* @return $this
*
* @throws \Solarium\Exception\RuntimeException
*
* @return $this
*/
public function addFilterQueriesFromQueryBuilder(QueryBuilder $builder): self
{
Expand Down

0 comments on commit 3d607d0

Please sign in to comment.