<commit_before><?php

namespace MageTest\PHPSpec2\MagentoExtension\Loader;

use MageTest\PHPSpec2\MagentoExtension\Loader\LoaderException;

use PHPSpec2\Loader\Node\Specification as NodeSpecification;

use ReflectionClass;
use ReflectionException;

class SpecificationsClassLoader
{
    public function loadFromfile($filename)
    {
        $specifications = array();

        if (preg_match("/^spec\/([a-zA-Z0-9]+)\/([a-zA-Z0-9]+)\/(controllers)\/(.*)/", $filename, $matches)) {
            $specifications = $this->loadControllerSpec($matches);
        } elseif (preg_match("/^spec\/([a-zA-Z0-9]+)\/([a-zA-Z0-9]+)\/(Block|Helper|Model)\/(.*)/", $filename, $matches)) {
            $specifications = $this->loadStandardMagentoSpec($matches);
        } elseif (preg_match("/^spec\/([a-zA-Z0-9]+)\/([a-zA-Z0-9]+)\/(sql)\/(.*)/", $filename, $matches)) {
            $specifications = $this->loadSetupScriptsSpec($matches);<commit_msg>Make magento extension class loader implement proper interface<commit_after><?php

namespace MageTest\PHPSpec2\MagentoExtension\Loader;

use MageTest\PHPSpec2\MagentoExtension\Loader\LoaderException;

use PHPSpec2\Loader\Node\Specification as NodeSpecification;

use ReflectionClass;
use ReflectionException;

class SpecificationsClassLoader implements \PHPSpec2\Loader\LoaderInterface
{
    public function loadFromfile($filename, $line = null)
    {
        $specifications = array();

        if (preg_match("/^spec\/([a-zA-Z0-9]+)\/([a-zA-Z0-9]+)\/(controllers)\/(.*)/", $filename, $matches)) {
            $specifications = $this->loadControllerSpec($matches);
        } elseif (preg_match("/^spec\/([a-zA-Z0-9]+)\/([a-zA-Z0-9]+)\/(Block|Helper|Model)\/(.*)/", $filename, $matches)) {
            $specifications = $this->loadStandardMagentoSpec($matches);
        } elseif (preg_match("/^spec\/([a-zA-Z0-9]+)\/([a-zA-Z0-9]+)\/(sql)\/(.*)/", $filename, $matches)) {
            $specifications = $this->loadSetupScriptsSpec($matches);
{'fraction_non_alphanumeric': 0.19888381532217148, 'fraction_numerical': 0.015728056823947234, 'mean_word_length': 3.881188118811881, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '3635866', 'n_tokens_mistral': 664, 'n_tokens_neox': 664, 'n_words': 86}