for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace dev7ch\slick;
use dev7ch\slick\assets\PicturefillAsset;
use dev7ch\slick\assets\ResourcesAsset;
use dev7ch\slick\assets\SlickAsset;
\Yii::setAlias('@slick', '@bower/slick-carousel');
\Yii::setAlias('@resources', dirname(__DIR__).'/src/resources');
class SlickWidget extends \luya\base\Widget
{
public $baseUrl;
public $images;
public $slickConfig = [];
public $slickConfigWidget;
public function init()
PicturefillAsset::register($this->getView());
SlickAsset::register($this->getView());
ResourcesAsset::register($this->getView());
if (Module::slickConfig() != false) {
!==
When comparing two booleans, it is generally considered safer to use the strict comparison operator.
$this->slickConfig = Module::slickConfig();
\dev7ch\slick\Module::slickConfig()
boolean
array
$slickConfig
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..
} else {
$this->slickConfig = $this->slickConfigWidget;
}
$this->view->registerJs(
"var slickSlider = $('.slick-slider').slick({"
.implode(', ',
array_map(
function ($config, $option) {
return sprintf('%s:%s', $option, $config);
},
$this->slickConfig, array_keys($this->slickConfig)
)
).
'});',
\luya\web\View::POS_READY,
'slickSlider'
);
parent::init();
public function run()
return $this->render('SlickSlider', ['widget' => $this]);
When comparing two booleans, it is generally considered safer to use the strict comparison operator.