Skip to content

Commit

Permalink
src/
Browse files Browse the repository at this point in the history
  • Loading branch information
keradus committed Dec 18, 2024
1 parent 2a42107 commit 30dd2c2
Show file tree
Hide file tree
Showing 31 changed files with 68 additions and 204 deletions.
5 changes: 1 addition & 4 deletions src/AbstractFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@
*/
abstract class AbstractFixer implements FixerInterface
{
/**
* @var WhitespacesFixerConfig
*/
protected $whitespacesConfig;
protected WhitespacesFixerConfig $whitespacesConfig;

public function __construct()
{
Expand Down
5 changes: 1 addition & 4 deletions src/AbstractFunctionReferenceFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@
*/
abstract class AbstractFunctionReferenceFixer extends AbstractFixer
{
/**
* @var null|FunctionsAnalyzer
*/
private $functionsAnalyzer;
private ?FunctionsAnalyzer $functionsAnalyzer = null;

public function isCandidate(Tokens $tokens): bool
{
Expand Down
5 changes: 1 addition & 4 deletions src/Cache/FileCacheManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@ final class FileCacheManager implements CacheManagerInterface

private bool $signatureWasUpdated = false;

/**
* @var CacheInterface
*/
private $cache;
private CacheInterface $cache;

public function __construct(
FileHandlerInterface $handler,
Expand Down
5 changes: 1 addition & 4 deletions src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,7 @@ class Config implements ConfigInterface, ParallelAwareConfigInterface

private ParallelConfig $parallelConfig;

/**
* @var null|string
*/
private $phpExecutable;
private ?string $phpExecutable = null;

/**
* @TODO: 4.0 - update to @PER
Expand Down
4 changes: 2 additions & 2 deletions src/Console/Command/DescribeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ final class DescribeCommand extends Command
/**
* @var ?list<string>
*/
private $setNames;
private ?array $setNames = null;

private FixerFactory $fixerFactory;

/**
* @var null|array<string, FixerInterface>
*/
private $fixers;
private ?array $fixers = null;

public function __construct(?FixerFactory $fixerFactory = null)
{
Expand Down
77 changes: 16 additions & 61 deletions src/Console/ConfigurationResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,49 +62,28 @@ final class ConfigurationResolver
public const PATH_MODE_OVERRIDE = 'override';
public const PATH_MODE_INTERSECTION = 'intersection';

/**
* @var null|bool
*/
private $allowRisky;
private ?bool $allowRisky = null;

/**
* @var null|ConfigInterface
*/
private $config;
private ?ConfigInterface $config = null;

/**
* @var null|string
*/
private $configFile;
private ?string $configFile = null;

private string $cwd;

private ConfigInterface $defaultConfig;

/**
* @var null|ReporterInterface
*/
private $reporter;
private ?ReporterInterface $reporter = null;

/**
* @var null|bool
*/
private $isStdIn;
private ?bool $isStdIn = null;

/**
* @var null|bool
*/
private $isDryRun;
private ?bool $isDryRun = null;

/**
* @var null|list<FixerInterface>
*/
private $fixers;
private ?array $fixers = null;

/**
* @var null|bool
*/
private $configFinderIsOverridden;
private ?bool $configFinderIsOverridden = null;

private ToolInfoInterface $toolInfo;

Expand All @@ -128,25 +107,13 @@ final class ConfigurationResolver
'verbosity' => null,
];

/**
* @var null|string
*/
private $cacheFile;
private ?string $cacheFile = null;

/**
* @var null|CacheManagerInterface
*/
private $cacheManager;
private ?CacheManagerInterface $cacheManager = null;

/**
* @var null|DifferInterface
*/
private $differ;
private ?DifferInterface $differ = null;

/**
* @var null|Directory
*/
private $directory;
private ?Directory $directory = null;

/**
* @var null|iterable<\SplFileInfo>
Expand All @@ -155,10 +122,7 @@ final class ConfigurationResolver

private ?string $format = null;

/**
* @var null|Linter
*/
private $linter;
private ?Linter $linter = null;

/**
* @var null|list<string>
Expand All @@ -170,20 +134,11 @@ final class ConfigurationResolver
*/
private $progress;

/**
* @var null|RuleSet
*/
private $ruleSet;
private ?RuleSet $ruleSet = null;

/**
* @var null|bool
*/
private $usingCache;
private ?bool $usingCache = null;

/**
* @var null|FixerFactory
*/
private $fixerFactory;
private ?FixerFactory $fixerFactory = null;

/**
* @param array<string, mixed> $options
Expand Down
5 changes: 1 addition & 4 deletions src/Console/Output/ErrorOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ final class ErrorOutput
{
private OutputInterface $output;

/**
* @var bool
*/
private $isDecorated;
private bool $isDecorated;

public function __construct(OutputInterface $output)
{
Expand Down
5 changes: 1 addition & 4 deletions src/Console/Output/Progress/DotsOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@ final class DotsOutput implements ProgressOutputInterface

private int $processedFiles = 0;

/**
* @var int
*/
private $symbolsPerLine;
private int $symbolsPerLine;

public function __construct(OutputContext $context)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Console/SelfUpdate/NewVersionChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ final class NewVersionChecker implements NewVersionCheckerInterface
/**
* @var null|list<string>
*/
private $availableVersions;
private ?array $availableVersions = null;

public function __construct(GithubClientInterface $githubClient)
{
Expand Down
23 changes: 6 additions & 17 deletions src/DocBlock/Annotation.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,43 +52,32 @@ final class Annotation

/**
* The position of the first line of the annotation in the docblock.
*
* @var int
*/
private $start;
private int $start;

/**
* The position of the last line of the annotation in the docblock.
*
* @var int
*/
private $end;
private int $end;

/**
* The associated tag.
*
* @var null|Tag
*/
private $tag;
private ?Tag $tag = null;

/**
* Lazy loaded, cached types content.
*
* @var null|string
*/
private $typesContent;
private ?string $typesContent = null;

/**
* The cached types.
*
* @var null|list<string>
*/
private $types;
private ?array $types = null;

/**
* @var null|NamespaceAnalysis
*/
private $namespace;
private ?NamespaceAnalysis $namespace = null;

/**
* @var list<NamespaceUseAnalysis>
Expand Down
5 changes: 1 addition & 4 deletions src/FileReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@
*/
final class FileReader
{
/**
* @var null|string
*/
private $stdinContent;
private ?string $stdinContent = null;

public static function createSingleton(): self
{
Expand Down
10 changes: 2 additions & 8 deletions src/Fixer/Basic/BracesFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,9 @@ final class BracesFixer extends AbstractProxyFixer implements ConfigurableFixerI
*/
public const LINE_SAME = 'same';

/**
* @var null|BracesPositionFixer
*/
private $bracesPositionFixer;
private ?BracesPositionFixer $bracesPositionFixer = null;

/**
* @var null|ControlStructureContinuationPositionFixer
*/
private $controlStructureContinuationPositionFixer;
private ?ControlStructureContinuationPositionFixer $controlStructureContinuationPositionFixer = null;

public function getDefinition(): FixerDefinitionInterface
{
Expand Down
10 changes: 2 additions & 8 deletions src/Fixer/Comment/SingleLineCommentStyleFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,9 @@ final class SingleLineCommentStyleFixer extends AbstractFixer implements Configu
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
use ConfigurableFixerTrait;

/**
* @var bool
*/
private $asteriskEnabled;
private bool $asteriskEnabled;

/**
* @var bool
*/
private $hashEnabled;
private bool $hashEnabled;

public function getDefinition(): FixerDefinitionInterface
{
Expand Down
7 changes: 2 additions & 5 deletions src/Fixer/ConfigurableFixerTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,9 @@ trait ConfigurableFixerTrait
/**
* @var null|TFixerComputedConfig
*/
protected $configuration;
protected ?array $configuration = null;

/**
* @var null|FixerConfigurationResolverInterface
*/
private $configurationDefinition;
private ?FixerConfigurationResolverInterface $configurationDefinition = null;

/**
* @param TFixerInputConfig $configuration
Expand Down
6 changes: 3 additions & 3 deletions src/Fixer/ControlStructure/YodaStyleFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@ final class YodaStyleFixer extends AbstractFixer implements ConfigurableFixerInt
/**
* @var array<int|string, Token>
*/
private $candidatesMap;
private array $candidatesMap;

/**
* @var array<int|string, null|bool>
*/
private $candidateTypesConfiguration;
private array $candidateTypesConfiguration;

/**
* @var list<int|string>
*/
private $candidateTypes;
private array $candidateTypes;

public function getDefinition(): FixerDefinitionInterface
{
Expand Down
15 changes: 3 additions & 12 deletions src/Fixer/FunctionNotation/LambdaNotUsedImportFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,11 @@

final class LambdaNotUsedImportFixer extends AbstractFixer
{
/**
* @var ArgumentsAnalyzer
*/
private $argumentsAnalyzer;
private ArgumentsAnalyzer $argumentsAnalyzer;

/**
* @var FunctionsAnalyzer
*/
private $functionAnalyzer;
private FunctionsAnalyzer $functionAnalyzer;

/**
* @var TokensAnalyzer
*/
private $tokensAnalyzer;
private TokensAnalyzer $tokensAnalyzer;

public function getDefinition(): FixerDefinitionInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Fixer/LanguageConstruct/FunctionToConstantFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ final class FunctionToConstantFixer extends AbstractFixer implements Configurabl
/**
* @var null|array<string, list<Token>>
*/
private static $availableFunctions;
private static ?array $availableFunctions = null;

/**
* @var array<string, list<Token>>
Expand Down
Loading

0 comments on commit 30dd2c2

Please sign in to comment.