Skip to content

Commit

Permalink
Merge branch 'strict_types' into fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
danog committed Oct 19, 2023
2 parents c24feaa + 2d43c16 commit a243252
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ abstract class FunctionLikeAnalyzer extends SourceAnalyzer
/**
* @var TFunction
*/
protected $function;
protected Closure|Function_|ClassMethod|ArrowFunction $function;

protected Codebase $codebase;

Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Report/ReportOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ final class ReportOptions
/**
* @var Report::TYPE_*
*/
public $format = Report::TYPE_CONSOLE;
public string $format = Report::TYPE_CONSOLE;

public bool $pretty = false;

Expand Down
5 changes: 1 addition & 4 deletions src/Psalm/Storage/Assertion/HasArrayKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@
*/
final class HasArrayKey extends Assertion
{
public $key;

public function __construct(string $key)
public function __construct(public readonly string $key)
{
$this->key = $key;
}

public function getNegation(): Assertion
Expand Down
5 changes: 1 addition & 4 deletions src/Psalm/Storage/Assertion/IsNotCountable.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@
*/
final class IsNotCountable extends Assertion
{
public $is_negatable;

public function __construct(bool $is_negatable)
public function __construct(public readonly bool $is_negatable)
{
$this->is_negatable = $is_negatable;
}

public function isNegation(): bool
Expand Down
5 changes: 1 addition & 4 deletions src/Psalm/Storage/Assertion/NonEmptyCountable.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@
*/
final class NonEmptyCountable extends Assertion
{
public $is_negatable;

public function __construct(bool $is_negatable)
public function __construct(public readonly bool $is_negatable)
{
$this->is_negatable = $is_negatable;
}

public function getNegation(): Assertion
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Storage/PropertyStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ final class PropertyStorage implements HasAttributesInterface
/**
* @var ClassLikeAnalyzer::VISIBILITY_*
*/
public $visibility = ClassLikeAnalyzer::VISIBILITY_PUBLIC;
public int $visibility = ClassLikeAnalyzer::VISIBILITY_PUBLIC;

public ?CodeLocation $location = null;

Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Type/Atomic/TPropertiesOf.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ final class TPropertiesOf extends Atomic
/**
* @var self::VISIBILITY_*|null
*/
public $visibility_filter;
public ?int $visibility_filter;

/**
* @return list<TokenName>
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Type/Atomic/TTemplatePropertiesOf.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ final class TTemplatePropertiesOf extends Atomic
/**
* @var TPropertiesOf::VISIBILITY_*|null
*/
public $visibility_filter;
public ?int $visibility_filter;

/**
* @param TPropertiesOf::VISIBILITY_*|null $visibility_filter
Expand Down

0 comments on commit a243252

Please sign in to comment.