Skip to content

Narrow API marking classes as final #165

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

Merged
merged 1 commit into from
Jul 5, 2020
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
3 changes: 3 additions & 0 deletions Command/AutoClosingCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

/**
* @final since hackzilla/ticket-bundle 3.x.
*/
class AutoClosingCommand extends ContainerAwareCommand
{
protected static $defaultName = 'ticket:autoclosing';
Expand Down
3 changes: 3 additions & 0 deletions Command/TicketManagerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

/**
* @final since hackzilla/ticket-bundle 3.x.
*/
class TicketManagerCommand extends ContainerAwareCommand
{
protected static $defaultName = 'ticket:create';
Expand Down
3 changes: 3 additions & 0 deletions Component/TicketFeatures.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

use Hackzilla\Bundle\TicketBundle\Model\TicketFeature\MessageAttachmentInterface;

/**
* @final since hackzilla/ticket-bundle 3.x.
*/
class TicketFeatures
{
private $features;
Expand Down
2 changes: 2 additions & 0 deletions Controller/TicketAttachmentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* Ticket Attachment controller.
*
* Download attachments
*
* @final since hackzilla/ticket-bundle 3.x.
*/
class TicketAttachmentController extends Controller
{
Expand Down
2 changes: 2 additions & 0 deletions Controller/TicketController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

/**
* Ticket controller.
*
* @final since hackzilla/ticket-bundle 3.x.
*/
class TicketController extends Controller
{
Expand Down
3 changes: 3 additions & 0 deletions DependencyInjection/Compiler/DoctrineOrmMappingsPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;

/**
* @final since hackzilla/ticket-bundle 3.x.
*/
class DoctrineOrmMappingsPass extends \Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass
{
public function __construct($driver = null, array $namespaces = [], $managerParameters = [], $enabledParameter = false, array $aliasMap = [])
Expand Down
2 changes: 2 additions & 0 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* 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}
*
* @final since hackzilla/ticket-bundle 3.x.
*/
class Configuration implements ConfigurationInterface
{
Expand Down
2 changes: 2 additions & 0 deletions DependencyInjection/HackzillaTicketExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
* This is the class that loads and manages your bundle configuration.
*
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
*
* @final since hackzilla/ticket-bundle 3.x.
*/
class HackzillaTicketExtension extends Extension
{
Expand Down
3 changes: 3 additions & 0 deletions Event/TicketEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
use Hackzilla\Bundle\TicketBundle\Model\TicketInterface;
use Symfony\Component\EventDispatcher\Event;

/**
* @final since hackzilla/ticket-bundle 3.x.
*/
class TicketEvent extends Event
{
protected $ticket;
Expand Down
2 changes: 2 additions & 0 deletions EventListener/FileSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
* Class FileSubscriber.
*
* Source: https://gist.github.com/hubgit/0cdf96c296f20017fe91#file-filesubscriber-php
*
* @final since hackzilla/ticket-bundle 3.x.
*/
class FileSubscriber implements EventSubscriberInterface
{
Expand Down
3 changes: 3 additions & 0 deletions EventListener/UserLoad.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
use Hackzilla\Bundle\TicketBundle\Model\TicketInterface;
use Hackzilla\Bundle\TicketBundle\Model\TicketMessageInterface;

/**
* @final since hackzilla/ticket-bundle 3.x.
*/
class UserLoad
{
protected $userRepository;
Expand Down
7 changes: 7 additions & 0 deletions Form/DataTransformer/StatusTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
use Hackzilla\Bundle\TicketBundle\Entity\TicketMessage;
use Symfony\Component\Form\DataTransformerInterface;

/**
* @final since hackzilla/ticket-bundle 3.x.
*/
class StatusTransformer implements DataTransformerInterface
{
/**
Expand All @@ -19,6 +22,8 @@ public function transform($number)
if (TicketMessage::STATUS_CLOSED == $number) {
return 1;
}

return null;
}

/**
Expand All @@ -33,5 +38,7 @@ public function reverseTransform($number)
if (1 == $number) {
return TicketMessage::STATUS_CLOSED;
}

return null;
}
}
3 changes: 3 additions & 0 deletions Form/Type/PriorityType.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\OptionsResolver\OptionsResolver;

/**
* @final since hackzilla/ticket-bundle 3.x.
*/
class PriorityType extends AbstractType
{
public function configureOptions(OptionsResolver $resolver)
Expand Down
3 changes: 3 additions & 0 deletions Form/Type/StatusType.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\OptionsResolver\OptionsResolver;

/**
* @final since hackzilla/ticket-bundle 3.x.
*/
class StatusType extends AbstractType
{
public function configureOptions(OptionsResolver $resolver)
Expand Down
3 changes: 3 additions & 0 deletions Form/Type/TicketMessageType.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

/**
* @final since hackzilla/ticket-bundle 3.x.
*/
class TicketMessageType extends AbstractType
{
protected $userManager;
Expand Down
3 changes: 3 additions & 0 deletions Form/Type/TicketType.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

/**
* @final since hackzilla/ticket-bundle 3.x.
*/
class TicketType extends AbstractType
{
protected $ticketClass;
Expand Down
3 changes: 3 additions & 0 deletions Manager/TicketManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
use Hackzilla\Bundle\TicketBundle\TicketRole;
use Symfony\Component\Translation\TranslatorInterface;

/**
* @final since hackzilla/ticket-bundle 3.x.
*/
class TicketManager implements TicketManagerInterface
{
private $translator;
Expand Down
5 changes: 4 additions & 1 deletion Manager/UserManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;

/**
* @final since hackzilla/ticket-bundle 3.x.
*/
class UserManager implements UserManagerInterface
{
/**
Expand Down Expand Up @@ -59,7 +62,7 @@ public function getCurrentUser()
public function getUserById($userId)
{
if (!$userId) {
return;
return null;
}

return $this->userRepository->find($userId);
Expand Down
3 changes: 1 addition & 2 deletions Tests/Component/TicketFeaturesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,10 @@ public function constructProvider()
/**
* @dataProvider featureAttachmentProvider
*
* @param array $features
* @param string $class
* @param bool|null $compare
*/
public function testFeatureAttachment($features, $class, $compare)
public function testFeatureAttachment(array $features, $class, $compare)
{
$obj = new TicketFeatures($features, $class);

Expand Down
3 changes: 3 additions & 0 deletions TicketRole.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

namespace Hackzilla\Bundle\TicketBundle;

/**
* @final since hackzilla/ticket-bundle 3.x.
*/
class TicketRole
{
const ADMIN = 'ROLE_TICKET_ADMIN';
Expand Down
3 changes: 3 additions & 0 deletions TwigExtension/TicketFeatureExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;

/**
* @final since hackzilla/ticket-bundle 3.x.
*/
class TicketFeatureExtension extends AbstractExtension
{
private $ticketFeatures;
Expand Down
3 changes: 3 additions & 0 deletions TwigExtension/TicketGlobalExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
use Twig\Extension\AbstractExtension;
use Twig\Extension\GlobalsInterface;

/**
* @final since hackzilla/ticket-bundle 3.x.
*/
class TicketGlobalExtension extends AbstractExtension implements GlobalsInterface
{
protected $templates = [];
Expand Down