| @@ -18,7 +18,7 @@ | ||
| 18 | 18 | <?= GridView::widget([ | 
| 19 | 19 | 'dataProvider' => $dataProvider, | 
| 20 | 20 | 'columns' => [ | 
| 21 | - ['class' => SerialColumn::class], | |
| 21 | + [ 'class' => SerialColumn::class ], | |
| 22 | 22 | 'contacts', | 
| 23 | 23 | 'created_at:datetime', | 
| 24 | 24 | ], | 
| @@ -32,7 +32,7 @@ | ||
| 32 | 32 | /** | 
| 33 | 33 | * @inheritdoc | 
| 34 | 34 | */ | 
| 35 | - public function __construct($id, $module, ServiceInterface $service, $config = []) | |
| 35 | + public function __construct($id, $module, ServiceInterface $service, $config = [ ]) | |
| 36 | 36 |      { | 
| 37 | 37 | $this->_service = $service; | 
| 38 | 38 | parent::__construct($id, $module, $config); | 
| @@ -21,11 +21,11 @@ | ||
| 21 | 21 | \yii\bootstrap\BootstrapAsset::register($this); | 
| 22 | 22 | ?> | 
| 23 | 23 | <?php $form = ActiveForm::begin([ | 
| 24 | - 'action' => ['/newsletter/default/subscribe'], | |
| 25 | - 'options' => ['class' => 'form-inline'], | |
| 24 | + 'action' => [ '/newsletter/default/subscribe' ], | |
| 25 | + 'options' => [ 'class' => 'form-inline' ], | |
| 26 | 26 | ]) ?> | 
| 27 | 27 | <?= $form->field($model, 'contacts') | 
| 28 | -    ->textInput(['placeholder' => $model->getAttributeLabel('contacts')]) | |
| 28 | +    ->textInput([ 'placeholder' => $model->getAttributeLabel('contacts') ]) | |
| 29 | 29 | ->label(false) ?> | 
| 30 | 30 |  <?= Html::submitButton(Yii::t('front/newsletter', 'Subscribe'), [ | 
| 31 | 31 | 'class' => 'btn btn-success', | 
| @@ -24,14 +24,14 @@ | ||
| 24 | 24 | */ | 
| 25 | 25 | public function behaviors() | 
| 26 | 26 |      { | 
| 27 | - return [ | |
| 28 | - 'verbs' => [ | |
| 29 | - 'class' => VerbFilter::class, | |
| 30 | - 'actions' => [ | |
| 31 | - 'subscribe' => ['post'], | |
| 32 | - ], | |
| 33 | - ], | |
| 34 | - ]; | |
| 27 | + return [ | |
| 28 | + 'verbs' => [ | |
| 29 | + 'class' => VerbFilter::class, | |
| 30 | + 'actions' => [ | |
| 31 | + 'subscribe' => ['post'], | |
| 32 | + ], | |
| 33 | + ], | |
| 34 | + ]; | |
| 35 | 35 | } | 
| 36 | 36 | |
| 37 | 37 | /** | 
| @@ -28,7 +28,7 @@ | ||
| 28 | 28 | 'verbs' => [ | 
| 29 | 29 | 'class' => VerbFilter::class, | 
| 30 | 30 | 'actions' => [ | 
| 31 | - 'subscribe' => ['post'], | |
| 31 | + 'subscribe' => [ 'post' ], | |
| 32 | 32 | ], | 
| 33 | 33 | ], | 
| 34 | 34 | ]; | 
| @@ -50,11 +50,11 @@ | ||
| 50 | 50 | public function rules() | 
| 51 | 51 |      { | 
| 52 | 52 | return [ | 
| 53 | - ['contacts', 'required'], | |
| 54 | - ['contacts', 'string', 'max' => 255], | |
| 55 | - ['contacts', 'email', 'on' => self::SCENARIO_CONTACTS_EMAIL], | |
| 53 | + [ 'contacts', 'required' ], | |
| 54 | + [ 'contacts', 'string', 'max' => 255 ], | |
| 55 | + [ 'contacts', 'email', 'on' => self::SCENARIO_CONTACTS_EMAIL ], | |
| 56 | 56 | |
| 57 | - [['created_at', 'updated_at'], 'safe'], | |
| 57 | + [ [ 'created_at', 'updated_at' ], 'safe' ], | |
| 58 | 58 | ]; | 
| 59 | 59 | } | 
| 60 | 60 | |
| @@ -45,7 +45,7 @@ | ||
| 45 | 45 | parent::init(); | 
| 46 | 46 | |
| 47 | 47 |          if ($this->_service === null) { | 
| 48 | - $this->_service = ['class' => DbService::class]; | |
| 48 | + $this->_service = [ 'class' => DbService::class ]; | |
| 49 | 49 | } | 
| 50 | 50 | |
| 51 | 51 | Yii::$container->set(ServiceInterface::class, $this->_service); | 
| @@ -71,7 +71,7 @@ | ||
| 71 | 71 | */ | 
| 72 | 72 | public function getDataProvider() | 
| 73 | 73 |      { | 
| 74 | - $query = NewsletterClient::find()->orderBy(['created_at' => SORT_ASC]); | |
| 74 | + $query = NewsletterClient::find()->orderBy([ 'created_at' => SORT_ASC ]); | |
| 75 | 75 | |
| 76 | 76 | return new ActiveDataProvider([ | 
| 77 | 77 | 'query' => $query, | 
| @@ -4,10 +4,10 @@ | ||
| 4 | 4 |  defined('YII_DEBUG') or define('YII_DEBUG', true); | 
| 5 | 5 |  defined('YII_ENABLE_ERROR_HANDLER') or define('YII_ENABLE_ERROR_HANDLER', false); | 
| 6 | 6 |  defined('YII_ENV') or define('YII_ENV', 'test'); | 
| 7 | -defined('VENDOR_DIR') or define('VENDOR_DIR', __DIR__ . implode(DIRECTORY_SEPARATOR, ['', '..', 'vendor'])); | |
| 7 | +defined('VENDOR_DIR') or define('VENDOR_DIR', __DIR__ . implode(DIRECTORY_SEPARATOR, [ '', '..', 'vendor' ])); | |
| 8 | 8 | |
| 9 | 9 | require_once(VENDOR_DIR . DIRECTORY_SEPARATOR . 'autoload.php'); | 
| 10 | -require_once(VENDOR_DIR . implode(DIRECTORY_SEPARATOR, ['', 'yiisoft', 'yii2', 'Yii.php'])); | |
| 10 | +require_once(VENDOR_DIR . implode(DIRECTORY_SEPARATOR, [ '', 'yiisoft', 'yii2', 'Yii.php' ])); | |
| 11 | 11 | |
| 12 | 12 |  Yii::setAlias('@tests', __DIR__); | 
| 13 | 13 |  Yii::setAlias('@vendor', VENDOR_DIR); | 
| @@ -64,7 +64,7 @@ | ||
| 64 | 64 | Event::on( | 
| 65 | 65 | DbService::class, | 
| 66 | 66 | SubscribeEvent::EVENT_AFTER_SUBSCRIBE, | 
| 67 | -            function (SubscribeEvent $event) use ($contacts) { | |
| 67 | +            function(SubscribeEvent $event) use ($contacts) { | |
| 68 | 68 | $this->assertEquals($contacts, $event->contacts); | 
| 69 | 69 | } | 
| 70 | 70 | ); |