Code Duplication    Length = 14-18 lines in 3 locations

risoluto/lib/vendor/Risoluto/RisolutoViewTrait.php 3 locations

@@ 378-394 (lines=17) @@
375
     *
376
     * @return    string   デフォルトのヘッダ(CSS)
377
     */
378
    private function getDefaultHeaderCss( $outboards )
379
    {
380
        // 親クラスの情報を取得
381
        $called = new \ReflectionClass( get_called_class() );
382
        $parent = $called->getParentClass();
383
384
        // 基底クラスでオーバーライド用メソッドが定義されていたらそちらを優先する
385
        if (method_exists( $parent->getName(), 'getUserHeaderCss' )) {
386
            /** @noinspection PhpUndefinedMethodInspection */
387
            return parent::getUserHeaderCss();
388
        } else {
389
            return [
390
                '//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css',
391
                '/outboards/' . $outboards . '/css/common.css'
392
            ];
393
        }
394
    }
395
396
    /**
397
     * getDefaultHeaderJavaScript()
@@ 407-424 (lines=18) @@
404
     *
405
     * @return    string   デフォルトのヘッダ(JavaScript)
406
     */
407
    private function getDefaultHeaderJavaScript( $outboards )
408
    {
409
        // 親クラスの情報を取得
410
        $called = new \ReflectionClass( get_called_class() );
411
        $parent = $called->getParentClass();
412
413
        // 基底クラスでオーバーライド用メソッドが定義されていたらそちらを優先する
414
        if (method_exists( $parent->getName(), 'getUserHeaderJs' )) {
415
            /** @noinspection PhpUndefinedMethodInspection */
416
            return parent::getUserHeaderJs();
417
        } else {
418
            return [
419
                '//code.jquery.com/jquery-2.1.1.min.js',
420
                '//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js',
421
                '/outboards/' . $outboards . '/js/common.js',
422
            ];
423
        }
424
    }
425
426
    /**
427
     * getDefaultHeaderFavicon()
@@ 437-450 (lines=14) @@
434
     *
435
     * @return    string   デフォルトのヘッダ(favicon)
436
     */
437
    private function getDefaultHeaderFavicon( $outboards )
438
    {
439
        // 親クラスの情報を取得
440
        $called = new \ReflectionClass( get_called_class() );
441
        $parent = $called->getParentClass();
442
443
        // 基底クラスでオーバーライド用メソッドが定義されていたらそちらを優先する
444
        if (method_exists( $parent->getName(), 'getUserHeaderFavicon' )) {
445
            /** @noinspection PhpUndefinedMethodInspection */
446
            return parent::getUserHeaderFavicon();
447
        } else {
448
            return '/outboards/' . $outboards . '/img/favicon.ico';
449
        }
450
    }
451
452
    /**
453
     * getDefaultHeaderTitle()