Code Duplication    Length = 20-22 lines in 2 locations

src/Component/Component.php 2 locations

@@ 164-185 (lines=22) @@
161
    /**
162
     * {@inheritdoc}
163
     */
164
    public function fireView()
165
    {
166
        if (!method_exists($this, 'callView')) {
167
            throw new BadMethodCallException('Not Found Method "callView"');
168
        }
169
170
        $view = $this->app->call([$this, 'callView']);
171
172
        if (!$view instanceof ViewInterface) {
173
            throw new InvalidArgumentException(
174
                sprintf(
175
                    'callView must be instanced of "%s".',
176
                    ViewInterface::class
177
                )
178
            );
179
        }
180
181
        //$view->setComponent($this);
182
        $view->initialize();
183
184
        return $view;
185
    }
186
187
    public function get()
188
    {
@@ 199-218 (lines=20) @@
196
    /**
197
     * {@inheritdoc}
198
     */
199
    public function fireCreate()
200
    {
201
        if (!method_exists($this, 'callCreate')) {
202
            return;
203
        }
204
205
        $form = $this->app->call([$this, 'callCreate']);
206
        if (!$form instanceof FormInterface) {
207
            throw new InvalidArgumentException(
208
                sprintf(
209
                    'callCreate must be instanced of "%s".',
210
                    FormInterface::class
211
                )
212
            );
213
        }
214
215
        $form->setModel($this->getModel());
216
217
        return $form;
218
    }
219
220
    /**
221
     * {@inheritdoc}