Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
SkipPasswordFields
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
2 / 2
3
100.00% covered (success)
100.00%
1 / 1
 support
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
2
 getIndexes
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2namespace Apie\Core\Indexing;
3
4use Apie\Core\Context\ApieContext;
5use Apie\Core\ValueObjects\Interfaces\ValueObjectInterface;
6use Apie\Core\ValueObjects\IsPasswordValueObject;
7use ReflectionClass;
8
9class SkipPasswordFields implements IndexingStrategyInterface
10{
11    public function support(object $object): bool
12    {
13        $refl = new ReflectionClass($object);
14        return $object instanceof ValueObjectInterface && in_array(IsPasswordValueObject::class, $refl->getTraitNames());
15    }
16
17    public function getIndexes(object $object, ApieContext $context, Indexer $indexer): array
18    {
19        return [];
20    }
21}