<commit_before><?php

namespace Dan\Shopify\Integrations\Laravel\Http;

use BadMethodCallException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Response;

/**
 * Class WebhookController.
 */
class WebhookController
{
    /**
     * @param $topic
     * @param Request $request
     *
     * @throws BadMethodCallException
     *
     * @return JsonResponse
     */
    public function handle($topic, Request $request)
    {
        $class = config("shopify.webhooks.event_routing.{$topic}");

        switch (true) {
            case empty($class):
                throw new BadMethodCallException("dan/shopify::event topic `{$topic}` class not configured.");
            case ! class_exists($class):
                throw new BadMethodCallException("dan/shopify::event topic `{$topic}` class does not exist.");
            default:
                event(new $class($topic, $request->all()));
        }

        return Response::json(['success' => true]);
    }
}<commit_msg>Accept false as skip.<commit_after><?php

namespace Dan\Shopify\Integrations\Laravel\Http;

use BadMethodCallException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Response;

/**
 * Class WebhookController.
 */
class WebhookController
{
    /**
     * @param $topic
     * @param Request $request
     *
     * @throws BadMethodCallException
     *
     * @return JsonResponse
     */
    public function handle($topic, Request $request)
    {
        $class = config("shopify.webhooks.event_routing.{$topic}");

        switch (true) {
            case $class === false:
                //Do Nothing
                break;
            case empty($class):
                throw new BadMethodCallException("dan/shopify::event topic `{$topic}` class not configured.");
            case ! class_exists($class):
                throw new BadMethodCallException("dan/shopify::event topic `{$topic}` class does not exist.");
            default:
                event(new $class($topic, $request->all()));
        }

        return Response::json(['success' => true]);
    }
}
{'fraction_non_alphanumeric': 0.12864658058345288, 'fraction_numerical': 0.0, 'mean_word_length': 2.4407894736842106, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '6266134', 'n_tokens_mistral': 563, 'n_tokens_neox': 565, 'n_words': 131}