<commit_before><?php

namespace StackGuru\Commands\Google;

use StackGuru\Core\Command\AbstractCommand;
use StackGuru\Core\Command\CommandContext;
use StackGuru\Core\Utils;


class Image extends AbstractCommand
{
    use UrlHelper;
    
    protected static $name = "image";
    protected static $description = "search images";


    public function process (string $query, ?CommandContext $ctx) : string
    {
        $args = explode(' ', $query);

        if (sizeof($args) >= 1 && 0 !== strlen($args[0])) {
            $query = implode(" ", $args);
        } else {
            $query = "Why am I such an asshole?";
        }

        $link = self::buildSearchUrl([
            'q' => $query,
            "tbm" => "isch"
        ]);

        if ($ctx)
            Utils\Response::sendResponse($link, $ctx->message);

        return $link;
    }
}<commit_msg>Updated google command<commit_after><?php

namespace StackGuru\Commands\Google;

use StackGuru\Core\Command\AbstractCommand;
use StackGuru\Core\Command\CommandContext;
use StackGuru\Core\Utils;


class Image extends AbstractCommand
{
    use UrlHelper;
    
    protected static $name = "image";
    protected static $description = "search images";


    public function process (string $query, ?CommandContext $ctx) : string
    {
        $args = explode(' ', $query);

        if (sizeof($args) >= 1 && 0 !== strlen($args[0])) {
            $query = implode(" ", $args);
        } else {
            $query = "Why am I such an asshole?";
        }

        $link = self::buildSearchUrl([
            'q' => $query,
            "tbm" => "isch"
        ]);

        return $link;
    }
}
{'fraction_non_alphanumeric': 0.1407766990291262, 'fraction_numerical': 0.0036407766990291263, 'mean_word_length': 2.3245967741935485, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4797561', 'n_tokens_mistral': 495, 'n_tokens_neox': 479, 'n_words': 124}