<commit_before><?php

namespace Tylercd100\LERN\Notifications;

use Exception;
use Monolog\Logger;

class MonologHandlerFactory {

    protected $config;

    /**
     * Creates a handler for a specified driver
     * @param  string $driver                   Lowercase driver string that is also in the config/lern.php file
     * @param  array  $subject                  Title or Subject line for the notification
     * @return \Monolog\Handler\HandlerInterface A handler to use with a Monolog\Logger instance
     */
    public function create($driver, $subject = null)
    {
        $this->config = config('lern.notify.' . $driver);
        if (is_array($this->config)) {
                    return $this->{$driver}($subject);
        }
    }

    /**
     * Creates FleepHook Monolog Handler
     * @return \Monolog\Handler\FleepHookHandler A handler to use with a Monolog\Logger instance
     */
    protected function fleephook(){
        return new \Monolog\Handler\FleepHookHandler(
            $this->config['token'],
            Logger::ERROR
        );
    }

    /**
     * Creates HipChat Monolog Handler
     * @return \Monolog\Handler\HipChatHandler A handler to use with a Monolog\Logger instance
     */
    protected function hipchat(){
        return new \Monolog\Handler\HipChatHandler(
            $this->config['token'],
            $this->config['room'],
            $this->config['name'],
            $this->config['notify'],
            Logger::ERROR
        );
    }

    /**
     * Creates Flowdock Monolog Handler
     * @return \Monolog\Handler\FlowdockHandler A handler to use with a Monolog\Logger instance
     */
    protected function flowdock(){
        return new \Monolog\Handler\FlowdockHandler(
            $this->config['token'],
            Logger::ERROR
        );
    }

    /**
     * Creates Pushover Monolog Handler
     * @param  array $subject  Title or Subject line for the notification
     * @return \Monolog\Handler\PushoverHandler A handler to use with a Monolog\Logger instance
     */
    protected function pushover($subject)
    {
        $this->checkSubject($subject);
        return new \Monolog\Handler\PushoverHandler(
            $this->config['token'],
            $this->config['user'],
            $subject,
            Logger::ERROR
        );
    }

    /**
     * Creates Mail Monolog Handler
     * @param  array $subject      Title or Subject line for the notification
     * @return \Monolog\Handler\NativeMailerHandler A handler to use with a Monolog\Logger instance
     */
    protected function mail($subject)
    {<commit_msg>Scrutinizer Auto-Fixes<commit_after><?php

namespace Tylercd100\LERN\Notifications;

use Exception;
use Monolog\Logger;

class MonologHandlerFactory {

    protected $config;

    /**
     * Creates a handler for a specified driver
     * @param  string $driver                   Lowercase driver string that is also in the config/lern.php file
     * @param  array  $subject                  Title or Subject line for the notification
     * @return \Monolog\Handler\HandlerInterface A handler to use with a Monolog\Logger instance
     */
    public function create($driver, $subject = null)
    {
        $this->config = config('lern.notify.' . $driver);
        if (is_array($this->config)) {
                    return $this->{$driver}($subject);
        }
    }

    /**
     * Creates FleepHook Monolog Handler
     * @return \Monolog\Handler\FleepHookHandler A handler to use with a Monolog\Logger instance
     */
    protected function fleephook() {
        return new \Monolog\Handler\FleepHookHandler(
            $this->config['token'],
            Logger::ERROR
        );
    }

    /**
     * Creates HipChat Monolog Handler
     * @return \Monolog\Handler\HipChatHandler A handler to use with a Monolog\Logger instance
     */
    protected function hipchat() {
        return new \Monolog\Handler\HipChatHandler(
            $this->config['token'],
            $this->config['room'],
            $this->config['name'],
            $this->config['notify'],
            Logger::ERROR
        );
    }

    /**
     * Creates Flowdock Monolog Handler
     * @return \Monolog\Handler\FlowdockHandler A handler to use with a Monolog\Logger instance
     */
    protected function flowdock() {
        return new \Monolog\Handler\FlowdockHandler(
            $this->config['token'],
            Logger::ERROR
        );
    }

    /**
     * Creates Pushover Monolog Handler
     * @param  array $subject  Title or Subject line for the notification
     * @return \Monolog\Handler\PushoverHandler A handler to use with a Monolog\Logger instance
     */
    protected function pushover($subject)
    {
        $this->checkSubject($subject);
        return new \Monolog\Handler\PushoverHandler(
            $this->config['token'],
            $this->config['user'],
            $subject,
            Logger::ERROR
        );
    }

    /**
     * Creates Mail Monolog Handler
     * @param  array $subject      Title or Subject line for the notification
     * @return \Monolog\Handler\NativeMailerHandler A handler to use with a Monolog\Logger instance
     */
    protected function mail($subject)
    {
{'fraction_non_alphanumeric': 0.10214641625143733, 'fraction_numerical': 0.0011498658489842851, 'mean_word_length': 2.136418269230769, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 27, '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': '2001401', 'n_tokens_mistral': 1394, 'n_tokens_neox': 1352, 'n_words': 389}