<commit_before><?php
/**
 * Created by <NAME>.
 * User: sinan
 * Date: 01/06/14
 * Time: 00:38
 */
namespace SanalPos\Est;

use SanalPos\SanalPosResponseInterface;
use SimpleXMLElement;

class SanalPosResponseEst implements SanalPosResponseInterface{
    protected $response;
    protected $xml;

    public function __construct($response)
    {
        $this->response = $response;
        $this->xml      = new SimpleXMLElement($response);
    }

    public function success()
    {
        // if response code === '00'
        // then the transaction is approved
        // if code is anything other than '00' that means there's an error
        return (string) $this->xml->CC5Response->ProcReturnCode === '00';
    }

    public function errors()
    {
        if ($this->success()) {
            return [];
        }

        return $this->xml->ErrMsg;
    }

    public function response()
    {
        return $this->xml;
    }
} <commit_msg>success function fix.<commit_after><?php
/**
 * Created by <NAME>.
 * User: sinan
 * Date: 01/06/14
 * Time: 00:38
 */
namespace SanalPos\Est;

use SanalPos\SanalPosResponseInterface;
use SimpleXMLElement;

class SanalPosResponseEst implements SanalPosResponseInterface{
    protected $response;
    protected $xml;

    public function __construct($response)
    {
        $this->response = $response;
        $this->xml      = new SimpleXMLElement($response);
    }

    public function success()
    {
        // if response code === '00'
        // then the transaction is approved
        // if code is anything other than '00' that means there's an error
        return (string) $this->xml->ProcReturnCode === '00';
    }

    public function errors()
    {
        if ($this->success()) {
            return [];
        }

        return $this->xml->ErrMsg;
    }

    public function response()
    {
        return $this->xml;
    }
} 
{'fraction_non_alphanumeric': 0.12202852614896989, 'fraction_numerical': 0.017432646592709985, 'mean_word_length': 2.305410122164049, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 10}, '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': '7576351', 'n_tokens_mistral': 570, 'n_tokens_neox': 539, 'n_words': 148}