Conditions | 1 |
Paths | 1 |
Total Lines | 77 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
117 | public function contentsmanagement_ページ管理(\AcceptanceTester $I) |
||
118 | { |
||
119 | $I->wantTo('EA0603-UC01-T01(& UC01-T02/UC01-T03/UC01-T04/UC01-T05) ページ管理'); |
||
120 | $faker = Fixtures::get('faker'); |
||
121 | $page = 'page_'.$faker->word; |
||
122 | PageManagePage::go($I)->新規入力(); |
||
123 | |||
124 | /* 作成 */ |
||
125 | PageEditPage::at($I) |
||
126 | ->入力_名称($page) |
||
127 | ->入力_ファイル名($page) |
||
128 | ->入力_URL($page) |
||
129 | ->入力_内容($page) |
||
130 | ->入力_PC用レイアウト('下層ページ用レイアウト') |
||
131 | ->登録(); |
||
132 | $I->see('登録が完了しました。', PageEditPage::$登録完了メッセージ); |
||
133 | |||
134 | $I->amOnPage('/user_data/'.$page); |
||
135 | $I->see($page, 'body'); |
||
136 | |||
137 | /* 編集 */ |
||
138 | PageManagePage::go($I)->ページ編集($page); |
||
139 | PageEditPage::at($I) |
||
140 | ->入力_内容("{% extends 'default_frame.twig' %}") |
||
141 | ->登録(); |
||
142 | $I->see('登録が完了しました。', PageEditPage::$登録完了メッセージ); |
||
143 | |||
144 | $I->amOnPage('/user_data/'.$page); |
||
145 | $config = Fixtures::get('config'); |
||
146 | $I->seeElement('div.ec-layoutRole__footer'); |
||
147 | |||
148 | /* レイアウト編集 */ |
||
149 | LayoutManagePage::go($I)->レイアウト編集('下層ページ用レイアウト'); |
||
150 | LayoutEditPage::at($I) |
||
151 | ->ブロックを移動('新着情報', '#position_4') |
||
152 | ->登録(); |
||
153 | |||
154 | $I->see('登録が完了しました。', LayoutEditPage::$登録完了メッセージ); |
||
155 | $I->amOnPage('/user_data/'.$page); |
||
156 | $I->see('新着情報', '.ec-news'); |
||
157 | |||
158 | LayoutManagePage::go($I)->レイアウト編集('下層ページ用レイアウト'); |
||
159 | LayoutEditPage::at($I) |
||
160 | ->ブロックを移動('カゴの中', '#position_2') |
||
161 | ->登録(); |
||
162 | LayoutEditPage::at($I) |
||
163 | ->ブロックを移動('ログインナビ', '#position_2') |
||
164 | ->登録(); |
||
165 | LayoutEditPage::at($I) |
||
166 | ->ブロックを移動('商品検索', '#position_2') |
||
167 | ->コンテキストメニューで上に移動('商品検索') |
||
168 | ->登録(); |
||
169 | LayoutEditPage::at($I) |
||
170 | ->コンテキストメニューで下に移動('商品検索') |
||
171 | ->登録(); |
||
172 | LayoutEditPage::at($I) |
||
173 | ->コンテキストメニューでセクションに移動('商品検索') |
||
174 | ->登録(); |
||
175 | LayoutEditPage::at($I) |
||
176 | ->コンテキストメニューでコードプレビュー( |
||
177 | '商品検索', |
||
178 | ['xpath' => "//*[@id='block-source-code']//div[contains(text(), 'This file is part of EC-CUBE')]"] |
||
179 | ); |
||
180 | |||
181 | $I->getScenario()->incomplete('未実装:プレビューは未実装'); |
||
182 | |||
183 | LayoutManagePage::go($I)->レイアウト編集('下層ページ用レイアウト'); |
||
184 | LayoutEditPage::at($I) |
||
185 | ->ブロックを移動('新着情報', '#position_0') |
||
186 | ->プレビュー(); |
||
187 | |||
188 | $I->switchToNewWindow(); |
||
189 | |||
190 | /* 削除 */ |
||
191 | PageManagePage::go($I)->削除($page); |
||
192 | $I->see('削除が完了しました。', PageEditPage::$登録完了メッセージ); |
||
193 | } |
||
194 | |||
256 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.