| Conditions | 4 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | public function compose(View $view) |
||
| 29 | { |
||
| 30 | // Here template names is hardcoded, but here is easy to edit them, then go to templates and change variables there |
||
| 31 | |||
| 32 | switch ($view->getName()){ |
||
| 33 | case "partials.banners.small": |
||
| 34 | return $view->with('banners', $this->banners->getSmallAdBlocks(2)); |
||
| 35 | break; |
||
|
|
|||
| 36 | |||
| 37 | case "partials.banners.r_sidebar": |
||
| 38 | return $view->with('banners', $this->banners->getRightSideBarAdBlocks(1)); |
||
| 39 | break; |
||
| 40 | |||
| 41 | case "partials.banners.big": |
||
| 42 | return $view->with('banners', $this->banners->getBigAdBlocks(2)); |
||
| 43 | break; |
||
| 44 | } |
||
| 45 | } |
||
| 46 | } |
The break statement is not necessary if it is preceded for example by a return statement:
If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.