Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c15f204
fix of deprecated functions
DenysMedvid Feb 26, 2016
6c0d24a
fix deprecated security.context
DenysMedvid Feb 26, 2016
5a5aaf0
Add Czech translation
dfridrich Apr 2, 2016
f502d35
Fix a typo
dfridrich Apr 2, 2016
e7e0ca5
Merge pull request #276 from dfridrich/patch-2
tgalopin Apr 2, 2016
e8f7956
Merge pull request #277 from dfridrich/patch-1
tgalopin Apr 2, 2016
fd2752f
Fixing deprecations
bassrock Apr 16, 2016
c78c9a7
Fix a typo
dfridrich Apr 18, 2016
f824ef8
Merge pull request #279 from dfridrich/patch-4
tgalopin Apr 18, 2016
cd4d911
Merge pull request #1 from Klinche/master
ownede May 6, 2016
e3a8d89
Merge pull request #2 from FriendsOfSymfony/symfony3
ownede May 6, 2016
ce904d7
Removed use of ContainerAware (removed in Symfony 3.0)
May 6, 2016
1837ca1
Update scoped services to use request_stack
ubermuda May 11, 2016
d0c3481
Update services to use token storage instead of security context
ubermuda May 11, 2016
f5843ea
Switch from ContainerAware to ContainerAwareInterface
ubermuda May 11, 2016
e367a88
Make container property protected in message controller
ubermuda May 11, 2016
b865d10
Update form factory configuration
ubermuda May 11, 2016
946e99e
Update form handler to use handleRequest instead of bind
ubermuda May 11, 2016
77bf522
Update forms to use new type declaration
ubermuda May 11, 2016
0608251
Update forms to use configureOptions
ubermuda May 11, 2016
aa9eaf5
Merge branch 'symfony3' of https://github.com/ubermuda/FOSMessageBund…
Jul 7, 2016
c334607
Merge branch 'symfony3' of https://github.com/ubermuda/FOSMessageBund…
Jul 7, 2016
90912fc
Merge branch 'ubermuda-symfony3' into symfony3
Jul 7, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Composer/Composer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace FOS\MessageBundle\Composer;

use FOS\MessageBundle\ModelManager\MessageManagerInterface;
use FOS\MessageBundle\Sender\SenderInterface;
use FOS\MessageBundle\Model\ThreadInterface;
use FOS\MessageBundle\ModelManager\ThreadManagerInterface;
use FOS\MessageBundle\MessageBuilder\NewThreadMessageBuilder;
use FOS\MessageBundle\MessageBuilder\ReplyMessageBuilder;
use FOS\MessageBundle\Model\ThreadInterface;
use FOS\MessageBundle\ModelManager\MessageManagerInterface;
use FOS\MessageBundle\ModelManager\ThreadManagerInterface;
use FOS\MessageBundle\Sender\SenderInterface;

/**
* Factory for message builders
Expand Down
31 changes: 23 additions & 8 deletions Controller/MessageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,27 @@
namespace FOS\MessageBundle\Controller;

use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\DependencyInjection\ContainerAware;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use FOS\MessageBundle\Provider\ProviderInterface;
use Symfony\Component\HttpFoundation\Response;

class MessageController extends ContainerAware
class MessageController implements ContainerAwareInterface
{
/**
* @var ContainerInterface
*/
protected $container;

/**
* {@inheritDoc}
*/
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}

/**
* Displays the authenticated participant inbox
*
Expand Down Expand Up @@ -55,7 +70,7 @@ public function deletedAction()
* Displays a thread, also allows to reply to it
*
* @param string $threadId the thread id
*
*
* @return Response
*/
public function threadAction($threadId)
Expand Down Expand Up @@ -100,9 +115,9 @@ public function newThreadAction()

/**
* Deletes a thread
*
*
* @param string $threadId the thread id
*
*
* @return RedirectResponse
*/
public function deleteAction($threadId)
Expand All @@ -113,12 +128,12 @@ public function deleteAction($threadId)

return new RedirectResponse($this->container->get('router')->generate('fos_message_inbox'));
}

/**
* Undeletes a thread
*
*
* @param string $threadId
*
*
* @return RedirectResponse
*/
public function undeleteAction($threadId)
Expand Down
6 changes: 3 additions & 3 deletions DataTransformer/RecipientsDataTransformer.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php
namespace FOS\MessageBundle\DataTransformer;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Persistence\ObjectManager;
use Symfony\Component\Form\DataTransformerInterface;
use Symfony\Component\Form\Exception\TransformationFailedException;
use Symfony\Component\Form\Exception\UnexpectedTypeException;
use Symfony\Component\Security\Core\User\UserInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\ArrayCollection;
/**
* Transforms collection of UserInterface into strings separated with coma
*
Expand Down
8 changes: 4 additions & 4 deletions Deleter/Deleter.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

namespace FOS\MessageBundle\Deleter;

use FOS\MessageBundle\Security\AuthorizerInterface;
use FOS\MessageBundle\Model\ThreadInterface;
use FOS\MessageBundle\Security\ParticipantProviderInterface;
use FOS\MessageBundle\Event\FOSMessageEvents;
use FOS\MessageBundle\Event\ThreadEvent;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use FOS\MessageBundle\Model\ThreadInterface;
use FOS\MessageBundle\Security\AuthorizerInterface;
use FOS\MessageBundle\Security\ParticipantProviderInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;

/**
* Marks threads as deleted
Expand Down
6 changes: 3 additions & 3 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace FOS\MessageBundle\DependencyInjection;

use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;

/**
Expand Down Expand Up @@ -51,7 +51,7 @@ public function getConfigTreeBuilder()
->addDefaultsIfNotSet()
->children()
->scalarNode('factory')->defaultValue('fos_message.new_thread_form.factory.default')->cannotBeEmpty()->end()
->scalarNode('type')->defaultValue('fos_message.new_thread_form.type.default')->cannotBeEmpty()->end()
->scalarNode('class')->defaultValue('FOS\MessageBundle\FormType\NewThreadMessageFormType')->cannotBeEmpty()->end()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is clearly a bc break, we need a bc layer to keep supporting the old option

->scalarNode('handler')->defaultValue('fos_message.new_thread_form.handler.default')->cannotBeEmpty()->end()
->scalarNode('name')->defaultValue('message')->cannotBeEmpty()->end()
->scalarNode('model')->defaultValue('FOS\MessageBundle\FormModel\NewThreadMessage')->end()
Expand All @@ -61,7 +61,7 @@ public function getConfigTreeBuilder()
->addDefaultsIfNotSet()
->children()
->scalarNode('factory')->defaultValue('fos_message.reply_form.factory.default')->cannotBeEmpty()->end()
->scalarNode('type')->defaultValue('fos_message.reply_form.type.default')->cannotBeEmpty()->end()
->scalarNode('class')->defaultValue('FOS\MessageBundle\FormType\ReplyMessageFormType')->cannotBeEmpty()->end()
->scalarNode('handler')->defaultValue('fos_message.reply_form.handler.default')->cannotBeEmpty()->end()
->scalarNode('name')->defaultValue('message')->cannotBeEmpty()->end()
->scalarNode('model')->defaultValue('FOS\MessageBundle\FormModel\ReplyMessage')->end()
Expand Down
10 changes: 5 additions & 5 deletions DependencyInjection/FOSMessageExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
namespace FOS\MessageBundle\DependencyInjection;

use Symfony\Component\Config\Definition\Processor;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;

class FOSMessageExtension extends Extension
{
Expand All @@ -32,8 +32,10 @@ public function load(array $configs, ContainerBuilder $container)
$container->setParameter('fos_message.message_class', $config['message_class']);
$container->setParameter('fos_message.thread_class', $config['thread_class']);

$container->setParameter('fos_message.new_thread_form.class', $config['new_thread_form']['class']);
$container->setParameter('fos_message.new_thread_form.model', $config['new_thread_form']['model']);
$container->setParameter('fos_message.new_thread_form.name', $config['new_thread_form']['name']);
$container->setParameter('fos_message.reply_form.class', $config['reply_form']['class']);
$container->setParameter('fos_message.reply_form.model', $config['reply_form']['model']);
$container->setParameter('fos_message.reply_form.name', $config['reply_form']['name']);

Expand All @@ -51,10 +53,8 @@ public function load(array $configs, ContainerBuilder $container)
$container->setAlias('fos_message.spam_detector', $config['spam_detector']);
$container->setAlias('fos_message.twig_extension', $config['twig_extension']);

$container->setAlias('fos_message.new_thread_form.type', $config['new_thread_form']['type']);
$container->setAlias('fos_message.new_thread_form.factory', $config['new_thread_form']['factory']);
$container->setAlias('fos_message.new_thread_form.handler', $config['new_thread_form']['handler']);
$container->setAlias('fos_message.reply_form.type', $config['reply_form']['type']);
$container->setAlias('fos_message.reply_form.factory', $config['reply_form']['factory']);
$container->setAlias('fos_message.reply_form.handler', $config['reply_form']['handler']);

Expand Down
6 changes: 3 additions & 3 deletions Document/Thread.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace FOS\MessageBundle\Document;

use FOS\MessageBundle\Model\Thread as AbstractThread;
use FOS\MessageBundle\Model\MessageInterface;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use FOS\MessageBundle\Model\MessageInterface;
use FOS\MessageBundle\Model\ParticipantInterface;
use FOS\MessageBundle\Model\Thread as AbstractThread;

abstract class Thread extends AbstractThread
{
Expand Down
6 changes: 3 additions & 3 deletions DocumentManager/MessageManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
namespace FOS\MessageBundle\DocumentManager;

use Doctrine\ODM\MongoDB\DocumentManager;
use Doctrine\ODM\MongoDB\Query\Builder;
use FOS\MessageBundle\Document\Message;
use FOS\MessageBundle\Model\MessageInterface;
use FOS\MessageBundle\ModelManager\MessageManager as BaseMessageManager;
use FOS\MessageBundle\Model\ReadableInterface;
use FOS\MessageBundle\Model\ParticipantInterface;
use FOS\MessageBundle\Model\ReadableInterface;
use FOS\MessageBundle\Model\ThreadInterface;
use Doctrine\ODM\MongoDB\Query\Builder;
use FOS\MessageBundle\ModelManager\MessageManager as BaseMessageManager;

/**
* Default MongoDB MessageManager.
Expand Down
6 changes: 3 additions & 3 deletions DocumentManager/ThreadManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
namespace FOS\MessageBundle\DocumentManager;

use Doctrine\ODM\MongoDB\DocumentManager;
use Doctrine\ODM\MongoDB\Query\Builder;
use FOS\MessageBundle\Document\Thread;
use FOS\MessageBundle\Model\ThreadInterface;
use FOS\MessageBundle\Model\ParticipantInterface;
use FOS\MessageBundle\Model\ReadableInterface;
use FOS\MessageBundle\Model\ThreadInterface;
use FOS\MessageBundle\ModelManager\ThreadManager as BaseThreadManager;
use FOS\MessageBundle\Model\ParticipantInterface;
use Doctrine\ODM\MongoDB\Query\Builder;

/**
* Default MongoDB ThreadManager.
Expand Down
2 changes: 1 addition & 1 deletion Entity/MessageMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace FOS\MessageBundle\Entity;

use FOS\MessageBundle\Model\MessageMetadata as BaseMessageMetadata;
use FOS\MessageBundle\Model\MessageInterface;
use FOS\MessageBundle\Model\MessageMetadata as BaseMessageMetadata;

abstract class MessageMetadata extends BaseMessageMetadata
{
Expand Down
2 changes: 1 addition & 1 deletion Entity/Thread.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use FOS\MessageBundle\Model\MessageInterface;
use FOS\MessageBundle\Model\Thread as BaseThread;
use FOS\MessageBundle\Model\ParticipantInterface;
use FOS\MessageBundle\Model\Thread as BaseThread;

use FOS\MessageBundle\Model\ThreadMetadata as ModelThreadMetadata;

Expand Down
6 changes: 3 additions & 3 deletions EntityManager/MessageManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

namespace FOS\MessageBundle\EntityManager;

use FOS\MessageBundle\ModelManager\MessageManager as BaseMessageManager;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Query\Builder;
use FOS\MessageBundle\Model\MessageInterface;
use FOS\MessageBundle\Model\ReadableInterface;
use FOS\MessageBundle\Model\ParticipantInterface;
use FOS\MessageBundle\Model\ReadableInterface;
use FOS\MessageBundle\Model\ThreadInterface;
use Doctrine\ORM\Query\Builder;
use FOS\MessageBundle\ModelManager\MessageManager as BaseMessageManager;

/**
* Default ORM MessageManager.
Expand Down
8 changes: 4 additions & 4 deletions EntityManager/ThreadManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace FOS\MessageBundle\EntityManager;

use FOS\MessageBundle\ModelManager\ThreadManager as BaseThreadManager;
use Doctrine\ORM\EntityManager;
use FOS\MessageBundle\Model\ThreadInterface;
use FOS\MessageBundle\Model\ReadableInterface;
use FOS\MessageBundle\Model\ParticipantInterface;
use Doctrine\ORM\Query\Builder;
use FOS\MessageBundle\Model\ParticipantInterface;
use FOS\MessageBundle\Model\ReadableInterface;
use FOS\MessageBundle\Model\ThreadInterface;
use FOS\MessageBundle\ModelManager\ThreadManager as BaseThreadManager;

/**
* Default ORM ThreadManager.
Expand Down
4 changes: 2 additions & 2 deletions Event/MessageEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace FOS\MessageBundle\Event;

use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\EventDispatcher\Event;
use FOS\MessageBundle\Model\MessageInterface;
use FOS\MessageBundle\Model\ThreadInterface;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\HttpKernel\HttpKernelInterface;

class MessageEvent extends ThreadEvent
{
Expand Down
4 changes: 2 additions & 2 deletions Event/ReadableEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace FOS\MessageBundle\Event;

use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\EventDispatcher\Event;
use FOS\MessageBundle\Model\ReadableInterface;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\HttpKernel\HttpKernelInterface;

class ReadableEvent extends Event
{
Expand Down
4 changes: 2 additions & 2 deletions Event/ThreadEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace FOS\MessageBundle\Event;

use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\EventDispatcher\Event;
use FOS\MessageBundle\Model\ThreadInterface;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\HttpKernel\HttpKernelInterface;

class ThreadEvent extends Event
{
Expand Down
11 changes: 5 additions & 6 deletions FormFactory/AbstractMessageFormFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace FOS\MessageBundle\FormFactory;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormFactoryInterface;
use FOS\MessageBundle\FormModel\AbstractMessage;

Expand All @@ -21,11 +20,11 @@ abstract class AbstractMessageFormFactory
protected $formFactory;

/**
* The message form type
* The message form class
*
* @var AbstractType
* @var string
*/
protected $formType;
protected $formClass;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's a bc break as well


/**
* The name of the form
Expand All @@ -41,10 +40,10 @@ abstract class AbstractMessageFormFactory
*/
protected $messageClass;

public function __construct(FormFactoryInterface $formFactory, AbstractType $formType, $formName, $messageClass)
public function __construct(FormFactoryInterface $formFactory, $formClass, $formName, $messageClass)
{
$this->formFactory = $formFactory;
$this->formType = $formType;
$this->formClass = $formClass;
$this->formName = $formName;
$this->messageClass = $messageClass;
}
Expand Down
2 changes: 1 addition & 1 deletion FormFactory/NewThreadMessageFormFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ public function create()
{
$message = $this->createModelInstance();

return $this->formFactory->createNamed($this->formName, $this->formType, $message);
return $this->formFactory->createNamed($this->formName, $this->formClass, $message);
}
}
2 changes: 1 addition & 1 deletion FormFactory/ReplyMessageFormFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ public function create(ThreadInterface $thread)
$message = $this->createModelInstance();
$message->setThread($thread);

return $this->formFactory->createNamed($this->formName, $this->formType, $message);
return $this->formFactory->createNamed($this->formName, $this->formClass, $message);
}
}
Loading