@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | defined('YII_DEBUG') or define('YII_DEBUG', true); |
| 3 | 3 | defined('YII_ENV') or define('YII_ENV', 'test'); |
| 4 | -require(__DIR__ . '/../vendor/autoload.php'); |
|
| 5 | -require(__DIR__ . '/../vendor/yiisoft/yii2/Yii.php'); |
|
| 4 | +require(__DIR__.'/../vendor/autoload.php'); |
|
| 5 | +require(__DIR__.'/../vendor/yiisoft/yii2/Yii.php'); |
|
| 6 | 6 | |
| 7 | 7 | Yii::setAlias('@tests', __DIR__); |
| 8 | 8 | |
@@ -19,11 +19,11 @@ |
||
| 19 | 19 | return [ |
| 20 | 20 | 'ymlCategory' => [ |
| 21 | 21 | 'class' => YmlCategoryBehavior::className(), |
| 22 | - 'scope' => function ($model) { |
|
| 22 | + 'scope' => function($model) { |
|
| 23 | 23 | /** @var \yii\db\ActiveQuery $model */ |
| 24 | 24 | $model->select(['id', 'name', 'parentId']); |
| 25 | 25 | }, |
| 26 | - 'dataClosure' => function ($model) { |
|
| 26 | + 'dataClosure' => function($model) { |
|
| 27 | 27 | /** @var self $model */ |
| 28 | 28 | return [ |
| 29 | 29 | 'id' => $model->id, |
@@ -7,9 +7,7 @@ |
||
| 7 | 7 | |
| 8 | 8 | namespace corpsepk\yml\models; |
| 9 | 9 | |
| 10 | -use Yii; |
|
| 11 | 10 | use yii\base\Model; |
| 12 | -use yii\helpers\Html; |
|
| 13 | 11 | |
| 14 | 12 | /** |
| 15 | 13 | * @link https://partner.market.yandex.ru/legal/tt/ |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | public function logErrors(Shop $shop) |
| 130 | 130 | { |
| 131 | 131 | foreach ($shop->getFirstErrors() as $attribute => $error) { |
| 132 | - Yii::error(Shop::class . "\n$error", __METHOD__); |
|
| 132 | + Yii::error(Shop::class."\n$error", __METHOD__); |
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | foreach ($shop->offers as $offer) { |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | * @var Offer $offer |
| 138 | 138 | */ |
| 139 | 139 | foreach ($offer->getFirstErrors() as $attribute => $error) { |
| 140 | - Yii::error(Offer::class . " id: {$offer->id}\n$error", __METHOD__); |
|
| 140 | + Yii::error(Offer::class." id: {$offer->id}\n$error", __METHOD__); |
|
| 141 | 141 | } |
| 142 | 142 | } |
| 143 | 143 | } |
@@ -10,13 +10,13 @@ discard block |
||
| 10 | 10 | $this->params['breadcrumbs'][] = 'YandexMarketYml errors'; |
| 11 | 11 | ?> |
| 12 | 12 | |
| 13 | - <h1><?= Html::tag('code', Shop::class) ?> errors:</h1> |
|
| 13 | + <h1><?= Html::tag('code', Shop::class) ?> errors:</h1> |
|
| 14 | 14 | |
| 15 | 15 | <?= Html::errorSummary($shop) ?> |
| 16 | 16 | |
| 17 | 17 | <hr> |
| 18 | 18 | |
| 19 | - <h1><?= Html::tag('code', Offer::class) ?> erorrs:</h1> |
|
| 19 | + <h1><?= Html::tag('code', Offer::class) ?> erorrs:</h1> |
|
| 20 | 20 | |
| 21 | 21 | <?php |
| 22 | 22 | foreach ($shop->offers as $offer) { |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | <summary>Offer id: <?= $offer->id ?></summary> |
| 32 | 32 | <?= DetailView::widget([ |
| 33 | 33 | 'model' => $offer, |
| 34 | - 'attributes' => array_map(function ($attribute) use ($offer) { |
|
| 34 | + 'attributes' => array_map(function($attribute) use ($offer) { |
|
| 35 | 35 | return [ |
| 36 | 36 | 'attribute' => $attribute, |
| 37 | 37 | 'format' => 'raw', |