Skip to content

Commit 2336478

Browse files
committed
cs
1 parent d69f507 commit 2336478

File tree

5 files changed

+16
-24
lines changed

5 files changed

+16
-24
lines changed

tests/SpameriTests/Elastic/Data/Entity/EntityWithCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class EntityWithCollection extends \Spameri\Elastic\Entity\AbstractElasticEntity
99
{
1010

1111
/**
12-
* @param \Spameri\Elastic\Entity\Collection\EntityCollection<NestedObject> $items
12+
* @param \Spameri\Elastic\Entity\Collection\EntityCollection<\SpameriTests\Elastic\Data\Entity\NestedObject> $items
1313
*/
1414
public function __construct(
1515
#[\Spameri\Elastic\Mapping\Entity(class: \Spameri\Elastic\Entity\Property\ElasticId::class)]

tests/SpameriTests/Elastic/Data/Entity/EntityWithNestedContent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class EntityWithNestedContent extends \Spameri\Elastic\Entity\AbstractElasticEnt
99
{
1010

1111
/**
12-
* @param \Spameri\Elastic\Entity\Collection\EntityCollection<SimpleNestedEntity>|null $items
12+
* @param \Spameri\Elastic\Entity\Collection\EntityCollection<\SpameriTests\Elastic\Data\Entity\SimpleNestedEntity>|null $items
1313
*/
1414
public function __construct(
1515
#[\Spameri\Elastic\Mapping\Entity(class: \Spameri\Elastic\Entity\Property\ElasticId::class)]

tests/SpameriTests/Elastic/Data/Listener/MockListener.php

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,14 @@ class MockListener implements \Spameri\Elastic\EventManager\ListenerInterface
1414
*/
1515
public array $calls = [];
1616

17-
/**
18-
* @var array<class-string>
19-
*/
20-
private array $entityClasses;
21-
22-
private string $event;
23-
24-
2517
/**
2618
* @param array<class-string> $entityClasses
2719
*/
2820
public function __construct(
29-
array $entityClasses,
30-
string $event,
21+
private array $entityClasses,
22+
private string $event,
3123
)
3224
{
33-
$this->entityClasses = $entityClasses;
34-
$this->event = $event;
3525
}
3626

3727

tests/debug_insert.php

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111

1212
// Delete index
1313
$client = $container->getByType(\Spameri\Elastic\ClientProvider::class)->client();
14-
try { $client->indices()->delete(['index' => 'test_pagination*']); } catch (Exception $e) {}
14+
try {
15+
$client->indices()->delete(['index' => 'test_pagination*']); } catch (\Throwable $e) {
16+
}
1517
usleep(100000);
1618

1719
// Create index
@@ -24,15 +26,15 @@
2426
$identityMap = $container->getByType(\Spameri\Elastic\Model\IdentityMap::class);
2527
$ids = [];
2628
for ($i = 0; $i < 10; $i++) {
27-
$entity = new \SpameriTests\Elastic\Data\Entity\Title(
28-
new \Spameri\Elastic\Entity\Property\EmptyElasticId(),
29-
null,
30-
);
31-
$isChanged = $identityMap->isChanged($entity);
32-
echo "Entity $i before insert - isChanged: " . ($isChanged ? 'true' : 'false') . ", id: '" . $entity->id()->value() . "'" . PHP_EOL;
33-
$ids[] = $insert->execute($entity, 'test_pagination', false);
34-
echo "Insert $i result: " . $entity->id()->value() . PHP_EOL;
35-
echo "Persisted map: " . print_r($identityMap->persisted, true);
29+
$entity = new \SpameriTests\Elastic\Data\Entity\Title(
30+
new \Spameri\Elastic\Entity\Property\EmptyElasticId(),
31+
null,
32+
);
33+
$isChanged = $identityMap->isChanged($entity);
34+
echo "Entity $i before insert - isChanged: " . ($isChanged ? 'true' : 'false') . ", id: '" . $entity->id()->value() . "'" . PHP_EOL;
35+
$ids[] = $insert->execute($entity, 'test_pagination', false);
36+
echo "Insert $i result: " . $entity->id()->value() . PHP_EOL;
37+
echo "Persisted map: " . print_r($identityMap->persisted, true);
3638
}
3739

3840
echo 'Inserted IDs: ' . count($ids) . PHP_EOL;

tests/tmp/.gitignore

100644100755
File mode changed.

0 commit comments

Comments
 (0)