Skip to content

Commit

Permalink
Migrate to typed properties
Browse files Browse the repository at this point in the history
  • Loading branch information
stof committed Feb 13, 2024
1 parent b76d197 commit f5d3722
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 31 deletions.
4 changes: 2 additions & 2 deletions src/DependencyInjection/StofDoctrineExtensionsExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ class StofDoctrineExtensionsExtension extends Extension
);

/** @var list<string> */
private $entityManagers = array();
private array $entityManagers = array();
/** @var list<string> */
private $documentManagers = array();
private array $documentManagers = array();

/**
* @return void
Expand Down
9 changes: 3 additions & 6 deletions src/EventListener/BlameListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,9 @@
*/
class BlameListener implements EventSubscriberInterface
{
/** @var AuthorizationCheckerInterface|null */
private $authorizationChecker;
/** @var TokenStorageInterface|null */
private $tokenStorage;
/** @var BlameableListener */
private $blameableListener;
private ?AuthorizationCheckerInterface $authorizationChecker;
private ?TokenStorageInterface $tokenStorage;
private BlameableListener $blameableListener;

public function __construct(BlameableListener $blameableListener, TokenStorageInterface $tokenStorage = null, AuthorizationCheckerInterface $authorizationChecker = null)
{
Expand Down
3 changes: 1 addition & 2 deletions src/EventListener/IpTraceListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
*/
final class IpTraceListener implements EventSubscriberInterface
{
/** @var IpTraceableListener */
private $ipTraceableListener;
private IpTraceableListener $ipTraceableListener;

public function __construct(IpTraceableListener $ipTraceableListener)
{
Expand Down
3 changes: 1 addition & 2 deletions src/EventListener/LocaleListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
*/
class LocaleListener implements EventSubscriberInterface
{
/** @var TranslatableListener */
private $translatableListener;
private TranslatableListener $translatableListener;

public function __construct(TranslatableListener $translatableListener)
{
Expand Down
8 changes: 3 additions & 5 deletions src/EventListener/LoggerListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@
*/
class LoggerListener implements EventSubscriberInterface
{
/** @var AuthorizationCheckerInterface|null */
private $authorizationChecker;
/** @var TokenStorageInterface|null */
private $tokenStorage;
private ?AuthorizationCheckerInterface $authorizationChecker;
private ?TokenStorageInterface $tokenStorage;
/** @var LoggableListener<T> */
private $loggableListener;
private LoggableListener $loggableListener;

/**
* @param LoggableListener<T> $loggableListener
Expand Down
9 changes: 3 additions & 6 deletions src/Uploadable/UploadableManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,14 @@

class UploadableManager
{
/** @var \Gedmo\Uploadable\UploadableListener */
private $listener;
private UploadableListener $listener;
/** @var class-string<FileInfoInterface> */
private $fileInfoClass;
private string $fileInfoClass;

/**
* @param UploadableListener $listener
* @param class-string<FileInfoInterface> $fileInfoClass
*/
public function __construct(UploadableListener $listener, $fileInfoClass)
public function __construct(UploadableListener $listener, string $fileInfoClass)
{
$this->listener = $listener;
$this->fileInfoClass = $fileInfoClass;
Expand Down Expand Up @@ -51,5 +49,4 @@ public function getUploadableListener()
{
return $this->listener;
}

}
3 changes: 1 addition & 2 deletions src/Uploadable/UploadedFileInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

class UploadedFileInfo implements FileInfoInterface
{
/** @var UploadedFile */
private $uploadedFile;
private UploadedFile $uploadedFile;

public function __construct(UploadedFile $uploadedFile)
{
Expand Down
8 changes: 2 additions & 6 deletions src/Uploadable/ValidatorConfigurator.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,9 @@
*/
class ValidatorConfigurator
{
/** @var bool */
private $validateWritableDirectory;
private bool $validateWritableDirectory;

/**
* @param bool $validateWritableDirectory
*/
public function __construct($validateWritableDirectory)
public function __construct(bool $validateWritableDirectory)
{
$this->validateWritableDirectory = $validateWritableDirectory;
}
Expand Down

0 comments on commit f5d3722

Please sign in to comment.