| Conditions | 2 |
| Paths | 2 |
| Total Lines | 52 |
| Code Lines | 14 |
| 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 |
||
| 30 | * @return \Aimeos\Base\View\Iface Modified view object |
||
| 31 | */ |
||
| 32 | public function data( \Aimeos\Base\View\Iface $view, array &$tags = [], string &$expire = null ) : \Aimeos\Base\View\Iface |
||
| 33 | { |
||
| 34 | $view->seenItems = array_reverse( $this->context()->session()->get( 'aimeos/catalog/session/seen/list', [] ) ); |
||
| 35 | |||
| 36 | return parent::data( $view, $tags, $expire ); |
||
| 37 | } |
||
| 38 | |||
| 39 | |||
| 40 | /** client/html/catalog/session/seen/template-body |
||
| 41 | * Relative path to the HTML body template of the catalog session seen client. |
||
| 42 | * |
||
| 43 | * The template file contains the HTML code and processing instructions |
||
| 44 | * to generate the result shown in the body of the frontend. The |
||
| 45 | * configuration string is the path to the template file relative |
||
| 46 | * to the templates directory (usually in client/html/templates). |
||
| 47 | * |
||
| 48 | * You can overwrite the template file configuration in extensions and |
||
| 49 | * provide alternative templates. These alternative templates should be |
||
| 50 | * named like the default one but suffixed by |
||
| 51 | * an unique name. You may use the name of your project for this. If |
||
| 52 | * you've implemented an alternative client class as well, it |
||
| 53 | * should be suffixed by the name of the new class. |
||
| 54 | * |
||
| 55 | * @param string Relative path to the template creating code for the HTML page body |
||
| 56 | * @since 2014.03 |
||
| 57 | * @see client/html/catalog/session/seen/template-header |
||
| 58 | */ |
||
| 59 | } |
||
| 60 |