| Conditions | 1 |
| Paths | 1 |
| Total Lines | 96 |
| Code Lines | 71 |
| Lines | 0 |
| Ratio | 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 |
||
| 83 | protected function setUp() |
||
| 84 | { |
||
| 85 | parent::setUp(); |
||
| 86 | $this->converter = new PageConverter(); |
||
| 87 | |||
| 88 | $this->pageReference = new Parts\Page( |
||
| 89 | array( |
||
| 90 | 'layout' => '2ZonesLayout1', |
||
| 91 | 'zones' => array( |
||
| 92 | new Parts\Zone( |
||
| 93 | array( |
||
| 94 | 'id' => '6c7f907b831a819ed8562e3ddce5b264', |
||
| 95 | 'identifier' => 'left', |
||
| 96 | 'blocks' => array( |
||
| 97 | new Parts\Block( |
||
| 98 | array( |
||
| 99 | 'id' => '1e1e355c8da3c92e80354f243c6dd37b', |
||
| 100 | 'name' => 'Campaign', |
||
| 101 | 'type' => 'Campaign', |
||
| 102 | 'view' => 'default', |
||
| 103 | 'overflowId' => '', |
||
| 104 | 'zoneId' => '6c7f907b831a819ed8562e3ddce5b264', |
||
| 105 | 'attributes' => array(), |
||
| 106 | ) |
||
| 107 | ), |
||
| 108 | new Parts\Block( |
||
| 109 | array( |
||
| 110 | 'id' => '250bcab3ea2929edbf72ece096dcdb7a', |
||
| 111 | 'name' => 'Amazon Gallery', |
||
| 112 | 'type' => 'Gallery', |
||
| 113 | 'view' => 'default', |
||
| 114 | 'overflowId' => '', |
||
| 115 | 'zoneId' => '6c7f907b831a819ed8562e3ddce5b264', |
||
| 116 | 'items' => array( |
||
| 117 | new Parts\Item( |
||
| 118 | array( |
||
| 119 | 'action' => 'add', |
||
| 120 | 'contentId' => '62', |
||
| 121 | 'locationId' => '64', |
||
| 122 | 'priority' => '1', |
||
| 123 | 'publicationDate' => '1393607060', |
||
| 124 | 'visibilityDate' => '1393607060', |
||
| 125 | 'hiddenDate' => '1393607060', |
||
| 126 | 'rotationUntilDate' => '1393607060', |
||
| 127 | 'movedTo' => '42', |
||
| 128 | 'attributes' => array(), |
||
| 129 | ) |
||
| 130 | ), |
||
| 131 | new Parts\Item( |
||
| 132 | array( |
||
| 133 | 'action' => 'add', |
||
| 134 | 'attributes' => array(), |
||
| 135 | ) |
||
| 136 | ), |
||
| 137 | ), |
||
| 138 | 'attributes' => array(), |
||
| 139 | ) |
||
| 140 | ), |
||
| 141 | ), |
||
| 142 | ) |
||
| 143 | ), |
||
| 144 | new Parts\Zone( |
||
| 145 | array( |
||
| 146 | 'id' => '656b2182b4be70f18ca7b44b3fbb6dbe', |
||
| 147 | 'identifier' => 'right', |
||
| 148 | 'blocks' => array( |
||
| 149 | new Parts\Block( |
||
| 150 | array( |
||
| 151 | 'id' => '4d2f5e57d2a2528b276cd9e776a62e42', |
||
| 152 | 'name' => 'Featured Video', |
||
| 153 | 'type' => 'Video', |
||
| 154 | 'view' => 'default', |
||
| 155 | 'overflowId' => '', |
||
| 156 | 'zoneId' => '656b2182b4be70f18ca7b44b3fbb6dbe', |
||
| 157 | 'attributes' => array(), |
||
| 158 | ) |
||
| 159 | ), |
||
| 160 | new Parts\Block( |
||
| 161 | array( |
||
| 162 | 'id' => 'f36743396b8c36f10b467aa52f133e58', |
||
| 163 | 'name' => 'Travel Information', |
||
| 164 | 'type' => 'ContentGrid', |
||
| 165 | 'view' => 'default', |
||
| 166 | 'overflowId' => '', |
||
| 167 | 'zoneId' => '656b2182b4be70f18ca7b44b3fbb6dbe', |
||
| 168 | 'attributes' => array(), |
||
| 169 | ) |
||
| 170 | ), |
||
| 171 | ), |
||
| 172 | ) |
||
| 173 | ), |
||
| 174 | ), |
||
| 175 | 'attributes' => array(), |
||
| 176 | ) |
||
| 177 | ); |
||
| 178 | } |
||
| 179 | |||
| 240 |