Google Crawler. Searches the 100 first google results for some term I wrote a simple Google Crawler in PHP, and my GoogleProxy interface does not seem to follow the Single Responsibility Principle.

Here's my Interface code:

&lt;?php
/**
 * Interface that represents an online proxy service.
 * Every class that implement it must know how to return the apropriate ResponseInterface to an url based on what
 * the proxy service needs, and must know how to parse an url used within its pages.
 *
 * @package CViniciussDias\GoogleCrawler\Proxy
 * @author Vinicius Dias
 */
interface GoogleProxy
{
    /**
     * Gets the ResponseInterface for the informed URL based on all the information that
     * the proxy service needs
     *
     * @param string $url
     * @return ResponseInterface
     */
    public function getHttpResponse(string $url): ResponseInterface;

    /**
     * Parses an URL based on how they are encoded in the proxy service
     *
     * @param string $url
     * @return string
     */
    public function parseUrl(string $url): string;
}


And one of its implementations:

&lt;?php
namespace CViniciusSDias\GoogleCrawler\Proxy;

use CViniciusSDias\GoogleCrawler\Exception\InvalidResultException;
use GuzzleHttp\Client;
use Psr\Http\Message\ResponseInterface;

/**
 * Class that represents the absense of a proxy service, making the direct request to the url
 * and returning its response
 *
 * @package CViniciussDias\GoogleCrawler\Proxy
 * @author Vinicius Dias
 */
class NoProxy implements GoogleProxy
{
    public function getHttpResponse(string $url): ResponseInterface
    {
        return (new Client())-&gt;request('GET', $url);
    }

    public function parseUrl(string $url): string
    {
        // Separates the url parts
        $link = parse_url($url);
        // Parses the parameters of the url query
        parse_str($link['query'], $link);

        $url = filter_var($link['q'], FILTER_VALIDATE_URL);
        // If this is not a valid URL, so the result is (probably) an image, news or video suggestion
        if (!$url) {
            throw new InvalidResultException();
        }

        return $url;
    }
}


Here's the full code if needed (I would enjoy some pull requests too):
https://github.com/CViniciusSDias/google-crawler

Should I split the two tasks it performs into 2 separate classes? Several other Proxies will be implemented in a near future. Wouldn't it make the number of classes increase more than necessary?
Some thoughts:


Usually when naming an interface, you want to give some hint as to what actions that interface describes.  Here I don't quite understand what implementing GoogleProxy should be able to do for the implementing class.  What do getting a response and parsing a URL have to do with a proxy? What do these methods have to do with Google specifically? Would this interface better be named as HttpClient or something like that which indicates that these are the methods that need to be implemented by a class to enable the request/response aspects of crawling?
You might consider adding @throws in your interface documentation for parseUrl().  Not that this really does anything, but perhaps at least it can drive code consistency in having implementing classes throw appropriate exceptions and might help when working in an IDE.
In your getHttpResponse() implementation, you are doing nothing to either handle underlying exceptions that can be thrown by the Guzzle Client or indicate that the function might throw (why no doc blocks in implementing class?).
You should namespace your interface file.
In your parseUrl(), I think it is problematic that you are parsing the query string into the same array that you put your parse_url() results into.  Why not just create a new array here to eliminate confusion over what your intent is and to eliminate any possibility of overwriting date in $link() (if you ever wanted to do anything else with that data.
Should you really throw an exception if the URL value in the query string is not valid? I would think that this could be an expected occurrence that you might need to handle as you have no control over this input. Does this really represent an unexpected state in your application as is often the intended use for throwing exceptions?
Should you add some validation for the parametric input to both of these functions (i.e. non-zero length string, properly formed URL). In your getHttpResponse() implementation you can get as far as attempting to make a (relatively expensive) call on a remote host even if you have an empty string or invalid URL passed to the method.  I generally think it good practice to enforce some basic level of validation on parameters passed to public methods, perhaps throwing InvalidArgumentException or similar before getting into method logic such that you are failing fast and failing loudly when bad input is passed.
From looking at your wider library on Github, it seems as if you are trying to work with dependency injection. If you want to be consistent in this approach, I would think your implementing classes would need to take on dependencies such as the Guzzle client in their constructors, as opposed to within the methods that are implementing the interface.
With the above thought in mind, I am actually not sure that what you have right now is even best modeled as an interface vs. class inheritance since all the proxy classes you currently have implemented don't really do much outside of implement these two methods.