public function findOneBy(array $criteria = [])
    {
        Assertion::isArray($criteria);

        $storage = reset($this->storages);
        $identity = $storage->findOneBy($criteria);

        if ($identity !== null) {
            $this->validator->validate($identity);

            return $identity;
        }

        return null;
    }
public function findOneBy(array $criteria = [])
    {
        Assertion::isArray($criteria);

        $storage = reset($this->storages);
        $identity = $storage->findOneBy($criteria);

        if ($identity !== null) {
            $this->validator->validate($identity);

            return $identity;
        }

        return null;
    }
{@inheritdoc}