| Conditions | 2 |
| Paths | 2 |
| Total Lines | 29 |
| Code Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 18 |
| CRAP Score | 2.0005 |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | 1 | public function init() |
|
| 20 | { |
||
| 21 | 1 | PicturefillAsset::register($this->getView()); |
|
| 22 | 1 | SlickAsset::register($this->getView()); |
|
| 23 | 1 | ResourcesAsset::register($this->getView()); |
|
| 24 | |||
| 25 | 1 | if (Module::slickConfig() != false) { |
|
|
|
|||
| 26 | $this->slickConfig = Module::slickConfig(); |
||
| 27 | } else { |
||
| 28 | 1 | $this->slickConfig = $this->slickConfigWidget; |
|
| 29 | } |
||
| 30 | |||
| 31 | 1 | $this->view->registerJs( |
|
| 32 | "var slickSlider = $('.slick-slider').slick({" |
||
| 33 | 1 | .implode(', ', |
|
| 34 | 1 | array_map( |
|
| 35 | 1 | function ($config, $option) { |
|
| 36 | 1 | return sprintf('%s:%s', $option, $config); |
|
| 37 | 1 | }, |
|
| 38 | 1 | $this->slickConfig, array_keys($this->slickConfig) |
|
| 39 | ) |
||
| 40 | ). |
||
| 41 | 1 | '});', |
|
| 42 | 1 | \luya\web\View::POS_READY, |
|
| 43 | 1 | 'slickSlider' |
|
| 44 | ); |
||
| 45 | |||
| 46 | 1 | parent::init(); |
|
| 47 | 1 | } |
|
| 48 | |||
| 54 |
When comparing two booleans, it is generally considered safer to use the strict comparison operator.