Skip to content
This repository has been archived by the owner on Sep 10, 2019. It is now read-only.

Commit

Permalink
Merge pull request #8 from Aheenam/analysis-zYxAG0
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI after Laravel preset was added
  • Loading branch information
rathesDot authored Jan 4, 2018
2 parents e1043dd + 8ecf12c commit 82d9413
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Controllers/FrontendController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace Aheenam\Mozhi\Controllers;

use Aheenam\Mozhi\RouteResolver;
use Aheenam\Mozhi\TemplateRenderer;
use Illuminate\Routing\Controller;
use Aheenam\Mozhi\TemplateRenderer;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;

class FrontendController extends Controller
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function meta($key = null)
if ($key === null) {
return $this->meta;
}
if (!isset($this->meta[$key])) {
if (! isset($this->meta[$key])) {
return;
}

Expand Down
4 changes: 2 additions & 2 deletions src/RouteResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Aheenam\Mozhi;

use Aheenam\Mozhi\Models\Page;
use Storage;
use Aheenam\Mozhi\Models\Page;

class RouteResolver
{
Expand All @@ -17,7 +17,7 @@ public function getPageByRoute($route = null)
$contentStorage = Storage::disk(config('mozhi.content_disk'));
$filePath = 'contents/'.$route.'.md';

if ($route === null || !$contentStorage->exists($filePath)) {
if ($route === null || ! $contentStorage->exists($filePath)) {
return;
}

Expand Down
5 changes: 3 additions & 2 deletions src/TemplateRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Aheenam\Mozhi;

use Aheenam\Mozhi\Exceptions\TemplateNotFoundException;
use Aheenam\Mozhi\Models\Page;
use Aheenam\Mozhi\Exceptions\TemplateNotFoundException;

class TemplateRenderer
{
Expand Down Expand Up @@ -46,9 +46,10 @@ public function render($data = [])
$currentTheme = self::getCurrentTheme();
$template = $this->getTemplate();

if (!view()->exists("theme::$currentTheme.$template")) {
if (! view()->exists("theme::$currentTheme.$template")) {
throw new TemplateNotFoundException("Template [$template] was not found in theme [$currentTheme]");
}

return view("theme::$currentTheme.$template", collect([
'meta' => $this->page->meta(),
'content' => $this->page->getParsedContent(),
Expand Down
2 changes: 1 addition & 1 deletion tests/TemplateRendererTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace Aheenam\Mozhi\Test;

use Aheenam\Mozhi\Exceptions\TemplateNotFoundException;
use Aheenam\Mozhi\RouteResolver;
use Aheenam\Mozhi\TemplateRenderer;
use Spatie\Snapshots\MatchesSnapshots;
use Aheenam\Mozhi\Exceptions\TemplateNotFoundException;

class TemplateRendererTest extends TestCase
{
Expand Down

0 comments on commit 82d9413

Please sign in to comment.