Skip to content

Commit a68fe6e

Browse files
author
Ryan Lee
committed
IBX-10186 Run CS
1 parent 9b643de commit a68fe6e

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

eZ/Publish/API/Repository/Tests/LocationServiceTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1114,7 +1114,7 @@ public function testGetLocationChildCount()
11141114
);
11151115
}
11161116

1117-
/**
1117+
/**
11181118
* Test for the getLocationChildCount() method with a limitation on the number of children.
11191119
*
11201120
* @see \eZ\Publish\API\Repository\LocationService::getLocationChildCount()

eZ/Publish/Core/Persistence/Legacy/Filter/Gateway/Content/Doctrine/DoctrineGateway.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
namespace eZ\Publish\Core\Persistence\Legacy\Filter\Gateway\Content\Doctrine;
1010

11-
use eZ\Publish\Core\Persistence\Legacy\Traits\Doctrine\LimitedCountQueryTrait;
1211
use function array_filter;
1312
use Doctrine\DBAL\Connection;
1413
use Doctrine\DBAL\DBALException;
@@ -19,6 +18,7 @@
1918
use eZ\Publish\Core\Persistence\Legacy\Content\Gateway as ContentGateway;
2019
use eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway as LocationGateway;
2120
use eZ\Publish\Core\Persistence\Legacy\Filter\Gateway\Gateway;
21+
use eZ\Publish\Core\Persistence\Legacy\Traits\Doctrine\LimitedCountQueryTrait;
2222
use eZ\Publish\SPI\Persistence\Filter\CriterionVisitor;
2323
use eZ\Publish\SPI\Persistence\Filter\Doctrine\FilteringQueryBuilder;
2424
use eZ\Publish\SPI\Persistence\Filter\SortClauseVisitor;
@@ -94,7 +94,7 @@ public function count(FilteringCriterion $criterion, ?int $limit = null): int
9494
{
9595
$query = $this->buildQuery(
9696
[$this->getDatabasePlatform()->getCountExpression('DISTINCT content.id')],
97-
$criterion
97+
$criterion
9898
);
9999

100100
$query = $this->wrapCountQuery(

eZ/Publish/Core/Persistence/Legacy/Filter/Gateway/Location/Doctrine/DoctrineGateway.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
use Doctrine\DBAL\DBALException;
1313
use Doctrine\DBAL\FetchMode;
1414
use Doctrine\DBAL\Platforms\AbstractPlatform;
15-
use Exception;
1615
use eZ\Publish\Core\Base\Exceptions\DatabaseException;
1716
use eZ\Publish\Core\Persistence\Legacy\Content\Gateway as ContentGateway;
1817
use eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway as LocationGateway;

eZ/Publish/Core/Persistence/Legacy/Traits/Doctrine/LimitedCountQueryTrait.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,16 @@
1717
trait LimitedCountQueryTrait
1818
{
1919
/**
20-
* Takes a QueryBuilder and wraps it in a count query.
20+
* Takes a QueryBuilder and wraps it in a count query.
2121
* This performs the following transformation to the passed query
2222
* SELECT DISTINCT COUNT(DISTINCT someField) FROM XXX WHERE YYY;
2323
* To
24-
* SELECT COUNT(*) FROM (SELECT DISTINCT someField FROM XXX WHERE YYY LIMIT N) AS csub;
25-
*
24+
* SELECT COUNT(*) FROM (SELECT DISTINCT someField FROM XXX WHERE YYY LIMIT N) AS csub;.
25+
*
2626
* @param \Doctrine\DBAL\Query\QueryBuilder $queryBuilder
2727
* @param string $countableField
2828
* @param mixed $limit
29+
*
2930
* @return \Doctrine\DBAL\Query\QueryBuilder
3031
*/
3132
protected function wrapCountQuery(
@@ -35,7 +36,7 @@ protected function wrapCountQuery(
3536
): QueryBuilder {
3637
$useLimit = $limit !== null && $limit > 0;
3738

38-
if(!$useLimit) {
39+
if (!$useLimit) {
3940
return $queryBuilder;
4041
}
4142

@@ -44,6 +45,7 @@ protected function wrapCountQuery(
4445
->getSQL();
4546

4647
$countQuery = $this->connection->createQueryBuilder();
48+
4749
return $countQuery
4850
->select(
4951
$queryBuilder->getConnection()->getDatabasePlatform()->getCountExpression('*')

eZ/Publish/Core/Repository/LocationService.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,11 +372,11 @@ public function loadParentLocationsForDraftContent(VersionInfo $versionInfo, ?ar
372372
/**
373373
* Returns the number of children which are readable by the current user of a Location object.
374374
*/
375-
public function getLocationChildCount(APILocation $location, ?int $limit = null): int
375+
public function getLocationChildCount(APILocation $location, ?int $limit = null): int
376376
{
377377
$filter = $this->buildLocationChildrenFilter($location);
378378

379-
return $this->count($filter,null, $limit);
379+
return $this->count($filter, null, $limit);
380380
}
381381

382382
public function getSubtreeSize(APILocation $location, ?int $limit = null): int

0 commit comments

Comments
 (0)