Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reopeninig: Use the correct Symfony Controller class based on Symfony version #681

Merged
merged 12 commits into from
Apr 10, 2019
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
language: php

env:
global:
- SYMFONY_DEPRECATIONS_HELPER=weak

php:
- 5.6
- 7.1
Expand All @@ -13,7 +17,7 @@ cache:
matrix:
include:
- php: 5.6
env: COMPOSER_FLAGS="--prefer-lowest" SYMFONY_DEPRECATIONS_HELPER=weak
env: COMPOSER_FLAGS="--prefer-lowest"
- php: 5.6
env: DEPENDENCIES="symfony/lts:^2"
- php: 7.1
Expand Down
2 changes: 1 addition & 1 deletion Acl/CommentAclInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function canView(CommentInterface $comment);
* Checks if the user can reply to the supplied 'parent' comment
* or if not supplied, just the ability to reply.
*
* @param CommentInterface $comment
* @param CommentInterface $parent
*
* @return bool
*/
Expand Down
2 changes: 1 addition & 1 deletion Acl/VoteAclInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function canDelete(VoteInterface $vote);
* Note: this does not remove any existing Acl and should only
* be called on new CommentInterface instances.
*
* @param VoteInterface $comment
* @param VoteInterface $vote
*
* @return void
*/
Expand Down
22 changes: 22 additions & 0 deletions Controller/AbstractController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

/*
* This file is part of the FOSCommentBundle package.
*
* (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

namespace FOS\CommentBundle\Controller;

if (class_exists('Symfony\Bundle\FrameworkBundle\Controller\AbstractController')) {
abstract class AbstractController extends \Symfony\Bundle\FrameworkBundle\Controller\AbstractController
{
}
} else {
abstract class AbstractController extends \Symfony\Bundle\FrameworkBundle\Controller\Controller
{
}
}
3 changes: 1 addition & 2 deletions Controller/ThreadController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use FOS\CommentBundle\Model\CommentInterface;
use FOS\CommentBundle\Model\ThreadInterface;
use FOS\RestBundle\View\View;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
Expand All @@ -26,7 +25,7 @@
*
* @author Alexander <iam.asm89@gmail.com>
*/
class ThreadController extends Controller
class ThreadController extends AbstractController
{
const VIEW_FLAT = 'flat';
const VIEW_TREE = 'tree';
Expand Down