Code Duplication    Length = 20-22 lines in 2 locations

src/Component/Component.php 2 locations

@@ 170-191 (lines=22) @@
167
    /**
168
     * {@inheritdoc}
169
     */
170
    final public function fireDisplay()
171
    {
172
        if (! method_exists($this, 'callDisplay')) {
173
            throw new BadMethodCallException('Not Found Method "callDisplay"');
174
        }
175
176
        $display = $this->app->call([$this, 'callDisplay']);
177
178
        if (! $display instanceof DisplayInterface) {
179
            throw new InvalidArgumentException(
180
                sprintf(
181
                    'callDisplay must be instanced of "%s".',
182
                    DisplayInterface::class
183
                )
184
            );
185
        }
186
187
        $display->setModel($this->getModel());
188
        $display->initialize();
189
190
        return $display;
191
    }
192
193
    public function get()
194
    {
@@ 203-222 (lines=20) @@
200
    /**
201
     * {@inheritdoc}
202
     */
203
    final public function fireCreate()
204
    {
205
        if (! method_exists($this, 'callCreate')) {
206
            return;
207
        }
208
209
        $form = $this->app->call([$this, 'callCreate']);
210
        if (! $form instanceof FormInterface) {
211
            throw new InvalidArgumentException(
212
                sprintf(
213
                    'callCreate must be instanced of "%s".',
214
                    FormInterface::class
215
                )
216
            );
217
        }
218
219
        $form->setModel($this->getModel());
220
221
        return $form;
222
    }
223
224
    /**
225
     * {@inheritdoc}