Code Duplication    Length = 10-10 lines in 2 locations

src/Core/Assets/Mixin.php 1 location

@@ 76-85 (lines=10) @@
73
     * @param string $component_name            
74
     * @param array $args            
75
     */
76
    public function __call(string $component_name, array $args)
77
    {
78
        if (! method_exists($this, $component_name)) {
79
            $this->{$component_name} = Closure::bind(function () use ($component_name) {
80
                return $this->component($component_name);
81
            }, $this, get_class());
82
        }
83
        
84
        return call_user_func($this->{$component_name}, $args);
85
    }
86
87
    /**
88
     * Create Closure to mock compnent to be aplied to entity using this mixin

src/Core/Entity.php 1 location

@@ 182-191 (lines=10) @@
179
     * @param string $component_name            
180
     * @param array $args            
181
     */
182
    public function __call(string $component_name, array $args)
183
    {
184
        if (! method_exists($this, $component_name)) {
185
            $this->{$component_name} = Closure::bind(function () use ($component_name) {
186
                return $this->component($component_name);
187
            }, $this, get_class());
188
        }
189
        
190
        return call_user_func($this->{$component_name}, $args);
191
    }
192
193
    /**
194
     * Create and add DOM element of the entity