Skip to content

Commit 5427146

Browse files
franmomuphansys
authored andcommitted
Fix CS
1 parent af2f052 commit 5427146

File tree

16 files changed

+39
-35
lines changed

16 files changed

+39
-35
lines changed

src/DoctrineExtensions.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
namespace Gedmo;
1111

1212
use function class_exists;
13+
1314
use Doctrine\Common\Annotations\AnnotationReader;
1415
use Doctrine\Common\Annotations\AnnotationRegistry;
1516
use Doctrine\Common\Annotations\PsrCachedReader;

src/Loggable/Document/Repository/LogEntryRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function revert($document, $version = 1)
8989
}
9090
if ($logs) {
9191
$data = [];
92-
while (($log = array_shift($logs))) {
92+
while ($log = array_shift($logs)) {
9393
$data = array_merge($data, $log->getData());
9494
}
9595
$this->fillDocument($document, $data);

src/Mapping/MappedEventSubscriber.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
namespace Gedmo\Mapping;
1111

1212
use function class_exists;
13+
1314
use Doctrine\Common\Annotations\AnnotationReader;
1415
use Doctrine\Common\Annotations\AnnotationRegistry;
1516
use Doctrine\Common\Annotations\PsrCachedReader;

src/References/ReferencesListener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ static function () use ($id, &$manager, $class, $identifier) {
105105
$identifier => $id,
106106
]);
107107

108-
return new ArrayCollection((is_array($results) ? $results : $results->toArray()));
108+
return new ArrayCollection(is_array($results) ? $results : $results->toArray());
109109
}
110110
)
111111
);
@@ -202,7 +202,7 @@ static function () use ($id, &$manager, $class, $identifier) {
202202
$identifier => $id,
203203
]);
204204

205-
return new ArrayCollection((is_array($results) ? $results : $results->toArray()));
205+
return new ArrayCollection(is_array($results) ? $results : $results->toArray());
206206
}
207207
)
208208
);

src/Translatable/Mapping/Driver/Xml.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function readExtendedMetadata($meta, array &$config)
3333

3434
$xml = $xml->children(self::GEDMO_NAMESPACE_URI);
3535

36-
if (('entity' === $xmlDoctrine->getName() || 'mapped-superclass' === $xmlDoctrine->getName())) {
36+
if ('entity' === $xmlDoctrine->getName() || 'mapped-superclass' === $xmlDoctrine->getName()) {
3737
if ($xml->count() && isset($xml->translation)) {
3838
/**
3939
* @var \SimpleXmlElement

src/Tree/Document/MongoDB/Repository/MaterializedPathRepository.php

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,18 +111,24 @@ public function getChildrenQueryBuilder($node = null, $direct = false, $sortByFi
111111
$nodePath = preg_quote($node->getPropertyValue($config['path']));
112112

113113
if ($direct) {
114-
$regex = sprintf('^%s([^%s]+%s)'.($includeNode ? '?' : '').'$',
115-
$nodePath,
116-
$separator,
117-
$separator);
114+
$regex = sprintf(
115+
'^%s([^%s]+%s)'.($includeNode ? '?' : '').'$',
116+
$nodePath,
117+
$separator,
118+
$separator
119+
);
118120
} else {
119-
$regex = sprintf('^%s(.+)'.($includeNode ? '?' : ''),
120-
$nodePath);
121+
$regex = sprintf(
122+
'^%s(.+)'.($includeNode ? '?' : ''),
123+
$nodePath
124+
);
121125
}
122126
} elseif ($direct) {
123-
$regex = sprintf('^([^%s]+)'.($includeNode ? '?' : '').'%s$',
127+
$regex = sprintf(
128+
'^([^%s]+)'.($includeNode ? '?' : '').'%s$',
124129
$separator,
125-
$separator);
130+
$separator
131+
);
126132
}
127133

128134
if ($regex) {

src/Tree/Entity/Repository/ClosureTreeRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ public function getNodesHierarchyQueryBuilder($node = null, $direct = false, arr
376376
->from($config['closure'], 'c')
377377
->innerJoin('c.descendant', 'node')
378378
->leftJoin('node.parent', 'p')
379-
->addOrderBy(($hasLevelProp ? 'node.'.$config['level'] : self::SUBQUERY_LEVEL), 'asc');
379+
->addOrderBy($hasLevelProp ? 'node.'.$config['level'] : self::SUBQUERY_LEVEL, 'asc');
380380

381381
if (null !== $node) {
382382
$q->where('c.ancestor = :node');

src/Tree/Mapping/Driver/Yaml.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,10 @@ public function readExtendedMetadata($meta, array &$config)
115115
}
116116

117117
$treePathInfo = $fieldMapping['gedmo']['treePath'] ?? $fieldMapping['gedmo'][array_search(
118-
'treePath',
119-
$fieldMapping['gedmo'],
120-
true
121-
)];
118+
'treePath',
119+
$fieldMapping['gedmo'],
120+
true
121+
)];
122122

123123
if (is_array($treePathInfo) && isset($treePathInfo['separator'])) {
124124
$separator = $treePathInfo['separator'];

src/Tree/Strategy/ORM/Nested.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,7 @@ public function processScheduledInsertion($em, $node, AdapterInterface $ea)
125125
}
126126
if (isset($config['root']) && !$meta->hasAssociation($config['root']) && !isset($config['rootIdentifierMethod'])) {
127127
$meta->getReflectionProperty($config['root'])->setValue($node, 0);
128-
} elseif (isset($config['rootIdentifierMethod']) && null === $meta->getReflectionProperty($config['root'])->getValue(
129-
$node
130-
)) {
128+
} elseif (isset($config['rootIdentifierMethod']) && null === $meta->getReflectionProperty($config['root'])->getValue($node)) {
131129
$meta->getReflectionProperty($config['root'])->setValue($node, 0);
132130
}
133131
}

tests/Gedmo/Mapping/Fixture/Attribute/TranslatableModel.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515

1616
class TranslatableModel
1717
{
18-
/**
19-
* @var string|null
20-
*/
2118
#[Gedmo\Translatable]
2219
private ?string $title;
2320

0 commit comments

Comments
 (0)