From 12bcd68869a27ad046261635298cf886acc06e5b Mon Sep 17 00:00:00 2001 From: "Angel Koilov (po_taka)" Date: Sun, 1 Jan 2017 17:01:56 +0200 Subject: [PATCH] Insight fixes02012017 (#39) insight fixes --- composer.json | 2 +- .../SiteBundle/DependencyInjection/Configuration.php | 2 +- .../SiteBundle/Form/Type/Forum/Topic/TopicEditType.php | 1 - .../Model/Gateway/Tekstove/Forum/PostGateway.php | 10 +++++----- .../Model/Gateway/Tekstove/Forum/TopicGateway.php | 1 - src/Tekstove/SiteBundle/Resources/config/routing.yml | 6 ++++++ 6 files changed, 13 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index c5ca0c2..4591710 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "description": "Tekstove.info website", "autoload": { "psr-4": { - "": "src/" + "Tekstove\\SiteBundle\\": "src/Tekstove/SiteBundle/" }, "classmap": [ "app/AppKernel.php", diff --git a/src/Tekstove/SiteBundle/DependencyInjection/Configuration.php b/src/Tekstove/SiteBundle/DependencyInjection/Configuration.php index 04abb93..8c15650 100644 --- a/src/Tekstove/SiteBundle/DependencyInjection/Configuration.php +++ b/src/Tekstove/SiteBundle/DependencyInjection/Configuration.php @@ -18,7 +18,7 @@ class Configuration implements ConfigurationInterface public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder(); - $rootNode = $treeBuilder->root('site'); + $treeBuilder->root('site'); // Here you should define the parameters that are allowed to // configure your bundle. See the documentation linked above for diff --git a/src/Tekstove/SiteBundle/Form/Type/Forum/Topic/TopicEditType.php b/src/Tekstove/SiteBundle/Form/Type/Forum/Topic/TopicEditType.php index 82b6391..ac8bfae 100644 --- a/src/Tekstove/SiteBundle/Form/Type/Forum/Topic/TopicEditType.php +++ b/src/Tekstove/SiteBundle/Form/Type/Forum/Topic/TopicEditType.php @@ -5,7 +5,6 @@ use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\Form\FormBuilderInterface; -use Symfony\Component\Form\Extension\Core\Type\TextareaType; use Symfony\Component\Form\Extension\Core\Type\TextType; /** diff --git a/src/Tekstove/SiteBundle/Model/Gateway/Tekstove/Forum/PostGateway.php b/src/Tekstove/SiteBundle/Model/Gateway/Tekstove/Forum/PostGateway.php index b802e06..dc36f74 100644 --- a/src/Tekstove/SiteBundle/Model/Gateway/Tekstove/Forum/PostGateway.php +++ b/src/Tekstove/SiteBundle/Model/Gateway/Tekstove/Forum/PostGateway.php @@ -54,11 +54,11 @@ public function save(Post $post) ]; try { - $response = $this->getClient() - ->post( - $this->getRelativeUrl(), - ['body' => json_encode($changeSet)] - ); + $this->getClient() + ->post( + $this->getRelativeUrl(), + ['body' => json_encode($changeSet)] + ); } catch (RequestException $e) { if ($e->getCode() != 400) { throw $e; diff --git a/src/Tekstove/SiteBundle/Model/Gateway/Tekstove/Forum/TopicGateway.php b/src/Tekstove/SiteBundle/Model/Gateway/Tekstove/Forum/TopicGateway.php index 0b48da7..29af763 100644 --- a/src/Tekstove/SiteBundle/Model/Gateway/Tekstove/Forum/TopicGateway.php +++ b/src/Tekstove/SiteBundle/Model/Gateway/Tekstove/Forum/TopicGateway.php @@ -4,7 +4,6 @@ use Tekstove\SiteBundle\Model\Gateway\Tekstove\AbstractGateway; use Tekstove\SiteBundle\Model\Forum\Topic; -use Tekstove\SiteBundle\Model\Forum\Post; use Tekstove\SiteBundle\Model\Gateway\Tekstove\Client\Exception\RequestException; use Tekstove\SiteBundle\Model\Gateway\Tekstove\Client\Exception\TekstoveValidationException; diff --git a/src/Tekstove/SiteBundle/Resources/config/routing.yml b/src/Tekstove/SiteBundle/Resources/config/routing.yml index 9c0166d..321ed2e 100644 --- a/src/Tekstove/SiteBundle/Resources/config/routing.yml +++ b/src/Tekstove/SiteBundle/Resources/config/routing.yml @@ -16,12 +16,15 @@ contacts: login: path: /login defaults: { _controller: SiteBundle:User:login } + methods: [GET, POST] loginCheck: path: /loginCheck + methods: [GET, POST] logout: path: /logout + methods: [GET, POST] register: path: /user/register @@ -41,10 +44,12 @@ tekstove.site.user.edit: userPmList: path: /user/pm/list defaults: { _controller: SiteBundle:User\Pm:list } + methods: [GET] tekstove_site.user.pm.send: path: /user/message/{toUserId}/{title} defaults: { _controller: SiteBundle:User\Pm:add, title: '' } + methods: [GET, POST] tekstove.site.user.pm.view: path: /user/pm/view/{id} @@ -140,6 +145,7 @@ tekstove.site.forum.post.newest: chat: path: /chat defaults: { _controller: SiteBundle:Chat:index } + methods: [GET] tekstove.feed.forum.topic: path: /feed/forum/topic.xml