<commit_before><?php


namespace Weaver;


class ImplementsWeaveInfo {

    /**
     * The classname that the subject class(es) gets weaved with.
     * @var string
     */
    protected $decoratorClass;

    /**
     * Which methods of the weaved get intercepted.
     *
     * @var string[]
     */
    private $methodBindingArray = [];
    
    private $initMethodName;
    private $lazyPropertyName;
    protected $interface = null;

    /**
     * @param $sourceClass - The class that you want to wrap in a proxy
     * @param $decoratorClass - The proxy class, todo not really required?
     * @param $interface      - The interface that you want to expose todo support multiple interfaces
     * @param $initMethodName - What you want the init method to be called todo not really required?
     * @param $lazyPropertyName - What variable to store the proxied in todo not really required?
     * @param $lazyFactory - optional  
     * @param $instanceFactoryMethod
     */
    function __construct(
        $decoratorClass, 
        $interface, //TODO Allow multiple interfaces
        $initMethodName = null,
        $lazyPropertyName = null
    ) {
        $this->decoratorClass = $decoratorClass;
        $this->methodBindingArray = [];
        $this->interface = $interface;

        if ($initMethodName) {
            $this->initMethodName = $initMethodName;
        }
        else {
            $this->initMethodName = 'init';
        }

        if ($lazyPropertyName) {
            $this->lazyPropertyName = $lazyPropertyName;
        }
        else {
            $this->lazyPropertyName = 'lazyInstance';
        }

        if (interface_exists($interface) == false) {
            throw new WeaveException("Error in ImplementsWeaveInfo: ".$interface." does not exist");
        }
    }

    /**
     * @return string
     */
    public function getDecoratorClass() {
        return $this->decoratorClass;
    }<commit_msg>Added checks for params to make detecting errors be easy.<commit_after><?php


namespace Weaver;


class ImplementsWeaveInfo {

    /**
     * The classname that the subject class(es) gets weaved with.
     * @var string
     */
    protected $decoratorClass;

    /**
     * Which methods of the weaved get intercepted.
     *
     * @var string[]
     */
    private $methodBindingArray = [];
    
    private $initMethodName;
    private $lazyPropertyName;
    protected $interface = null;

    /**
     * @param $sourceClass - The class that you want to wrap in a proxy
     * @param $decoratorClass - The proxy class, todo not really required?
     * @param $interface      - The interface that you want to expose todo support multiple interfaces
     * @param $initMethodName - What you want the init method to be called todo not really required?
     * @param $lazyPropertyName - What variable to store the proxied in todo not really required?
     * @param $lazyFactory - optional  
     * @param $instanceFactoryMethod
     */
    function __construct(
        $decoratorClass, 
        $interface, //TODO Allow multiple interfaces
        $initMethodName = null,
        $lazyPropertyName = null
    ) {
        $this->decoratorClass = $decoratorClass;
        $this->methodBindingArray = [];
        $this->interface = $interface;

        if ($initMethodName) {
            if (is_string($initMethodName) == false) {
                throw new WeaveException("initMethodName should be a string, ".gettype($initMethodName)." given.");
            }
            $this->initMethodName = $initMethodName;
        }
        else {
            $this->initMethodName = 'init';
        }

        if ($lazyPropertyName) {
            if (is_string($lazyPropertyName) == false) {
                throw new WeaveException("lazyPropertyName should be a string, ".gettype($lazyPropertyName)." given.");
            }
            $this->lazyPropertyName = $lazyPropertyName;
        }
        else {
            $this->lazyPropertyName = 'lazyInstance';
        }

        if (interface_exists($interface) == false) {
            throw new WeaveException("Error in ImplementsWeaveInfo: ".$interface." does not exist");
        }
    }

    /**
     * @return string
     */
    public function getDecoratorClass() {
        return $this->decoratorClass;
    }
{'fraction_non_alphanumeric': 0.09897531439217513, 'fraction_numerical': 0.0, 'mean_word_length': 2.2076176250933535, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, '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': '4905469', 'n_tokens_mistral': 1168, 'n_tokens_neox': 1131, 'n_words': 339}