Skip to content

Commit 35b252a

Browse files
committed
add object type hint
1 parent d1d03b3 commit 35b252a

File tree

12 files changed

+16
-26
lines changed

12 files changed

+16
-26
lines changed

Model/Action/PerformedBy/NotEmptyStrategy.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,12 @@ public function __construct(
2626

2727
public function get(): string
2828
{
29-
foreach ($this->performedByList as $performedBy) {
30-
$performer = $performedBy->get();
29+
$performer = self::PERFORMED_BY;
3130

32-
if (!empty($performer)) {
33-
return $performer;
34-
}
31+
foreach ($this->performedByList as $performedBy) {
32+
$performer = $performedBy->get() ?: $performer;
3533
}
3634

37-
return self::PERFORMED_BY;
35+
return $performer;
3836
}
3937
}

Model/Entity/EntityIterator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function __construct(
4242
* @inheritdoc
4343
* @throws Exception
4444
*/
45-
public function iterate($entity): void
45+
public function iterate(object $entity): void
4646
{
4747
$values = $this->hydratorPool->getHydrator($this->typeResolver->resolve($entity))->extract($entity);
4848

Model/Entity/EntityIteratorInterface.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,5 @@
1212
*/
1313
interface EntityIteratorInterface
1414
{
15-
/**
16-
* @param object $entity
17-
* @return void
18-
*/
19-
public function iterate($entity): void;
15+
public function iterate(object $entity): void;
2016
}

Model/Entity/EntityValue/CustomAttributesProcessor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function __construct(
2424
$this->processor = $processor;
2525
}
2626

27-
public function process($entity, string $key, $values): void
27+
public function process(object $entity, string $key, $values): void
2828
{
2929
if ($this->isValid($entity, $key, $values)) {
3030
foreach ($values as $value) {
@@ -41,7 +41,7 @@ public function process($entity, string $key, $values): void
4141
* @param mixed $values
4242
* @return bool
4343
*/
44-
private function isValid($entity, string $key, $values): bool
44+
private function isValid(object $entity, string $key, $values): bool
4545
{
4646
return $entity instanceof CustomAttributesDataInterface &&
4747
$key === CustomAttributesDataInterface::CUSTOM_ATTRIBUTES &&

Model/Entity/EntityValue/ExtensibleDataProcessor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function __construct(
2424
$this->processor = $processor;
2525
}
2626

27-
public function process($entity, string $key, $values): void
27+
public function process(object $entity, string $key, $values): void
2828
{
2929
if ($this->isValid($entity, $key, $values)) {
3030
foreach ($values as $value) {
@@ -41,7 +41,7 @@ public function process($entity, string $key, $values): void
4141
* @param mixed $values
4242
* @return bool
4343
*/
44-
private function isValid($entity, string $key, $values): bool
44+
private function isValid(object $entity, string $key, $values): bool
4545
{
4646
return $entity instanceof ExtensibleDataInterface &&
4747
$key === ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY &&

Model/Entity/EntityValue/StrategyProcessor.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
namespace Opengento\Gdpr\Model\Entity\EntityValue;
99

1010
use Opengento\Gdpr\Model\Entity\EntityValueProcessorInterface;
11-
use function array_combine;
12-
use function array_keys;
13-
use function array_values;
1411

1512
final class StrategyProcessor implements EntityValueProcessorInterface
1613
{
@@ -25,7 +22,7 @@ public function __construct(
2522
$this->processors = $processors;
2623
}
2724

28-
public function process($entity, string $key, $value): void
25+
public function process(object $entity, string $key, $value): void
2926
{
3027
($this->processors[$key] ?? $this->processors['default'])->process($entity, $key, $value);
3128
}

Model/Entity/EntityValueProcessorInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ interface EntityValueProcessorInterface
1818
* @param mixed $value
1919
* @return void
2020
*/
21-
public function process($entity, string $key, $value): void;
21+
public function process(object $entity, string $key, $value): void;
2222
}

Model/Entity/SourceProvider/ModifierComposite.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use Magento\Framework\Data\Collection;
1212

1313
/**
14-
* Class ModifierComposite
1514
* @api
1615
*/
1716
final class ModifierComposite implements ModifierInterface

Service/Anonymize/Processor/Entity/EntityValue/Processor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function __construct(
4040
$this->anonymizer = $anonymizer;
4141
}
4242

43-
public function process($entity, string $key, $value): void
43+
public function process(object $entity, string $key, $value): void
4444
{
4545
if (in_array($key, $this->metadata->getAttributes(), true)) {
4646
$this->document->addData($key, $this->anonymizer->anonymize($value));

Service/Anonymize/Processor/Entity/EntityValue/SmartProcessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function __construct(
4141
$this->anonymizerFactory = $anonymizerFactory;
4242
}
4343

44-
public function process($entity, string $key, $value): void
44+
public function process(object $entity, string $key, $value): void
4545
{
4646
if (in_array($key, $this->metadata->getAttributes(), true)) {
4747
$this->document->addData($key, $this->resolveAnonymizer($key)->anonymize($value));

0 commit comments

Comments
 (0)