Skip to content

Commit

Permalink
Add native type declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
spaze committed Nov 11, 2024
1 parent 8981c20 commit 55e4124
Show file tree
Hide file tree
Showing 59 changed files with 158 additions and 266 deletions.
12 changes: 4 additions & 8 deletions src/Allowed/Allowed.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,13 @@
class Allowed
{

/** @var Formatter */
private $formatter;
private Formatter $formatter;

/** @var Normalizer */
private $normalizer;
private Normalizer $normalizer;

/** @var AllowedPath */
private $allowedPath;
private AllowedPath $allowedPath;

/** @var TypeStringResolver */
private $typeStringResolver;
private TypeStringResolver $typeStringResolver;


public function __construct(
Expand Down
16 changes: 8 additions & 8 deletions src/Allowed/AllowedConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,28 @@ class AllowedConfig
{

/** @var list<string> */
private $allowIn;
private array $allowIn;

/** @var list<string> */
private $allowExceptIn;
private array $allowExceptIn;

/** @var list<string> */
private $allowInCalls;
private array $allowInCalls;

/** @var list<string> */
private $allowExceptInCalls;
private array $allowExceptInCalls;

/** @var array<int|string, Param> */
private $allowParamsInAllowed;
private array $allowParamsInAllowed;

/** @var array<int|string, Param> */
private $allowParamsAnywhere;
private array $allowParamsAnywhere;

/** @var array<int|string, Param> */
private $allowExceptParamsInAllowed;
private array $allowExceptParamsInAllowed;

/** @var array<int|string, Param> */
private $allowExceptParams;
private array $allowExceptParams;


/**
Expand Down
3 changes: 1 addition & 2 deletions src/Allowed/AllowedPath.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
class AllowedPath
{

/** @var FilePath */
private $filePath;
private FilePath $filePath;


public function __construct(FilePath $filePath)
Expand Down
5 changes: 2 additions & 3 deletions src/Calls/EchoCalls.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@
class EchoCalls implements Rule
{

/** @var DisallowedCallsRuleErrors */
private $disallowedCallsRuleErrors;
private DisallowedCallsRuleErrors $disallowedCallsRuleErrors;

/** @var list<DisallowedCall> */
private $disallowedCalls;
private array $disallowedCalls;


/**
Expand Down
5 changes: 2 additions & 3 deletions src/Calls/EmptyCalls.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@
class EmptyCalls implements Rule
{

/** @var DisallowedCallsRuleErrors */
private $disallowedCallsRuleErrors;
private DisallowedCallsRuleErrors $disallowedCallsRuleErrors;

/** @var list<DisallowedCall> */
private $disallowedCalls;
private array $disallowedCalls;


/**
Expand Down
5 changes: 2 additions & 3 deletions src/Calls/EvalCalls.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@
class EvalCalls implements Rule
{

/** @var DisallowedCallsRuleErrors */
private $disallowedCallsRuleErrors;
private DisallowedCallsRuleErrors $disallowedCallsRuleErrors;

/** @var list<DisallowedCall> */
private $disallowedCalls;
private array $disallowedCalls;


/**
Expand Down
5 changes: 2 additions & 3 deletions src/Calls/ExitDieCalls.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@
class ExitDieCalls implements Rule
{

/** @var DisallowedCallsRuleErrors */
private $disallowedCallsRuleErrors;
private DisallowedCallsRuleErrors $disallowedCallsRuleErrors;

/** @var list<DisallowedCall> */
private $disallowedCalls;
private array $disallowedCalls;


/**
Expand Down
8 changes: 3 additions & 5 deletions src/Calls/FunctionCalls.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,12 @@
class FunctionCalls implements Rule
{

/** @var DisallowedCallsRuleErrors */
private $disallowedCallsRuleErrors;
private DisallowedCallsRuleErrors $disallowedCallsRuleErrors;

/** @var list<DisallowedCall> */
private $disallowedCalls;
private array $disallowedCalls;

/** @var ReflectionProvider */
private $reflectionProvider;
private ReflectionProvider $reflectionProvider;


/**
Expand Down
5 changes: 2 additions & 3 deletions src/Calls/MethodCalls.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@
class MethodCalls implements Rule
{

/** @var DisallowedMethodRuleErrors */
private $disallowedMethodRuleErrors;
private DisallowedMethodRuleErrors $disallowedMethodRuleErrors;

/** @var list<DisallowedCall> */
private $disallowedCalls;
private array $disallowedCalls;


/**
Expand Down
5 changes: 2 additions & 3 deletions src/Calls/NewCalls.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@ class NewCalls implements Rule
{
private const CONSTRUCT = '::__construct';

/** @var DisallowedCallsRuleErrors */
private $disallowedCallsRuleErrors;
private DisallowedCallsRuleErrors $disallowedCallsRuleErrors;

/** @var list<DisallowedCall> */
private $disallowedCalls;
private array $disallowedCalls;


/**
Expand Down
5 changes: 2 additions & 3 deletions src/Calls/PrintCalls.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@
class PrintCalls implements Rule
{

/** @var DisallowedCallsRuleErrors */
private $disallowedCallsRuleErrors;
private DisallowedCallsRuleErrors $disallowedCallsRuleErrors;

/** @var list<DisallowedCall> */
private $disallowedCalls;
private array $disallowedCalls;


/**
Expand Down
5 changes: 2 additions & 3 deletions src/Calls/ShellExecCalls.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@
class ShellExecCalls implements Rule
{

/** @var DisallowedCallsRuleErrors */
private $disallowedCallsRuleErrors;
private DisallowedCallsRuleErrors $disallowedCallsRuleErrors;

/** @var list<DisallowedCall> */
private $disallowedCalls;
private array $disallowedCalls;


/**
Expand Down
5 changes: 2 additions & 3 deletions src/Calls/StaticCalls.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@
class StaticCalls implements Rule
{

/** @var DisallowedMethodRuleErrors */
private $disallowedMethodRuleErrors;
private DisallowedMethodRuleErrors $disallowedMethodRuleErrors;

/** @var list<DisallowedCall> */
private $disallowedCalls;
private array $disallowedCalls;


/**
Expand Down
5 changes: 2 additions & 3 deletions src/ControlStructures/BreakControlStructure.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@
class BreakControlStructure implements Rule
{

/** @var DisallowedControlStructureRuleErrors */
private $disallowedControlStructureRuleErrors;
private DisallowedControlStructureRuleErrors $disallowedControlStructureRuleErrors;

/** @var list<DisallowedControlStructure> */
private $disallowedControlStructures;
private array $disallowedControlStructures;


/**
Expand Down
5 changes: 2 additions & 3 deletions src/ControlStructures/ContinueControlStructure.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@
class ContinueControlStructure implements Rule
{

/** @var DisallowedControlStructureRuleErrors */
private $disallowedControlStructureRuleErrors;
private DisallowedControlStructureRuleErrors $disallowedControlStructureRuleErrors;

/** @var list<DisallowedControlStructure> */
private $disallowedControlStructures;
private array $disallowedControlStructures;


/**
Expand Down
5 changes: 2 additions & 3 deletions src/ControlStructures/DeclareControlStructure.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@
class DeclareControlStructure implements Rule
{

/** @var DisallowedControlStructureRuleErrors */
private $disallowedControlStructureRuleErrors;
private DisallowedControlStructureRuleErrors $disallowedControlStructureRuleErrors;

/** @var list<DisallowedControlStructure> */
private $disallowedControlStructures;
private array $disallowedControlStructures;


/**
Expand Down
5 changes: 2 additions & 3 deletions src/ControlStructures/DoWhileControlStructure.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@
class DoWhileControlStructure implements Rule
{

/** @var DisallowedControlStructureRuleErrors */
private $disallowedControlStructureRuleErrors;
private DisallowedControlStructureRuleErrors $disallowedControlStructureRuleErrors;

/** @var list<DisallowedControlStructure> */
private $disallowedControlStructures;
private array $disallowedControlStructures;


/**
Expand Down
5 changes: 2 additions & 3 deletions src/ControlStructures/ElseControlStructure.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@
class ElseControlStructure implements Rule
{

/** @var DisallowedControlStructureRuleErrors */
private $disallowedControlStructureRuleErrors;
private DisallowedControlStructureRuleErrors $disallowedControlStructureRuleErrors;

/** @var list<DisallowedControlStructure> */
private $disallowedControlStructures;
private array $disallowedControlStructures;


/**
Expand Down
5 changes: 2 additions & 3 deletions src/ControlStructures/ElseIfControlStructure.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@
class ElseIfControlStructure implements Rule
{

/** @var DisallowedControlStructureRuleErrors */
private $disallowedControlStructureRuleErrors;
private DisallowedControlStructureRuleErrors $disallowedControlStructureRuleErrors;

/** @var list<DisallowedControlStructure> */
private $disallowedControlStructures;
private array $disallowedControlStructures;


/**
Expand Down
5 changes: 2 additions & 3 deletions src/ControlStructures/ForControlStructure.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@
class ForControlStructure implements Rule
{

/** @var DisallowedControlStructureRuleErrors */
private $disallowedControlStructureRuleErrors;
private DisallowedControlStructureRuleErrors $disallowedControlStructureRuleErrors;

/** @var list<DisallowedControlStructure> */
private $disallowedControlStructures;
private array $disallowedControlStructures;


/**
Expand Down
5 changes: 2 additions & 3 deletions src/ControlStructures/ForeachControlStructure.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@
class ForeachControlStructure implements Rule
{

/** @var DisallowedControlStructureRuleErrors */
private $disallowedControlStructureRuleErrors;
private DisallowedControlStructureRuleErrors $disallowedControlStructureRuleErrors;

/** @var list<DisallowedControlStructure> */
private $disallowedControlStructures;
private array $disallowedControlStructures;


/**
Expand Down
5 changes: 2 additions & 3 deletions src/ControlStructures/GotoControlStructure.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@
class GotoControlStructure implements Rule
{

/** @var DisallowedControlStructureRuleErrors */
private $disallowedControlStructureRuleErrors;
private DisallowedControlStructureRuleErrors $disallowedControlStructureRuleErrors;

/** @var list<DisallowedControlStructure> */
private $disallowedControlStructures;
private array $disallowedControlStructures;


/**
Expand Down
5 changes: 2 additions & 3 deletions src/ControlStructures/IfControlStructure.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@
class IfControlStructure implements Rule
{

/** @var DisallowedControlStructureRuleErrors */
private $disallowedControlStructureRuleErrors;
private DisallowedControlStructureRuleErrors $disallowedControlStructureRuleErrors;

/** @var list<DisallowedControlStructure> */
private $disallowedControlStructures;
private array $disallowedControlStructures;


/**
Expand Down
5 changes: 2 additions & 3 deletions src/ControlStructures/MatchControlStructure.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@
class MatchControlStructure implements Rule
{

/** @var DisallowedControlStructureRuleErrors */
private $disallowedControlStructureRuleErrors;
private DisallowedControlStructureRuleErrors $disallowedControlStructureRuleErrors;

/** @var list<DisallowedControlStructure> */
private $disallowedControlStructures;
private array $disallowedControlStructures;


/**
Expand Down
5 changes: 2 additions & 3 deletions src/ControlStructures/RequireIncludeControlStructure.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@
class RequireIncludeControlStructure implements Rule
{

/** @var DisallowedControlStructureRuleErrors */
private $disallowedControlStructureRuleErrors;
private DisallowedControlStructureRuleErrors $disallowedControlStructureRuleErrors;

/** @var list<DisallowedControlStructure> */
private $disallowedControlStructures;
private array $disallowedControlStructures;


/**
Expand Down
5 changes: 2 additions & 3 deletions src/ControlStructures/ReturnControlStructure.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@
class ReturnControlStructure implements Rule
{

/** @var DisallowedControlStructureRuleErrors */
private $disallowedControlStructureRuleErrors;
private DisallowedControlStructureRuleErrors $disallowedControlStructureRuleErrors;

/** @var list<DisallowedControlStructure> */
private $disallowedControlStructures;
private array $disallowedControlStructures;


/**
Expand Down
Loading

0 comments on commit 55e4124

Please sign in to comment.