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

Close API by mark classes as final #1471

Merged
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: 8 additions & 0 deletions UPGRADE-4.x.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
UPGRADE 4.x
===========

UPGRADE FROM 4.x to 4.x
=======================

### Mark classes as final

A lot of classes were marked as final with the phpdoc annotation, make sure you avoid
extending them because on next major they will become final.

UPGRADE FROM 4.13 to 4.14
=========================

Expand Down
3 changes: 3 additions & 0 deletions src/Admin/Document/UserAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@

use Sonata\UserBundle\Admin\Model\UserAdmin as BaseUserAdmin;

/**
* @final since sonata-project/user-bundle 4.x
*/
class UserAdmin extends BaseUserAdmin
{
}
3 changes: 3 additions & 0 deletions src/Admin/Entity/UserAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@

use Sonata\UserBundle\Admin\Model\UserAdmin as BaseUserAdmin;

/**
* @final since sonata-project/user-bundle 4.x
*/
class UserAdmin extends BaseUserAdmin
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use Symfony\Component\DependencyInjection\Reference;

/**
* GlobalVariablesCompilerPass.
* @final since sonata-project/user-bundle 4.x
*
* @author Thomas Rabaix <thomas.rabaix@sonata-project.org>
*/
Expand Down
2 changes: 2 additions & 0 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
use Symfony\Component\Config\Definition\ConfigurationInterface;

/**
* @final since sonata-project/user-bundle 4.x
*
* This is the class that validates and merges configuration from your app/config files.
*
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
Expand Down
2 changes: 2 additions & 0 deletions src/DependencyInjection/SonataUserExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
use Symfony\Component\HttpKernel\DependencyInjection\Extension;

/**
* @final since sonata-project/user-bundle 4.x
*
* @author Thomas Rabaix <thomas.rabaix@sonata-project.org>
*/
class SonataUserExtension extends Extension implements PrependExtensionInterface
Expand Down
2 changes: 2 additions & 0 deletions src/Document/GroupManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
use Sonata\UserBundle\Model\GroupManagerInterface;

/**
* @final since sonata-project/user-bundle 4.x
*
* @author Hugo Briand <briand@ekino.com>
*/
class GroupManager extends BaseGroupManager implements GroupManagerInterface
Expand Down
2 changes: 2 additions & 0 deletions src/Document/UserManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
use Sonata\UserBundle\Model\UserManagerInterface;

/**
* @final since sonata-project/user-bundle 4.x
*
* @author Hugo Briand <briand@ekino.com>
*/
class UserManager extends BaseUserManager implements UserManagerInterface
Expand Down
2 changes: 2 additions & 0 deletions src/Entity/GroupManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
use Sonata\UserBundle\Model\GroupManagerInterface;

/**
* @final since sonata-project/user-bundle 4.x
*
* @author Hugo Briand <briand@ekino.com>
*/
class GroupManager extends BaseGroupManager implements GroupManagerInterface
Expand Down
2 changes: 2 additions & 0 deletions src/Entity/UserManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
use Sonata\UserBundle\Model\UserManagerInterface;

/**
* @final since sonata-project/user-bundle 4.x
*
* @author Hugo Briand <briand@ekino.com>
*/
class UserManager extends BaseUserManager implements UserManagerInterface, ManagerInterface
Expand Down
3 changes: 3 additions & 0 deletions src/Form/Transformer/RestoreRolesTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
use Sonata\UserBundle\Security\EditableRolesBuilder;
use Symfony\Component\Form\DataTransformerInterface;

/**
* @final since sonata-project/user-bundle 4.x
*/
class RestoreRolesTransformer implements DataTransformerInterface
{
/**
Expand Down
3 changes: 3 additions & 0 deletions src/Form/Type/SecurityRolesType.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
use Symfony\Component\OptionsResolver\Options;
use Symfony\Component\OptionsResolver\OptionsResolver;

/**
* @final since sonata-project/user-bundle 4.x
*/
class SecurityRolesType extends AbstractType
{
/**
Expand Down
3 changes: 3 additions & 0 deletions src/Security/Authorization/Voter/UserAclVoter.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
use Symfony\Component\Security\Acl\Voter\AclVoter;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;

/**
* @final since sonata-project/user-bundle 4.x
*/
class UserAclVoter extends AclVoter
{
public function supportsClass($class)
Expand Down
3 changes: 3 additions & 0 deletions src/Security/EditableRolesBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
use Symfony\Component\Translation\TranslatorInterface;

/**
* @final since sonata-project/user-bundle 4.x
*/
class EditableRolesBuilder
{
/**
Expand Down
3 changes: 3 additions & 0 deletions src/SonataUserBundle.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/user-bundle 4.x
*/
class SonataUserBundle extends Bundle
{
public function build(ContainerBuilder $container): void
Expand Down
2 changes: 2 additions & 0 deletions src/Twig/GlobalVariables.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
* @final since sonata-project/user-bundle 4.x
*
* @author Thomas Rabaix <thomas.rabaix@sonata-project.org>
*/
class GlobalVariables
Expand Down
2 changes: 1 addition & 1 deletion tests/Admin/Document/UserAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace Sonata\UserBundle\Tests\Admin\Document;

use Sonata\UserBundle\Admin\Document\UserAdmin as BaseUserAdmin;
use Sonata\UserBundle\Admin\Model\UserAdmin as BaseUserAdmin;

/**
* @author Anton Dyshkant <vyshkant@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion tests/Admin/Entity/UserAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace Sonata\UserBundle\Tests\Admin\Entity;

use Sonata\UserBundle\Admin\Entity\UserAdmin as BaseUserAdmin;
use Sonata\UserBundle\Admin\Model\UserAdmin as BaseUserAdmin;

/**
* @author Anton Dyshkant <vyshkant@gmail.com>
Expand Down