From 563e33c772d39aa81f94f87f1ad531cbd9ffba10 Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Thu, 20 Jul 2017 09:57:02 +1200 Subject: [PATCH] Add phpcs ruleset and fix violations --- phpcs.xml.dist | 22 +++++++++++++++++++ .../GridField/GridFieldBlogPostState.php | 1 - src/Model/BlogController.php | 4 ++-- src/Widgets/BlogCategoriesWidget.php | 2 -- tests/BlogTagTest.php | 1 - 5 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 phpcs.xml.dist diff --git a/phpcs.xml.dist b/phpcs.xml.dist new file mode 100644 index 0000000..c4c9ca1 --- /dev/null +++ b/phpcs.xml.dist @@ -0,0 +1,22 @@ + + + CodeSniffer ruleset for SilverStripe coding conventions. + + + + + + + + + + + + + + + + + + + diff --git a/src/Forms/GridField/GridFieldBlogPostState.php b/src/Forms/GridField/GridFieldBlogPostState.php index 609f014..c33c5e0 100644 --- a/src/Forms/GridField/GridFieldBlogPostState.php +++ b/src/Forms/GridField/GridFieldBlogPostState.php @@ -6,7 +6,6 @@ use SilverStripe\Blog\Model\BlogPost; use SilverStripe\Lumberjack\Forms\GridFieldSiteTreeState; use SilverStripe\View\Requirements; - /** * Provides a component to the {@link GridField} which tells the user whether or not a blog post * has been published and when. diff --git a/src/Model/BlogController.php b/src/Model/BlogController.php index e9688ab..8ead4c5 100644 --- a/src/Model/BlogController.php +++ b/src/Model/BlogController.php @@ -221,7 +221,7 @@ class BlogController extends PageController if ($tag) { $this->blogPosts = $tag->BlogPosts(); - if($this->isRSS()) { + if ($this->isRSS()) { return $this->rssFeed($this->blogPosts, $tag->getLink()); } else { return $this->render(); @@ -265,7 +265,7 @@ class BlogController extends PageController if ($category) { $this->blogPosts = $category->BlogPosts(); - if($this->isRSS()) { + if ($this->isRSS()) { return $this->rssFeed($this->blogPosts, $category->getLink()); } else { return $this->render(); diff --git a/src/Widgets/BlogCategoriesWidget.php b/src/Widgets/BlogCategoriesWidget.php index f72d077..63de4fc 100644 --- a/src/Widgets/BlogCategoriesWidget.php +++ b/src/Widgets/BlogCategoriesWidget.php @@ -123,5 +123,3 @@ class BlogCategoriesWidget extends Widget return $query; } } - - diff --git a/tests/BlogTagTest.php b/tests/BlogTagTest.php index 3040294..fd3f03c 100755 --- a/tests/BlogTagTest.php +++ b/tests/BlogTagTest.php @@ -215,5 +215,4 @@ class BlogTagTest extends FunctionalTest $tag->write(); $this->assertEquals($tag->URLSegment, "another-test"); } - }