Skip to content

Commit

Permalink
Mark classes as final (#1463)
Browse files Browse the repository at this point in the history
  • Loading branch information
jordisala1991 authored Jul 17, 2022
1 parent f059a16 commit f8022f6
Show file tree
Hide file tree
Showing 74 changed files with 279 additions and 448 deletions.
4 changes: 4 additions & 0 deletions UPGRADE-4.0.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
UPGRADE FROM 3.x to 4.0
=======================

## Final classes

All classes that were marked as final in 3.x are now marked final in 4.0.

## Deprecations

All the deprecated code introduced on 3.x is removed on 4.0.
Expand Down
4 changes: 1 addition & 3 deletions src/Admin/BlockAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@
* Admin class for the Block model.
*
* @author Thomas Rabaix <[email protected]>
*
* @final since sonata-project/page-bundle 3.26
*/
class BlockAdmin extends BaseBlockAdmin
final class BlockAdmin extends BaseBlockAdmin
{
/**
* @var array
Expand Down
5 changes: 1 addition & 4 deletions src/Admin/Extension/CreateSnapshotAdminExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@
use Sonata\PageBundle\Model\PageInterface;
use Sonata\PageBundle\Service\Contract\CreateSnapshotByPageInterface;

/**
* @final since sonata-project/page-bundle 3.26
*/
class CreateSnapshotAdminExtension extends AbstractAdminExtension
final class CreateSnapshotAdminExtension extends AbstractAdminExtension
{
protected CreateSnapshotByPageInterface $createSnapshotByPage;

Expand Down
4 changes: 1 addition & 3 deletions src/Admin/PageAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,8 @@
* Admin definition for the Page class.
*
* @author Thomas Rabaix <[email protected]>
*
* @final since sonata-project/page-bundle 3.26
*/
class PageAdmin extends AbstractAdmin
final class PageAdmin extends AbstractAdmin
{
protected $classnameLabel = 'Page';

Expand Down
4 changes: 1 addition & 3 deletions src/Admin/SharedBlockAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@
* Admin class for shared Block model.
*
* @author Romain Mouillard <[email protected]>
*
* @final since sonata-project/page-bundle 3.26
*/
class SharedBlockAdmin extends BaseBlockAdmin
final class SharedBlockAdmin extends BaseBlockAdmin
{
/**
* @var string
Expand Down
4 changes: 1 addition & 3 deletions src/Admin/SiteAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@
* Admin definition for the Site class.
*
* @author Thomas Rabaix <[email protected]>
*
* @final since sonata-project/page-bundle 3.26
*/
class SiteAdmin extends AbstractAdmin
final class SiteAdmin extends AbstractAdmin
{
protected $classnameLabel = 'Site';

Expand Down
4 changes: 1 addition & 3 deletions src/Admin/SnapshotAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@
* Admin definition for the Snapshot class.
*
* @author Thomas Rabaix <[email protected]>
*
* @final since sonata-project/page-bundle 3.26
*/
class SnapshotAdmin extends AbstractAdmin
final class SnapshotAdmin extends AbstractAdmin
{
protected $classnameLabel = 'Snapshot';

Expand Down
4 changes: 1 addition & 3 deletions src/Block/BlockContextManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@
*
* @psalm-suppress InvalidExtendClass
* @phpstan-ignore-next-line
*
* @final since sonata-project/page-bundle 3.26
*/
class BlockContextManager extends BaseBlockContextManager
final class BlockContextManager extends BaseBlockContextManager
{
protected function configureSettings(OptionsResolver $optionsResolver, BlockInterface $block): void
{
Expand Down
4 changes: 1 addition & 3 deletions src/Block/BreadcrumbBlockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@
* BlockService for homepage breadcrumb.
*
* @author Sylvain Deloux <[email protected]>
*
* @final since sonata-project/page-bundle 3.26
*/
class BreadcrumbBlockService extends BaseBreadcrumbMenuBlockService
final class BreadcrumbBlockService extends BaseBreadcrumbMenuBlockService
{
/**
* @var CmsManagerSelectorInterface
Expand Down
6 changes: 2 additions & 4 deletions src/CmsManager/CmsManagerSelector.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,13 @@
* - sonata.page.cms.snapshot if the user is a standard user.
*
* @author Thomas Rabaix <[email protected]>
*
* @final since sonata-project/page-bundle 3.26
*/
class CmsManagerSelector implements CmsManagerSelectorInterface, LogoutHandlerInterface
final class CmsManagerSelector implements CmsManagerSelectorInterface, LogoutHandlerInterface
{
/**
* @var ContainerInterface
*/
protected $container;
private $container;

/**
* @psalm-suppress ContainerDependency
Expand Down
4 changes: 1 addition & 3 deletions src/CmsManager/CmsPageManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@
* The CmsPageManager class is in charge of retrieving the correct page (cms page or action page).
*
* @author Thomas Rabaix <[email protected]>
*
* @final since sonata-project/page-bundle 3.26
*/
class CmsPageManager extends BaseCmsPageManager
final class CmsPageManager extends BaseCmsPageManager
{
/**
* @var BlockInteractorInterface
Expand Down
4 changes: 1 addition & 3 deletions src/CmsManager/CmsSnapshotManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@
* The CmsSnapshotManager class is in charge of retrieving the correct page (cms page or action page).
*
* @author Thomas Rabaix <[email protected]>
*
* @final since sonata-project/page-bundle 3.26
*/
class CmsSnapshotManager extends BaseCmsPageManager
final class CmsSnapshotManager extends BaseCmsPageManager
{
/**
* @var SnapshotManagerInterface
Expand Down
10 changes: 4 additions & 6 deletions src/CmsManager/DecoratorStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,23 @@
* on the current request.
*
* @author Thomas Rabaix <[email protected]>
*
* @final since sonata-project/page-bundle 3.26
*/
class DecoratorStrategy implements DecoratorStrategyInterface
final class DecoratorStrategy implements DecoratorStrategyInterface
{
/**
* @var array
*/
protected $ignoreRoutes;
private $ignoreRoutes;

/**
* @var array
*/
protected $ignoreRoutePatterns;
private $ignoreRoutePatterns;

/**
* @var array
*/
protected $ignoreUriPatterns;
private $ignoreUriPatterns;

public function __construct(array $ignoreRoutes, array $ignoreRoutePatterns, array $ignoreUriPatterns)
{
Expand Down
4 changes: 1 addition & 3 deletions src/Command/CleanupSnapshotsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@

/**
* Cleanups the deprecated snapshots.
*
* @final since sonata-project/page-bundle 3.26
*/
class CleanupSnapshotsCommand extends BaseCommand
final class CleanupSnapshotsCommand extends BaseCommand
{
protected static $defaultName = 'sonata:page:cleanup-snapshots';

Expand Down
4 changes: 1 addition & 3 deletions src/Command/CreateSiteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@
* Create a site.
*
* @author Thomas Rabaix <[email protected]>
*
* @final since sonata-project/page-bundle 3.26
*/
class CreateSiteCommand extends BaseCommand
final class CreateSiteCommand extends BaseCommand
{
public function configure(): void
{
Expand Down
4 changes: 1 addition & 3 deletions src/Command/CreateSnapshotsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@
* Create snapshots for a site.
*
* @author Thomas Rabaix <[email protected]>
*
* @final since sonata-project/page-bundle 3.26
*/
class CreateSnapshotsCommand extends BaseCommand
final class CreateSnapshotsCommand extends BaseCommand
{
protected static $defaultName = 'sonata:page:create-snapshots';

Expand Down
4 changes: 1 addition & 3 deletions src/Command/DumpPageCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@
/**
* Migrates the name setting of all blocks into a code setting.
*
* @final since sonata-project/page-bundle 3.26
*
* NEXT_MAJOR: Remove this class
*
* @deprecated since 3.27, and it will be removed in 4.0.
*/
class DumpPageCommand extends BaseCommand
final class DumpPageCommand extends BaseCommand
{
public function configure(): void
{
Expand Down
4 changes: 1 addition & 3 deletions src/Command/MigrateBlockNameSettingCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@

/**
* Migrates the name setting of all blocks into a code setting.
*
* @final since sonata-project/page-bundle 3.26
*/
class MigrateBlockNameSettingCommand extends BaseCommand
final class MigrateBlockNameSettingCommand extends BaseCommand
{
public const CONTAINER_TYPE = 'sonata.page.block.container';

Expand Down
5 changes: 1 addition & 4 deletions src/Command/MigrateToJsonTypeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

/**
* @final since sonata-project/page-bundle 3.26
*/
class MigrateToJsonTypeCommand extends BaseCommand
final class MigrateToJsonTypeCommand extends BaseCommand
{
public function configure(): void
{
Expand Down
4 changes: 1 addition & 3 deletions src/Command/RenderBlockCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@
/**
* Migrates the name setting of all blocks into a code setting.
*
* @final since sonata-project/page-bundle 3.26
*
* NEXT_MAJOR: Remove this class
*
* @deprecated since 3.27, and it will be removed in 4.0.
*/
class RenderBlockCommand extends BaseCommand
final class RenderBlockCommand extends BaseCommand
{
public function configure(): void
{
Expand Down
4 changes: 1 addition & 3 deletions src/Command/UpdateCoreRoutesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@
* Update core routes by reading routing information.
*
* @author Thomas Rabaix <[email protected]>
*
* @final since sonata-project/page-bundle 3.26
*/
class UpdateCoreRoutesCommand extends BaseCommand
final class UpdateCoreRoutesCommand extends BaseCommand
{
public function configure(): void
{
Expand Down
10 changes: 4 additions & 6 deletions src/Controller/AjaxController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,23 @@
* Render a block in ajax.
*
* @author Thomas Rabaix <[email protected]>
*
* @final since sonata-project/page-bundle 3.26
*/
class AjaxController
final class AjaxController
{
/**
* @var CmsManagerSelectorInterface
*/
protected $cmsManagerSelector;
private $cmsManagerSelector;

/**
* @var BlockRendererInterface
*/
protected $blockRenderer;
private $blockRenderer;

/**
* @var BlockContextManagerInterface
*/
protected $contextManager;
private $contextManager;

/**
* @param CmsManagerSelectorInterface $cmsManagerSelector CMS Manager selector
Expand Down
4 changes: 1 addition & 3 deletions src/Controller/BlockAdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@
* Block Admin Controller.
*
* @author Thomas Rabaix <[email protected]>
*
* @final since sonata-project/page-bundle 3.26
*/
class BlockAdminController extends Controller
final class BlockAdminController extends Controller
{
/**
* @throws AccessDeniedException
Expand Down
4 changes: 1 addition & 3 deletions src/Controller/BlockController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@
* Block controller.
*
* @author Thomas Rabaix <[email protected]>
*
* @final since sonata-project/page-bundle 3.26
*/
class BlockController extends Controller
final class BlockController extends Controller
{
/**
* @return Response
Expand Down
4 changes: 1 addition & 3 deletions src/Controller/PageAdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@
* Page Admin Controller.
*
* @author Thomas Rabaix <[email protected]>
*
* @final since sonata-project/page-bundle 3.26
*/
class PageAdminController extends Controller
final class PageAdminController extends Controller
{
/**
* @throws AccessDeniedException
Expand Down
4 changes: 1 addition & 3 deletions src/Controller/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@
* Page controller.
*
* @author Thomas Rabaix <[email protected]>
*
* @final since sonata-project/page-bundle 3.26
*/
class PageController extends Controller
final class PageController extends Controller
{
/**
* @throws AccessDeniedException
Expand Down
4 changes: 1 addition & 3 deletions src/Controller/SiteAdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@
* Site Admin controller.
*
* @author Thomas Rabaix <[email protected]>
*
* @final since sonata-project/page-bundle 3.26
*/
class SiteAdminController extends Controller
final class SiteAdminController extends Controller
{
/**
* @throws NotFoundHttpException
Expand Down
4 changes: 1 addition & 3 deletions src/Controller/SnapshotAdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@
* Snapshot Admin Controller.
*
* @author Thomas Rabaix <[email protected]>
*
* @final since sonata-project/page-bundle 3.26
*/
class SnapshotAdminController extends Controller
final class SnapshotAdminController extends Controller
{
public function createAction(?Request $request = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@
* GlobalVariablesCompilerPass.
*
* @author Thomas Rabaix <[email protected]>
*
* @final since sonata-project/page-bundle 3.26
*/
class GlobalVariablesCompilerPass implements CompilerPassInterface
final class GlobalVariablesCompilerPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container): void
{
Expand Down
Loading

0 comments on commit f8022f6

Please sign in to comment.