Conditions | 3 |
Paths | 2 |
Total Lines | 35 |
Code Lines | 20 |
Lines | 4 |
Ratio | 11.43 % |
Changes | 2 | ||
Bugs | 1 | Features | 2 |
1 | <?php |
||
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 | $groups = $common->getGroupList( 'id_and_name' ); |
||
47 | $entered = $common->checkEnteredUserData( $_POST, $sess->load( 'csrf_token' ) ); |
||
48 | |||
49 | // 入力情報はセッションに保存 |
||
50 | $sess->store( 'form', $entered ); |
||
51 | |||
52 | // エラー情報があった場合は入力画面に戻る |
||
53 | View Code Duplication | if (!empty( $entered[ 'error' ][ 'msg' ] ) or !empty( $entered[ 'error' ][ 'form_crit' ] )) { |
|
|
|||
54 | \Risoluto\Url::redirectTo( 'Admin_UserMng_AddEntry' ); |
||
55 | exit; |
||
56 | } |
||
57 | |||
58 | // ヘッダ情報のセット |
||
59 | $header = $this->getDefaultHeader(); |
||
60 | $header = $this->replaceHeader( $header, 'robots', 'NOINDEX,NOFOLLOW' ); |
||
61 | |||
62 | // テンプレートエンジン関連の処理 |
||
63 | $assign_value = [ |
||
64 | 'header' => $header, |
||
65 | 'detail' => $detail, |
||
66 | 'groups' => $groups, |
||
67 | 'entered' => $entered, |
||
68 | 'csrf_token' => $sess->load( 'csrf_token' ) |
||
69 | ]; |
||
70 | $this->risolutoView( $assign_value ); |
||
71 | } |
||
72 | } |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.