Code Duplication    Length = 47-50 lines in 3 locations

risoluto/apps/RisolutoApps/Admin/GroupMng/AddEntry.php 1 location

@@ 21-67 (lines=47) @@
18
//------------------------------------------------------//
19
// クラス定義
20
//------------------------------------------------------//
21
class AddEntry extends \Risoluto\RisolutoControllerBase implements \Risoluto\RisolutoControllerInterface
22
{
23
    // View関連の処理を使用する
24
    use \Risoluto\RisolutoViewTrait;
25
26
    /**
27
     * play()
28
     *
29
     * 主処理を行う
30
     *
31
     * @access    public
32
     *
33
     * @param     void
34
     *
35
     * @return    void    なし
36
     */
37
    public function play()
38
    {
39
        // セッションをスタート
40
        $sess = new \Risoluto\Session();
41
        $sess->start();
42
43
        // 共通処理クラスを呼び出し
44
        $common = new \RisolutoApps\Admin\AdminCommon;
45
        $detail = $common->loginCheck( $sess, true );
46
47
        // セッションにフォーム入力情報が存在した場合は取得
48
        $entered = [ ];
49
        if ($sess->isThere( 'form' )) {
50
            $entered = $sess->load( 'form' );
51
            $sess->revoke( 'form' );
52
        }
53
54
        // ヘッダ情報のセット
55
        $header = $this->getDefaultHeader();
56
        $header = $this->replaceHeader( $header, 'robots', 'NOINDEX,NOFOLLOW' );
57
58
        // テンプレートエンジン関連の処理
59
        $assign_value = [
60
            'header' => $header,
61
            'detail' => $detail,
62
            'entered' => $entered,
63
            'csrf_token' => $sess->load( 'csrf_token' )
64
        ];
65
        $this->risolutoView( $assign_value );
66
    }
67
}

risoluto/apps/RisolutoApps/Admin/GroupMng/ModEntry.php 1 location

@@ 21-70 (lines=50) @@
18
//------------------------------------------------------//
19
// クラス定義
20
//------------------------------------------------------//
21
class ModEntry extends \Risoluto\RisolutoControllerBase implements \Risoluto\RisolutoControllerInterface
22
{
23
    // View関連の処理を使用する
24
    use \Risoluto\RisolutoViewTrait;
25
26
    /**
27
     * play()
28
     *
29
     * 主処理を行う
30
     *
31
     * @access    public
32
     *
33
     * @param     void
34
     *
35
     * @return    void    なし
36
     * @throws    \Exception フォームデータを取得できなかった場合はThrow
37
     */
38
    public function play()
39
    {
40
        // セッションをスタート
41
        $sess = new \Risoluto\Session();
42
        $sess->start();
43
44
        // 共通処理クラスを呼び出し
45
        $common = new \RisolutoApps\Admin\AdminCommon;
46
        $detail = $common->loginCheck( $sess, true );
47
48
        if ($sess->isThere( 'form' )) {
49
            // セッションにフォーム入力情報が存在した場合は取得
50
            $entered = $sess->load( 'form' );
51
            $sess->revoke( 'form' );
52
        } else {
53
            // 存在しない場合は例外をThrow
54
            throw new \Exception( 'Cannot get form data.' );
55
        }
56
57
        // ヘッダ情報のセット
58
        $header = $this->getDefaultHeader();
59
        $header = $this->replaceHeader( $header, 'robots', 'NOINDEX,NOFOLLOW' );
60
61
        // テンプレートエンジン関連の処理
62
        $assign_value = [
63
            'header' => $header,
64
            'detail' => $detail,
65
            'entered' => $entered,
66
            'csrf_token' => $sess->load( 'csrf_token' )
67
        ];
68
        $this->risolutoView( $assign_value );
69
    }
70
}

risoluto/apps/RisolutoApps/Admin/SelfEntry.php 1 location

@@ 21-68 (lines=48) @@
18
//------------------------------------------------------//
19
// クラス定義
20
//------------------------------------------------------//
21
class SelfEntry extends \Risoluto\RisolutoControllerBase implements \Risoluto\RisolutoControllerInterface
22
{
23
    // View関連の処理を使用する
24
    use \Risoluto\RisolutoViewTrait;
25
26
    /**
27
     * play()
28
     *
29
     * 主処理を行う
30
     *
31
     * @access    public
32
     *
33
     * @param     void
34
     *
35
     * @return    void    なし
36
     * @throws    \Exception フォームデータを取得できなかった場合はThrow
37
     */
38
    public function play()
39
    {
40
        // セッションをスタート
41
        $sess = new \Risoluto\Session();
42
        $sess->start();
43
44
        // 共通処理クラスを呼び出し
45
        $common = new \RisolutoApps\Admin\AdminCommon;
46
        $detail = $common->loginCheck( $sess, false );
47
48
        $entered = [ ];
49
        if ($sess->isThere( 'form' )) {
50
            // セッションにフォーム入力情報が存在した場合は取得
51
            $entered = $sess->load( 'form' );
52
            $sess->revoke( 'form' );
53
        }
54
55
        // ヘッダ情報のセット
56
        $header = $this->getDefaultHeader();
57
        $header = $this->replaceHeader( $header, 'robots', 'NOINDEX,NOFOLLOW' );
58
59
        // テンプレートエンジン関連の処理
60
        $assign_value = [
61
            'header' => $header,
62
            'detail' => $detail,
63
            'entered' => $entered,
64
            'csrf_token' => $sess->load( 'csrf_token' )
65
        ];
66
        $this->risolutoView( $assign_value );
67
    }
68
}