Skip to content
This repository has been archived by the owner on Jul 28, 2022. It is now read-only.

Commit

Permalink
Mark classes as final
Browse files Browse the repository at this point in the history
  • Loading branch information
franmomu authored and VincentLanglet committed May 10, 2021
1 parent 83159c6 commit 7f40e5e
Show file tree
Hide file tree
Showing 41 changed files with 262 additions and 59 deletions.
4 changes: 4 additions & 0 deletions UPGRADE-3.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ UPGRADE 3.x
UPGRADE FROM 3.x to 3.x
=======================

### Close API

Most of the classes have been marked as `@final` and they will be final in `4.0`.

### Upgrade to SonataDatagridBundle 3.0

There is a minimal BC Break on `MessageManager::getPager`. If you are extending this method you should add parameter and return type hints.
Expand Down
1 change: 1 addition & 0 deletions src/Admin/MessageAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

/**
* @phpstan-extends AbstractAdmin<\Sonata\NotificationBundle\Model\Message>
* @final since sonata-project/notification-bundle 3.x
*/
class MessageAdmin extends AbstractAdmin
{
Expand Down
2 changes: 2 additions & 0 deletions src/Backend/AMQPBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@

/**
* Consumer side of the rabbitMQ backend.
*
* @final since sonata-project/notification-bundle 3.x
*/
class AMQPBackend implements BackendInterface
{
Expand Down
2 changes: 2 additions & 0 deletions src/Backend/AMQPBackendDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

/**
* Producer side of the rabbitmq backend.
*
* @final since sonata-project/notification-bundle 3.x
*/
class AMQPBackendDispatcher extends QueueBackendDispatcher
{
Expand Down
3 changes: 3 additions & 0 deletions src/Backend/BackendHealthCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@

use Laminas\Diagnostics\Check\AbstractCheck;

/**
* @final since sonata-project/notification-bundle 3.x
*/
class BackendHealthCheck extends AbstractCheck
{
/**
Expand Down
3 changes: 3 additions & 0 deletions src/Backend/MessageManagerBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
use Sonata\NotificationBundle\Model\MessageManagerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;

/**
* @final since sonata-project/notification-bundle 3.x
*/
class MessageManagerBackend implements BackendInterface
{
/**
Expand Down
2 changes: 2 additions & 0 deletions src/Backend/MessageManagerBackendDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

/**
* Producer side of the doctrine backend.
*
* @final since sonata-project/notification-bundle 3.x
*/
class MessageManagerBackendDispatcher extends QueueBackendDispatcher
{
Expand Down
2 changes: 2 additions & 0 deletions src/Backend/PostponeRuntimeBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
* @see https://gist.github.com/3852361
*
* @author Toni Uebernickel <[email protected]>
*
* @final since sonata-project/notification-bundle 3.x
*/
class PostponeRuntimeBackend extends RuntimeBackend
{
Expand Down
3 changes: 3 additions & 0 deletions src/Command/CleanupCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

/**
* @final since sonata-project/notification-bundle 3.x
*/
class CleanupCommand extends ContainerAwareCommand
{
public function configure()
Expand Down
3 changes: 3 additions & 0 deletions src/Command/ConsumerHandlerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;

/**
* @final since sonata-project/notification-bundle 3.x
*/
class ConsumerHandlerCommand extends ContainerAwareCommand
{
public function configure()
Expand Down
3 changes: 3 additions & 0 deletions src/Command/CreateAndPublishCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

/**
* @final since sonata-project/notification-bundle 3.x
*/
class CreateAndPublishCommand extends ContainerAwareCommand
{
public function configure()
Expand Down
3 changes: 3 additions & 0 deletions src/Command/ListHandlerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

/**
* @final since sonata-project/notification-bundle 3.x
*/
class ListHandlerCommand extends ContainerAwareCommand
{
public function configure()
Expand Down
3 changes: 3 additions & 0 deletions src/Command/ListQueuesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

/**
* @final since sonata-project/notification-bundle 3.x
*/
class ListQueuesCommand extends ContainerAwareCommand
{
public function configure()
Expand Down
3 changes: 3 additions & 0 deletions src/Command/RestartCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;

/**
* @final since sonata-project/notification-bundle 3.x
*/
class RestartCommand extends ContainerAwareCommand
{
public function configure()
Expand Down
3 changes: 3 additions & 0 deletions src/Consumer/ConsumerEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
use Sonata\NotificationBundle\Model\MessageInterface;
use Symfony\Contracts\EventDispatcher\Event;

/**
* @final since sonata-project/notification-bundle 3.x
*/
class ConsumerEvent extends Event implements ConsumerEventInterface
{
/**
Expand Down
2 changes: 2 additions & 0 deletions src/Consumer/ConsumerReturnInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* Return informations for comsumers.
*
* @author Kevin Nedelec <[email protected]>
*
* @final since sonata-project/notification-bundle 3.x
*/
class ConsumerReturnInfo
{
Expand Down
3 changes: 3 additions & 0 deletions src/Consumer/LoggerConsumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
use Psr\Log\LoggerInterface;
use Sonata\NotificationBundle\Exception\InvalidParameterException;

/**
* @final since sonata-project/notification-bundle 3.x
*/
class LoggerConsumer implements ConsumerInterface
{
/**
Expand Down
3 changes: 3 additions & 0 deletions src/Consumer/Metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

namespace Sonata\NotificationBundle\Consumer;

/**
* @final since sonata-project/notification-bundle 3.x
*/
class Metadata
{
/**
Expand Down
3 changes: 3 additions & 0 deletions src/Consumer/SwiftMailerConsumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@

use Sonata\NotificationBundle\Model\MessageInterface;

/**
* @final since sonata-project/notification-bundle 3.x
*/
class SwiftMailerConsumer implements ConsumerInterface
{
/**
Expand Down
2 changes: 2 additions & 0 deletions src/Controller/Api/MessageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

/**
* @author Hugo Briand <[email protected]>
*
* @final since sonata-project/notification-bundle 3.x
*/
class MessageController
{
Expand Down
3 changes: 3 additions & 0 deletions src/Controller/MessageAdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;

/**
* @final since sonata-project/notification-bundle 3.x
*/
class MessageAdminController extends CRUDController
{
/**
Expand Down
5 changes: 5 additions & 0 deletions src/DependencyInjection/Compiler/NotificationCompilerPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
use Symfony\Component\DependencyInjection\Reference;

/**
* @final since sonata-project/notification-bundle 3.x
*
* @internal since sonata-project/notification-bundle 4.0
*/
class NotificationCompilerPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container)
Expand Down
3 changes: 3 additions & 0 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;

/**
* @final since sonata-project/notification-bundle 3.x
*/
class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder()
Expand Down
3 changes: 3 additions & 0 deletions src/DependencyInjection/SonataNotificationExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;

/**
* @final since sonata-project/notification-bundle 3.x
*/
class SonataNotificationExtension extends Extension
{
/**
Expand Down
3 changes: 3 additions & 0 deletions src/Entity/MessageManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
use Sonata\NotificationBundle\Model\MessageInterface;
use Sonata\NotificationBundle\Model\MessageManagerInterface;

/**
* @final since sonata-project/notification-bundle 3.x
*/
class MessageManager extends BaseEntityManager implements MessageManagerInterface
{
public function save($entity, $andFlush = true)
Expand Down
2 changes: 2 additions & 0 deletions src/Event/DoctrineBackendOptimizeListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
* Used with doctrine backend to clear context taking care of the batch iterations.
*
* @author Kevin Nedelec <[email protected]>
*
* @final since sonata-project/notification-bundle 3.x
*/
class DoctrineBackendOptimizeListener implements IterationListener
{
Expand Down
2 changes: 2 additions & 0 deletions src/Event/DoctrineOptimizeListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
* Do not use with doctrine backend, use DoctrineBackendOptimizeListener instead.
*
* @author Kevin Nedelec <[email protected]>
*
* @final since sonata-project/notification-bundle 3.x
*/
class DoctrineOptimizeListener implements IterationListener
{
Expand Down
2 changes: 2 additions & 0 deletions src/Event/IterateEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
* Event for ConsumerHandlerCommand iterations event.
*
* @author Kevin Nedelec <[email protected]>
*
* @final since sonata-project/notification-bundle 3.x
*/
class IterateEvent extends Event
{
Expand Down
3 changes: 3 additions & 0 deletions src/Exception/BackendNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

namespace Sonata\NotificationBundle\Exception;

/**
* @final since sonata-project/notification-bundle 3.x
*/
class BackendNotFoundException extends \RuntimeException
{
}
3 changes: 3 additions & 0 deletions src/Exception/HandlingException.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

namespace Sonata\NotificationBundle\Exception;

/**
* @final since sonata-project/notification-bundle 3.x
*/
class HandlingException extends \RuntimeException
{
}
3 changes: 3 additions & 0 deletions src/Exception/InvalidParameterException.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ class InvalidParameterException extends CoreBundleException
{
}
} else {
/**
* @final since sonata-project/notification-bundle 3.x
*/
class InvalidParameterException extends \RuntimeException
{
}
Expand Down
3 changes: 3 additions & 0 deletions src/Form/Type/MessageSerializationType.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@

use Sonata\Form\Type\BaseDoctrineORMSerializationType;

/**
* @final since sonata-project/notification-bundle 3.x
*/
class MessageSerializationType extends BaseDoctrineORMSerializationType
{
}
3 changes: 3 additions & 0 deletions src/Iterator/AMQPMessageIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
use PhpAmqpLib\Message\AMQPMessage;
use Sonata\NotificationBundle\Model\Message;

/**
* @final since sonata-project/notification-bundle 3.x
*/
class AMQPMessageIterator implements MessageIteratorInterface
{
/**
Expand Down
3 changes: 3 additions & 0 deletions src/Iterator/ErroneousMessageIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
use Sonata\NotificationBundle\Model\MessageInterface;
use Sonata\NotificationBundle\Model\MessageManagerInterface;

/**
* @final since sonata-project/notification-bundle 3.x
*/
class ErroneousMessageIterator extends MessageManagerMessageIterator
{
/**
Expand Down
2 changes: 2 additions & 0 deletions src/Iterator/IteratorProxyMessageIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

/**
* @author Toni Uebernickel <[email protected]>
*
* @final since sonata-project/notification-bundle 3.x
*/
class IteratorProxyMessageIterator implements MessageIteratorInterface
{
Expand Down
3 changes: 3 additions & 0 deletions src/Selector/ErroneousMessagesSelector.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
use Doctrine\Persistence\ManagerRegistry;
use Sonata\NotificationBundle\Model\MessageInterface;

/**
* @final since sonata-project/notification-bundle 3.x
*/
class ErroneousMessagesSelector
{
/**
Expand Down
3 changes: 3 additions & 0 deletions src/SonataNotificationBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;

/**
* @final since sonata-project/notification-bundle 3.x
*/
class SonataNotificationBundle extends Bundle
{
public function build(ContainerBuilder $container)
Expand Down
Loading

0 comments on commit 7f40e5e

Please sign in to comment.