<commit_before><?php
namespace Pyz\Yves\Checkout\Module\Controller;

use Generated\Yves\Factory;
use Pyz\Yves\Sales\Module\Form\OrderType;
use ProjectA\Yves\Checkout\Module\Controller\CheckoutController as CoreCheckoutController;
use Symfony\Component\HttpFoundation\Request;

class CheckoutController extends CoreCheckoutController
{
    /**
     * @param array $paymentMethods
     * @return OrderType
     */
    protected function createOrderType(array $paymentMethods = [])
    {
        $customerModel = Factory::getInstance()->createCustomerModelCustomer($this->getApplication());
        return new OrderType($paymentMethods, $customerModel);
    }

    public function indexAction(Request $request)
    {
        $returnVars = parent::indexAction($request);
        $payoneClientApi = Factory::getInstance()->createPayoneModelClientApiClientApi();
        $requestContainer = $payoneClientApi->creditCardCheck();
        $returnVars['payoneCreditcardCheckData'] = $requestContainer->toArray();
        return $returnVars;
    }
<commit_msg>check if response of parent controller is of type symfony response<commit_after><?php
namespace Pyz\Yves\Checkout\Module\Controller;

use Generated\Yves\Factory;
use Pyz\Yves\Sales\Module\Form\OrderType;
use ProjectA\Yves\Checkout\Module\Controller\CheckoutController as CoreCheckoutController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

class CheckoutController extends CoreCheckoutController
{
    /**
     * @param array $paymentMethods
     * @return OrderType
     */
    protected function createOrderType(array $paymentMethods = [])
    {
        $customerModel = Factory::getInstance()->createCustomerModelCustomer($this->getApplication());
        return new OrderType($paymentMethods, $customerModel);
    }

    public function indexAction(Request $request)
    {
        $response = parent::indexAction($request);
        if($response instanceof Response) {
            return $response;
        }
        if(is_array($response)) {
            $payoneClientApi = Factory::getInstance()->createPayoneModelClientApiClientApi();
            $requestContainer = $payoneClientApi->creditCardCheck();
            $returnVars['payoneCreditcardCheckData'] = $requestContainer->toArray();
        }
        return $response;
    }

{'fraction_non_alphanumeric': 0.10711225364181662, 'fraction_numerical': 0.0, 'mean_word_length': 4.054112554112554, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '6646355', 'n_tokens_mistral': 610, 'n_tokens_neox': 605, 'n_words': 110}