<commit_before><?php
namespace Codecloud\ShopifyApiClient\Endpoint;

use Codecloud\ShopifyApiClient\Client;
use Codecloud\ShopifyApiClient\EndpointFramework\Method;

abstract class Endpoint
{
    const GET = 'GET';
    const POST = 'POST';
    const PUT = 'PUT';
    const DELETE = 'DELETE';

    /**
     * @var array
     */
    private $endpointMethods = [];

    /**
     * @var Client
     */
    protected $api;

    /**
     * @param Client $apiClient
     */
    public function __construct(Client $apiClient)
    {
        $this->api = $apiClient;
    }

    /**
     * @param string $methodName
     * @return Method
     * @throws \Exception
     */
    protected function getMethod($methodName)
    {
        if (! array_key_exists($methodName, $this->getEndpointMethods())) {
            throw new \Exception('Method "' . $methodName . '" does not exist on endpoint "' . get_class($this) . '"');
        }

        return $this->endpointMethods[$methodName];
    }

    /**
     * @return array
     */
    private function getEndpointMethods()
    {
        if (! $this->endpointMethods) {
            /** @var \SplFileInfo $file */
            foreach ($this->getConfigFiles() as $file) {
                $configName = $file->getBasename('.yaml');
                $parsed     = $this->yamlParser->parse(file_get_contents($file->getRealPath()), true, true);

                $this->endpointMethods[$configName] = $parsed;
            }
        }

        return $this->endpointMethods;
    }

    /**
     * @return \Generator
     */
    private function getConfigFiles()
    {
        $dir = new \DirectoryIterator(__DIR__ . '/../../config/endpoints');

        foreach ($dir as $entry) {
            if ($entry->getExtension() != 'yaml') {
                continue;
            }

            yield $entry;
        }
    }
}<commit_msg>Removed yamlparser<commit_after><?php
namespace Codecloud\ShopifyApiClient\Endpoint;

use Codecloud\ShopifyApiClient\Client;
use Codecloud\ShopifyApiClient\EndpointFramework\Method;
use Symfony\Component\Yaml\Yaml;

abstract class Endpoint
{
    const GET = 'GET';
    const POST = 'POST';
    const PUT = 'PUT';
    const DELETE = 'DELETE';

    /**
     * @var array
     */
    private $endpointMethods = [];

    /**
     * @var Client
     */
    protected $api;

    /**
     * @param Client $apiClient
     */
    public function __construct(Client $apiClient)
    {
        $this->api = $apiClient;
    }

    /**
     * @param string $methodName
     * @return Method
     * @throws \Exception
     */
    protected function getMethod($methodName)
    {
        if (! array_key_exists($methodName, $this->getEndpointMethods())) {
            throw new \Exception('Method "' . $methodName . '" does not exist on endpoint "' . get_class($this) . '"');
        }

        return $this->endpointMethods[$methodName];
    }

    /**
     * @return array
     */
    private function getEndpointMethods()
    {
        if (! $this->endpointMethods) {
            /** @var \SplFileInfo $file */
            foreach ($this->getConfigFiles() as $file) {
                $configName = $file->getBasename('.yaml');
                $parsed     = Yaml::parse(file_get_contents($file->getRealPath()), true, true);

                $this->endpointMethods[$configName] = $parsed;
            }
        }

        return $this->endpointMethods;
    }

    /**
     * @return \Generator
     */
    private function getConfigFiles()
    {
        $dir = new \DirectoryIterator(__DIR__ . '/../../config/endpoints');

        foreach ($dir as $entry) {
            if ($entry->getExtension() != 'yaml') {
                continue;
            }

            yield $entry;
        }
    }
}
{'fraction_non_alphanumeric': 0.14232109354060574, 'fraction_numerical': 0.0, 'mean_word_length': 1.9316575019638649, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, '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': '1277103', 'n_tokens_mistral': 1073, 'n_tokens_neox': 1042, 'n_words': 217}