Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions Controller/MessageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace FOS\MessageBundle\Controller;

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

class MessageController extends ContainerAware
{
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
2 changes: 1 addition & 1 deletion 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
6 changes: 3 additions & 3 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 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
2 changes: 1 addition & 1 deletion FormFactory/AbstractMessageFormFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace FOS\MessageBundle\FormFactory;

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

/**
* Instanciates message forms
Expand Down
15 changes: 8 additions & 7 deletions FormHandler/AbstractMessageFormHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

namespace FOS\MessageBundle\FormHandler;

use Symfony\Component\Form\Form;
use Symfony\Component\HttpFoundation\Request;
use FOS\MessageBundle\Composer\ComposerInterface;
use FOS\MessageBundle\FormModel\AbstractMessage;
use FOS\MessageBundle\Security\ParticipantProviderInterface;
use FOS\MessageBundle\Model\ParticipantInterface;
use FOS\MessageBundle\Security\ParticipantProviderInterface;
use FOS\MessageBundle\Sender\SenderInterface;
use Symfony\Component\Form\Form;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;

/**
* Handles messages forms, from binding request to sending the message
Expand All @@ -22,11 +23,11 @@ abstract class AbstractMessageFormHandler
protected $sender;
protected $participantProvider;

public function __construct(Request $request, ComposerInterface $composer, SenderInterface $sender, ParticipantProviderInterface $participantProvider)
public function __construct(RequestStack $requestStack, ComposerInterface $composer, SenderInterface $sender, ParticipantProviderInterface $participantProvider)
{
$this->request = $request;
$this->composer = $composer;
$this->sender = $sender;
$this->request = $requestStack->getCurrentRequest();
$this->composer = $composer;
$this->sender = $sender;
$this->participantProvider = $participantProvider;
}

Expand Down
12 changes: 7 additions & 5 deletions FormType/NewThreadMessageFormType.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
namespace FOS\MessageBundle\FormType;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

/**
* Message form type for starting a new conversation
Expand All @@ -17,18 +19,18 @@ public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('recipient', 'fos_user_username', array('label' => 'recipient', 'translation_domain' => 'FOSMessageBundle'))
->add('subject', 'text', array('label' => 'subject', 'translation_domain' => 'FOSMessageBundle'))
->add('body', 'textarea', array('label' => 'body', 'translation_domain' => 'FOSMessageBundle'));
->add('subject', TextType::class, array('label' => 'subject', 'translation_domain' => 'FOSMessageBundle'))
->add('body', TextareaType::class, array('label' => 'body', 'translation_domain' => 'FOSMessageBundle'));
}

public function setDefaultOptions(OptionsResolverInterface $resolver)
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'intention' => 'message',
));
}

public function getName()
public function getBlockPrefix()
{
return 'fos_message_new_thread';
}
Expand Down
12 changes: 7 additions & 5 deletions FormType/NewThreadMultipleMessageFormType.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php
namespace FOS\MessageBundle\FormType;

use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;

/**
* Message form type for starting a new conversation with multiple recipients
Expand All @@ -14,12 +16,12 @@ class NewThreadMultipleMessageFormType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('recipients', 'recipients_selector', array('label' => 'recipients', 'translation_domain' => 'FOSMessageBundle'))
->add('subject', 'text', array('label' => 'subject', 'translation_domain' => 'FOSMessageBundle'))
->add('body', 'textarea', array('label' => 'body', 'translation_domain' => 'FOSMessageBundle'));
->add('recipients', RecipientsType::class, array('label' => 'recipients', 'translation_domain' => 'FOSMessageBundle'))
->add('subject', TextType::class, array('label' => 'subject', 'translation_domain' => 'FOSMessageBundle'))
->add('body', TextareaType::class, array('label' => 'body', 'translation_domain' => 'FOSMessageBundle'));
}

public function getName()
public function getBlockPrefix()
{
return 'fos_message_new_multiperson_thread';
}
Expand Down
13 changes: 7 additions & 6 deletions FormType/RecipientsType.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?php
namespace FOS\MessageBundle\FormType;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use FOS\MessageBundle\DataTransformer\RecipientsDataTransformer;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

/**
* Description of RecipientsType
Expand Down Expand Up @@ -38,7 +39,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
/**
* {@inheritDoc}
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'invalid_message' => 'The selected recipient does not exist',
Expand All @@ -50,13 +51,13 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
*/
public function getParent()
{
return 'text';
return TextType::class;
}

/**
* {@inheritDoc}
*/
public function getName()
public function getBlockPrefix()
{
return 'recipients_selector';
}
Expand Down
Loading