public function findByPhone(Phone $phone): Result
    {
        foreach ($this->results as $result) {
            if ($result->getPhone()->getValue() === $phone->getValue()) {
                return $result;
            }
        }

        throw new ResultNotFoundException(sprintf(
            'Not found result for phone "%s".',
            $phone
        ));
    }
public function findByPhone(Phone $phone): Result
    {
        foreach ($this->results as $result) {
            if ($result->getPhone()->getValue() === $phone->getValue()) {
                return $result;
            }
        }

        throw new ResultNotFoundException(sprintf(
            'Not found result for phone "%s".',
            $phone
        ));
    }
public function findByPhone ( Phone $ phone ) : Result { foreach ( $ this -> results as $ result ) { if ( $ result -> getPhone ( ) -> getValue ( ) === $ phone -> getValue ( ) ) { return $ result ; } } throw new ResultNotFoundException ( sprintf ( 'Not found result for phone "%s".' , $ phone ) ) ; }
Find the result by phone

@param Phone $phone

@return Result

@throws ResultNotFoundException
Find the result by phone