From ee187ee044340b5298433a84f09bd1a58c5247a6 Mon Sep 17 00:00:00 2001 From: "Gergely POLONKAI (W00d5t0ck)" Date: Sat, 1 Sep 2012 14:57:41 +0200 Subject: [PATCH] Ran code through php-cs-fixer Signed-off-by: Gergely POLONKAI (W00d5t0ck) --- .../FrontBundle/Controller/BlogController.php | 1 - .../FrontBundle/Controller/BookController.php | 1 - .../Controller/ForumController.php | 2 +- .../FrontBundle/Controller/NewsController.php | 2 +- src/KekRozsak/FrontBundle/Entity/BlogPost.php | 20 ++++++++++++++----- src/KekRozsak/FrontBundle/Entity/Book.php | 1 + .../FrontBundle/Entity/ForumTopic.php | 2 ++ src/KekRozsak/FrontBundle/Entity/News.php | 3 ++- .../FrontBundle/Entity/SongVersion.php | 2 +- .../FrontBundle/Entity/UploadNamespace.php | 6 ++++-- .../FrontBundle/Entity/UploadedFile.php | 11 +++++++--- src/KekRozsak/FrontBundle/Entity/UserData.php | 3 +++ .../Resources/views/Book/listHelp.html.twig | 2 +- .../Resources/views/Book/new.html.twig | 2 +- .../FrontBundle/Twig/HelpUrlExtension.php | 6 ++++-- src/KekRozsak/SecurityBundle/Entity/User.php | 2 ++ 16 files changed, 46 insertions(+), 20 deletions(-) diff --git a/src/KekRozsak/FrontBundle/Controller/BlogController.php b/src/KekRozsak/FrontBundle/Controller/BlogController.php index 6cd4202..85719ae 100644 --- a/src/KekRozsak/FrontBundle/Controller/BlogController.php +++ b/src/KekRozsak/FrontBundle/Controller/BlogController.php @@ -54,4 +54,3 @@ class BlogController extends Controller ); } } - diff --git a/src/KekRozsak/FrontBundle/Controller/BookController.php b/src/KekRozsak/FrontBundle/Controller/BookController.php index 3b0d051..795aa3e 100644 --- a/src/KekRozsak/FrontBundle/Controller/BookController.php +++ b/src/KekRozsak/FrontBundle/Controller/BookController.php @@ -127,7 +127,6 @@ class BookController extends Controller */ public function ajaxSetBookCopyBorrowableAction(Book $book, $newValue) { - error_log($newValue); $user = $this->get('security.context')->getToken()->getUser(); $copies = $book->getUsersCopies($user); $em = $this->getDoctrine()->getEntityManager(); diff --git a/src/KekRozsak/FrontBundle/Controller/ForumController.php b/src/KekRozsak/FrontBundle/Controller/ForumController.php index 12ae011..5ce248f 100644 --- a/src/KekRozsak/FrontBundle/Controller/ForumController.php +++ b/src/KekRozsak/FrontBundle/Controller/ForumController.php @@ -190,7 +190,7 @@ class ForumController extends Controller */ public function favouriteTopic($topicGroupSlug, $topicSlug) { - $topicGroupRepo = $this->getDoctrine()->getRepository('KekRozsakFrontBundle:ForumTopicGroup'); + $topicGroupRepo = $this->getDoctrine()->getRepository('KekRozsakFrontBundle:ForumTopicGroup'); if (null === $topicGroup = $topicGroupRepo->findOneBySlug($topicGroupSlug)) { throw $this->createNotFoundException('Ilyen témakör nem létezik!'); } diff --git a/src/KekRozsak/FrontBundle/Controller/NewsController.php b/src/KekRozsak/FrontBundle/Controller/NewsController.php index d9f4deb..0207d8b 100644 --- a/src/KekRozsak/FrontBundle/Controller/NewsController.php +++ b/src/KekRozsak/FrontBundle/Controller/NewsController.php @@ -26,7 +26,7 @@ class NewsController extends Controller $newsRepo = $this->getDoctrine()->getRepository('KekRozsakFrontBundle:News'); $searchCriteria = array( 'draft' => false, - ); + ); if ( !is_object($this->get('security.context')->getToken()) || !is_object($this->get('security.context')->getToken()->getUser()) diff --git a/src/KekRozsak/FrontBundle/Entity/BlogPost.php b/src/KekRozsak/FrontBundle/Entity/BlogPost.php index 9559069..485b5b2 100644 --- a/src/KekRozsak/FrontBundle/Entity/BlogPost.php +++ b/src/KekRozsak/FrontBundle/Entity/BlogPost.php @@ -44,13 +44,14 @@ class BlogPost /** * Set published * - * @param boolean $published + * @param boolean $published * @return BlogPost */ public function setPublished($published) { // TODO: Check if parameter is boolean! $this->published = $published; + return $this; } @@ -83,6 +84,7 @@ class BlogPost public function setGroup(Group $group) { $this->group = $group; + return $this; } @@ -108,13 +110,14 @@ class BlogPost /** * Set title * - * @param string $title + * @param string $title * @return BlogPost */ public function setTitle($title) { // TODO: Check if not null nor empty! $this->title = $title; + return $this; } @@ -140,13 +143,14 @@ class BlogPost /** * Set slug * - * @param string $slug + * @param string $slug * @return BlogPost */ public function setSlug($slug) { // TODO: Check if not null nor empty! $this->slug = $slug; + return $this; } @@ -180,6 +184,7 @@ class BlogPost { // TODO: Check if not null! $this->createdBy = $createdBy; + return $this; } @@ -212,6 +217,7 @@ class BlogPost { // TODO: Check if not null! $this->createdAt = $createdAt; + return $this; } @@ -244,6 +250,7 @@ class BlogPost public function setUpdatedBy(User $updatedBy) { $this->updatedBy = $updatedBy; + return $this; } @@ -276,6 +283,7 @@ class BlogPost public function setUpdatedAt(\DateTime $updatedAt) { $this->updatedAt = $updatedAt; + return $this; } @@ -291,7 +299,7 @@ class BlogPost /** * Set updateReason * - * @param string $updateReason + * @param string $updateReason * @return BlogPost */ public function setUpdateReason($updateReason) @@ -300,6 +308,7 @@ class BlogPost $updateReason = null; } $this->updateReason = $updateReason; + return $this; } @@ -325,13 +334,14 @@ class BlogPost /** * Set content * - * @param string $content + * @param string $content * @return BlogPost */ public function setContent($content) { // TODO: Check if not null nor empty! $this->content = $content; + return $this; } diff --git a/src/KekRozsak/FrontBundle/Entity/Book.php b/src/KekRozsak/FrontBundle/Entity/Book.php index f59c7c3..4ac6e44 100644 --- a/src/KekRozsak/FrontBundle/Entity/Book.php +++ b/src/KekRozsak/FrontBundle/Entity/Book.php @@ -283,6 +283,7 @@ class Book { // TODO: Check if parameter is boolean! $this->commentable = $commentable; + return $this; } diff --git a/src/KekRozsak/FrontBundle/Entity/ForumTopic.php b/src/KekRozsak/FrontBundle/Entity/ForumTopic.php index 3d84066..e92e937 100644 --- a/src/KekRozsak/FrontBundle/Entity/ForumTopic.php +++ b/src/KekRozsak/FrontBundle/Entity/ForumTopic.php @@ -186,6 +186,8 @@ class ForumTopic * @var string $title * * @ORM\Column(type="string", length=100, nullable=false) + * + * @Assert\NotBlank() */ protected $title; diff --git a/src/KekRozsak/FrontBundle/Entity/News.php b/src/KekRozsak/FrontBundle/Entity/News.php index bbf2366..5bd1025 100644 --- a/src/KekRozsak/FrontBundle/Entity/News.php +++ b/src/KekRozsak/FrontBundle/Entity/News.php @@ -222,6 +222,7 @@ class News public function setSticky($sticky) { $this->sticky = $sticky; + return $this; } @@ -255,6 +256,7 @@ class News { // TODO: Check if parameter is boolean! $this->draft = $draft; + return $this; } @@ -268,4 +270,3 @@ class News return $this->draft; } } - diff --git a/src/KekRozsak/FrontBundle/Entity/SongVersion.php b/src/KekRozsak/FrontBundle/Entity/SongVersion.php index c7ed559..cf97a5c 100644 --- a/src/KekRozsak/FrontBundle/Entity/SongVersion.php +++ b/src/KekRozsak/FrontBundle/Entity/SongVersion.php @@ -7,4 +7,4 @@ * updatedAt * updateReason * content - */ \ No newline at end of file + */ diff --git a/src/KekRozsak/FrontBundle/Entity/UploadNamespace.php b/src/KekRozsak/FrontBundle/Entity/UploadNamespace.php index ef90797..b617493 100644 --- a/src/KekRozsak/FrontBundle/Entity/UploadNamespace.php +++ b/src/KekRozsak/FrontBundle/Entity/UploadNamespace.php @@ -50,13 +50,14 @@ class UploadNamespace /** * Set name * - * @param string $name + * @param string $name * @return UploadNamespace */ public function setName($name) { // TODO: Check if not null! $this->name = $name; + return $this; } @@ -82,13 +83,14 @@ class UploadNamespace /** * Set slug * - * @param string $slug + * @param string $slug * @return UploadNamespace */ public function setSlug($slug) { // TODO: Check if not null! $this->slug = $slug; + return $this; } diff --git a/src/KekRozsak/FrontBundle/Entity/UploadedFile.php b/src/KekRozsak/FrontBundle/Entity/UploadedFile.php index 691a197..0a48b62 100644 --- a/src/KekRozsak/FrontBundle/Entity/UploadedFile.php +++ b/src/KekRozsak/FrontBundle/Entity/UploadedFile.php @@ -57,6 +57,7 @@ class UploadedFile { // TODO: Check if not null! $this->namespace = $namespace; + return $this; } @@ -76,19 +77,21 @@ class UploadedFile * @var string $filename * * @ORM\Column(type="string", length=100, nullable=false) + * @Assert\NotBlank() */ protected $filename; /** * Set filename * - * @param string $filename + * @param string $filename * @return UploadedFile */ public function setFilename($filename) { // TODO: Check if not null nor empty! $this->filename = $filename; + return $this; } @@ -124,13 +127,14 @@ class UploadedFile /** * Set mimeType * - * @param string $mimeType + * @param string $mimeType * @return UploadedFile */ public function setMimeType($mimeType) { // TODO: Check if not null nor empty! $this->mimeType = $mimeType; + return $this; } @@ -156,7 +160,7 @@ class UploadedFile /** * Set description * - * @param string $description + * @param string $description * @return UploadedFile */ public function setDescription($description) @@ -166,6 +170,7 @@ class UploadedFile } $this->description = $description; + return $this; } diff --git a/src/KekRozsak/FrontBundle/Entity/UserData.php b/src/KekRozsak/FrontBundle/Entity/UserData.php index 728d4b7..e2484ae 100644 --- a/src/KekRozsak/FrontBundle/Entity/UserData.php +++ b/src/KekRozsak/FrontBundle/Entity/UserData.php @@ -480,6 +480,7 @@ class UserData { // TODO: Check if not null $this->favouriteTopics->add($topic); + return $this; } @@ -493,6 +494,7 @@ class UserData { // TODO: Check if not null $this->favouriteTopics->removeElement($topic); + return $this; } @@ -536,6 +538,7 @@ class UserData public function setAvatarImage(UploadedFile $avatarImage) { $this->avatarImage = $avatarImage; + return $this; } diff --git a/src/KekRozsak/FrontBundle/Resources/views/Book/listHelp.html.twig b/src/KekRozsak/FrontBundle/Resources/views/Book/listHelp.html.twig index a75644f..4981311 100644 --- a/src/KekRozsak/FrontBundle/Resources/views/Book/listHelp.html.twig +++ b/src/KekRozsak/FrontBundle/Resources/views/Book/listHelp.html.twig @@ -2,4 +2,4 @@ A könyvek részletes adatait a szerzőre, címre vagy a kiadás évére kattintva tudhatod meg. Az ekkor felbukkanó ablakban tudod bejelölni, ha neked is van egy példányod, vagy ha pl. szeretnél kölcsönkérni egyet. -

\ No newline at end of file +

diff --git a/src/KekRozsak/FrontBundle/Resources/views/Book/new.html.twig b/src/KekRozsak/FrontBundle/Resources/views/Book/new.html.twig index 4ae3168..d083935 100644 --- a/src/KekRozsak/FrontBundle/Resources/views/Book/new.html.twig +++ b/src/KekRozsak/FrontBundle/Resources/views/Book/new.html.twig @@ -6,4 +6,4 @@ - \ No newline at end of file + diff --git a/src/KekRozsak/FrontBundle/Twig/HelpUrlExtension.php b/src/KekRozsak/FrontBundle/Twig/HelpUrlExtension.php index 26c8de7..912ffa8 100644 --- a/src/KekRozsak/FrontBundle/Twig/HelpUrlExtension.php +++ b/src/KekRozsak/FrontBundle/Twig/HelpUrlExtension.php @@ -27,11 +27,13 @@ class HelpUrlExtension extends \Twig_Extension * "container" = @DI\Inject("service_container") * }) */ - public function __construct(ContainerInterface $container) { + public function __construct(ContainerInterface $container) + { $this->container = $container; } - public function getGlobals() { + public function getGlobals() + { parent::getGlobals(); $request = $this->container->get('request'); diff --git a/src/KekRozsak/SecurityBundle/Entity/User.php b/src/KekRozsak/SecurityBundle/Entity/User.php index 7b649cd..99eefa7 100644 --- a/src/KekRozsak/SecurityBundle/Entity/User.php +++ b/src/KekRozsak/SecurityBundle/Entity/User.php @@ -365,8 +365,10 @@ class User implements UserInterface, AdvancedUserInterface return true; } $groups->add($group); + return true; }); + return $groups; }