<commit_before><?php
namespace Payum\Klarna\Invoice\Action\Api;

use Payum\Core\Action\ActionInterface;
use Payum\Core\ApiAwareInterface;
use Payum\Core\ApiAwareTrait;
use Payum\Core\Exception\UnsupportedApiException;
use Payum\Klarna\Invoice\Config;

abstract class BaseApiAwareAction implements ApiAwareInterface, ActionInterface
{
    use ApiAwareTrait {
        setApi as _setApi;
    }

    /**
     * BC. will be removed in 2.x. @use $this->api
     *
     * @var Config
     */
    protected $config;

    /**
     * @var \Klarna
     */
    private $klarna;

    /**
     * @param \Klarna $klarna
     */
    public function __construct(\Klarna $klarna = null)
    {
        $this->klarna = $klarna ?: new \Klarna();

        $this->apiClass = Config::class;
    }

    /**
     * @param mixed $api
     *
     * @throws UnsupportedApiException if the given Api is not supported.
     */
    public function setApi($api)
    {
        $this->_setApi($api);

        // BC. will be removed in 2.x. @use $this->api
        $this->config = $this->api;
    }

    /**
     * @return \Klarna
     */
    protected function getKlarna()
    {
        $this->klarna->config(
            $this->config->eid,
            $this->config->secret,
            $this->config->country,
            $this->config->language,
            $this->config->currency,
            $this->config->mode
        );

        $this->klarna->clear();<commit_msg>Fix deprecation comments, use proper phpdoc #771<commit_after><?php
namespace Payum\Klarna\Invoice\Action\Api;

use Payum\Core\Action\ActionInterface;
use Payum\Core\ApiAwareInterface;
use Payum\Core\ApiAwareTrait;
use Payum\Core\Exception\UnsupportedApiException;
use Payum\Klarna\Invoice\Config;

abstract class BaseApiAwareAction implements ApiAwareInterface, ActionInterface
{
    use ApiAwareTrait {
        setApi as _setApi;
    }

    /**
     * @deprecated BC. will be removed in 2.x. Use $this->api
     *
     * @var Config
     */
    protected $config;

    /**
     * @var \Klarna
     */
    private $klarna;

    /**
     * @param \Klarna $klarna
     */
    public function __construct(\Klarna $klarna = null)
    {
        $this->klarna = $klarna ?: new \Klarna();

        $this->apiClass = Config::class;
    }

    /**
     * @param mixed $api
     *
     * @throws UnsupportedApiException if the given Api is not supported.
     */
    public function setApi($api)
    {
        $this->_setApi($api);

        // BC. will be removed in 2.x. Use $this->api
        $this->config = $this->api;
    }

    /**
     * @return \Klarna
     */
    protected function getKlarna()
    {
        $this->klarna->config(
            $this->config->eid,
            $this->config->secret,
            $this->config->country,
            $this->config->language,
            $this->config->currency,
            $this->config->mode
        );

        $this->klarna->clear();
{'fraction_non_alphanumeric': 0.13581936366746494, 'fraction_numerical': 0.0023947998631542937, 'mean_word_length': 2.0082304526748973, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 49, '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': '3607422', 'n_tokens_mistral': 951, 'n_tokens_neox': 921, 'n_words': 192}