Skip to content

Commit

Permalink
php cs fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
nadar committed Jun 22, 2018
1 parent 3a5ce4f commit 3e6374f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
9 changes: 4 additions & 5 deletions src/controllers/SitemapController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class SitemapController extends Controller
{
/**
* Return the sitemap xml content.
*
*
* @return \yii\web\Response
*/
public function actionIndex()
Expand Down Expand Up @@ -66,11 +66,11 @@ private function buildSitemapfile($sitemapFile)
$query->andWhere(['is_hidden' => false]);
}

foreach($query->each() as $nav) {
foreach ($query->each() as $nav) {
/** @var Nav $nav */

$urls = [];
foreach($nav->navItems as $navItem) {
foreach ($nav->navItems as $navItem) {
/** @var NavItem $navItem */
$urls[$navItem->lang->short_code] = Yii::$app->request->hostInfo
. Yii::$app->menu->buildItemLink($navItem->alias, $navItem->lang->short_code);
Expand All @@ -80,10 +80,9 @@ private function buildSitemapfile($sitemapFile)
var_dump($urls);
$sitemap->addItem($urls, $lastModified);
}

}

// write sitemap files
$sitemap->write();
}
}
}
6 changes: 3 additions & 3 deletions tests/SitemapControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function testIgnoreHiddenModuleProperty()
$response = $ctrl->actionIndex();
$stream = $response->stream;

// @TODO: Does not deliver the xml stream content ...
// @TODO: Does not deliver the xml stream content ...
$content = stream_get_contents($stream[0]);

// @TODO: change content
Expand Down Expand Up @@ -108,7 +108,7 @@ private function prepareBasicTableStructureAndData()
]));

$langFixture = (new ActiveRecordFixture([
'modelClass' => Lang::class,
'modelClass' => Lang::class,
'fixtureData' => [
'model1' => [
'id' => 1,
Expand All @@ -120,4 +120,4 @@ private function prepareBasicTableStructureAndData()
]
]));
}
}
}

0 comments on commit 3e6374f

Please sign in to comment.