Skip to content
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

Finalize storages #7597

Merged
merged 2 commits into from Feb 6, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
54 changes: 53 additions & 1 deletion UPGRADING.md
Expand Up @@ -507,6 +507,59 @@
- [BC] Class `Psalm\Issue\ParseError` became final
- [BC] Class `Psalm\Issue\PossiblyUndefinedStringArrayOffset` became final
- [BC] Class `Psalm\Issue\ExtensionRequirementViolation` became final
- Storage classes became final:
- [BC] Class `Psalm\Storage\MethodStorage` became final
- [BC] Class `Psalm\Storage\AttributeStorage` became final
- [BC] Class `Psalm\Storage\FileStorage` became final
- [BC] Class `Psalm\Storage\PropertyStorage` became final
- [BC] Class `Psalm\Storage\FunctionStorage` became final
- [BC] Class `Psalm\Storage\Assertion\HasArrayKey` became final
- [BC] Class `Psalm\Storage\Assertion\Truthy` became final
- [BC] Class `Psalm\Storage\Assertion\IsAClass` became final
- [BC] Class `Psalm\Storage\Assertion\HasAtLeastCount` became final
- [BC] Class `Psalm\Storage\Assertion\HasMethod` became final
- [BC] Class `Psalm\Storage\Assertion\HasIntOrStringArrayAccess` became final
- [BC] Class `Psalm\Storage\Assertion\DoesNotHaveMethod` became final
- [BC] Class `Psalm\Storage\Assertion\IsLessThanOrEqualTo` became final
- [BC] Class `Psalm\Storage\Assertion\IsNotAClass` became final
- [BC] Class `Psalm\Storage\Assertion\ArrayKeyDoesNotExist` became final
- [BC] Class `Psalm\Storage\Assertion\IsNotIdentical` became final
- [BC] Class `Psalm\Storage\Assertion\IsClassEqual` became final
- [BC] Class `Psalm\Storage\Assertion\NotNonEmptyCountable` became final
- [BC] Class `Psalm\Storage\Assertion\Any` became final
- [BC] Class `Psalm\Storage\Assertion\IsLooselyEqual` became final
- [BC] Class `Psalm\Storage\Assertion\NonEmpty` became final
- [BC] Class `Psalm\Storage\Assertion\IsGreaterThanOrEqualTo` became final
- [BC] Class `Psalm\Storage\Assertion\HasStringArrayAccess` became final
- [BC] Class `Psalm\Storage\Assertion\IsClassNotEqual` became final
- [BC] Class `Psalm\Storage\Assertion\HasExactCount` became final
- [BC] Class `Psalm\Storage\Assertion\IsNotCountable` became final
- [BC] Class `Psalm\Storage\Assertion\IsIdentical` became final
- [BC] Class `Psalm\Storage\Assertion\IsType` became final
- [BC] Class `Psalm\Storage\Assertion\NotNestedAssertions` became final
- [BC] Class `Psalm\Storage\Assertion\IsGreaterThan` became final
- [BC] Class `Psalm\Storage\Assertion\IsIsset` became final
- [BC] Class `Psalm\Storage\Assertion\Empty_` became final
- [BC] Class `Psalm\Storage\Assertion\IsNotType` became final
- [BC] Class `Psalm\Storage\Assertion\ArrayKeyExists` became final
- [BC] Class `Psalm\Storage\Assertion\DoesNotHaveAtLeastCount` became final
- [BC] Class `Psalm\Storage\Assertion\IsNotIsset` became final
- [BC] Class `Psalm\Storage\Assertion\NonEmptyCountable` became final
- [BC] Class `Psalm\Storage\Assertion\NestedAssertions` became final
- [BC] Class `Psalm\Storage\Assertion\Falsy` became final
- [BC] Class `Psalm\Storage\Assertion\IsNotLooselyEqual` became final
- [BC] Class `Psalm\Storage\Assertion\IsEqualIsset` became final
- [BC] Class `Psalm\Storage\Assertion\IsLessThan` became final
- [BC] Class `Psalm\Storage\Assertion\DoesNotHaveExactCount` became final
- [BC] Class `Psalm\Storage\Assertion\IsCountable` became final
- [BC] Class `Psalm\Storage\Assertion\NotInArray` became final
- [BC] Class `Psalm\Storage\Assertion\InArray` became final
- [BC] Class `Psalm\Storage\FunctionLikeParameter` became final
- [BC] Class `Psalm\Storage\Possibilities` became final
- [BC] Class `Psalm\Storage\ClassConstantStorage` became final
- [BC] Class `Psalm\Storage\ClassLikeStorage` became final
- [BC] Class `Psalm\Storage\AttributeArg` became final
- [BC] Class `Psalm\Storage\EnumCaseStorage` became final

## Removed
- [BC] Property `Psalm\Codebase::$php_major_version` was removed, use
Expand Down Expand Up @@ -564,4 +617,3 @@
- :information_source: migration possible using `Psalm\PluginFileExtensionsSocket`
- [BC] Method `\Psalm\Plugin\EventHandler\Event\AfterFunctionLikeAnalysisEvent::getClasslikeStorage()` was removed,
use correct `\Psalm\Plugin\EventHandler\Event\AfterFunctionLikeAnalysisEvent::getFunctionlikeStorage()` instead

2 changes: 1 addition & 1 deletion src/Psalm/Storage/Assertion/Any.php
Expand Up @@ -4,7 +4,7 @@

use Psalm\Storage\Assertion;

class Any extends Assertion
final class Any extends Assertion
{
/** @psalm-mutation-free */
public function getNegation(): Assertion
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Storage/Assertion/ArrayKeyDoesNotExist.php
Expand Up @@ -4,7 +4,7 @@

use Psalm\Storage\Assertion;

class ArrayKeyDoesNotExist extends Assertion
final class ArrayKeyDoesNotExist extends Assertion
{
/** @psalm-mutation-free */
public function getNegation(): Assertion
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Storage/Assertion/ArrayKeyExists.php
Expand Up @@ -4,7 +4,7 @@

use Psalm\Storage\Assertion;

class ArrayKeyExists extends Assertion
final class ArrayKeyExists extends Assertion
{
/** @psalm-mutation-free */
public function getNegation(): Assertion
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Storage/Assertion/DoesNotHaveAtLeastCount.php
Expand Up @@ -4,7 +4,7 @@

use Psalm\Storage\Assertion;

class DoesNotHaveAtLeastCount extends Assertion
final class DoesNotHaveAtLeastCount extends Assertion
{
/** @var positive-int */
public $count;
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Storage/Assertion/DoesNotHaveExactCount.php
Expand Up @@ -4,7 +4,7 @@

use Psalm\Storage\Assertion;

class DoesNotHaveExactCount extends Assertion
final class DoesNotHaveExactCount extends Assertion
{
/** @var positive-int */
public $count;
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Storage/Assertion/DoesNotHaveMethod.php
Expand Up @@ -4,7 +4,7 @@

use Psalm\Storage\Assertion;

class DoesNotHaveMethod extends Assertion
final class DoesNotHaveMethod extends Assertion
{
public string $method;

Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Storage/Assertion/Empty_.php
Expand Up @@ -4,7 +4,7 @@

use Psalm\Storage\Assertion;

class Empty_ extends Assertion
final class Empty_ extends Assertion
{
/** @psalm-mutation-free */
public function getNegation(): Assertion
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Storage/Assertion/Falsy.php
Expand Up @@ -4,7 +4,7 @@

use Psalm\Storage\Assertion;

class Falsy extends Assertion
final class Falsy extends Assertion
{
/** @psalm-mutation-free */
public function getNegation(): Assertion
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Storage/Assertion/HasArrayKey.php
Expand Up @@ -5,7 +5,7 @@
use Psalm\Storage\Assertion;
use UnexpectedValueException;

class HasArrayKey extends Assertion
final class HasArrayKey extends Assertion
{
public $key;

Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Storage/Assertion/HasAtLeastCount.php
Expand Up @@ -4,7 +4,7 @@

use Psalm\Storage\Assertion;

class HasAtLeastCount extends Assertion
final class HasAtLeastCount extends Assertion
{
/** @var positive-int */
public $count;
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Storage/Assertion/HasExactCount.php
Expand Up @@ -4,7 +4,7 @@

use Psalm\Storage\Assertion;

class HasExactCount extends Assertion
final class HasExactCount extends Assertion
{
/** @var positive-int */
public $count;
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Storage/Assertion/HasIntOrStringArrayAccess.php
Expand Up @@ -5,7 +5,7 @@
use Psalm\Storage\Assertion;
use UnexpectedValueException;

class HasIntOrStringArrayAccess extends Assertion
final class HasIntOrStringArrayAccess extends Assertion
{
/** @psalm-mutation-free */
public function getNegation(): Assertion
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Storage/Assertion/HasMethod.php
Expand Up @@ -4,7 +4,7 @@

use Psalm\Storage\Assertion;

class HasMethod extends Assertion
final class HasMethod extends Assertion
{
public string $method;

Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Storage/Assertion/HasStringArrayAccess.php
Expand Up @@ -5,7 +5,7 @@
use Psalm\Storage\Assertion;
use UnexpectedValueException;

class HasStringArrayAccess extends Assertion
final class HasStringArrayAccess extends Assertion
{
/** @psalm-mutation-free */
public function getNegation(): Assertion
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Storage/Assertion/InArray.php
Expand Up @@ -5,7 +5,7 @@
use Psalm\Storage\Assertion;
use Psalm\Type\Union;

class InArray extends Assertion
final class InArray extends Assertion
{
public Union $type;

Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Storage/Assertion/IsAClass.php
Expand Up @@ -5,7 +5,7 @@
use Psalm\Storage\Assertion;
use Psalm\Type\Atomic;

class IsAClass extends Assertion
final class IsAClass extends Assertion
{
/** @var Atomic\TTemplateParamClass|Atomic\TNamedObject */
public Atomic $type;
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Storage/Assertion/IsClassEqual.php
Expand Up @@ -4,7 +4,7 @@

use Psalm\Storage\Assertion;

class IsClassEqual extends Assertion
final class IsClassEqual extends Assertion
{
public string $type;

Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Storage/Assertion/IsClassNotEqual.php
Expand Up @@ -4,7 +4,7 @@

use Psalm\Storage\Assertion;

class IsClassNotEqual extends Assertion
final class IsClassNotEqual extends Assertion
{
public string $type;

Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Storage/Assertion/IsCountable.php
Expand Up @@ -4,7 +4,7 @@

use Psalm\Storage\Assertion;

class IsCountable extends Assertion
final class IsCountable extends Assertion
{
/** @psalm-mutation-free */
public function getNegation(): Assertion
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Storage/Assertion/IsEqualIsset.php
Expand Up @@ -4,7 +4,7 @@

use Psalm\Storage\Assertion;

class IsEqualIsset extends Assertion
final class IsEqualIsset extends Assertion
{
/** @psalm-mutation-free */
public function getNegation(): Assertion
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Storage/Assertion/IsGreaterThan.php
Expand Up @@ -4,7 +4,7 @@

use Psalm\Storage\Assertion;

class IsGreaterThan extends Assertion
final class IsGreaterThan extends Assertion
{
public int $value;

Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Storage/Assertion/IsGreaterThanOrEqualTo.php
Expand Up @@ -4,7 +4,7 @@

use Psalm\Storage\Assertion;

class IsGreaterThanOrEqualTo extends Assertion
final class IsGreaterThanOrEqualTo extends Assertion
{
public int $value;

Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Storage/Assertion/IsIdentical.php
Expand Up @@ -5,7 +5,7 @@
use Psalm\Storage\Assertion;
use Psalm\Type\Atomic;

class IsIdentical extends Assertion
final class IsIdentical extends Assertion
{
public Atomic $type;

Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Storage/Assertion/IsIsset.php
Expand Up @@ -4,7 +4,7 @@

use Psalm\Storage\Assertion;

class IsIsset extends Assertion
final class IsIsset extends Assertion
{
/** @psalm-mutation-free */
public function getNegation(): Assertion
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Storage/Assertion/IsLessThan.php
Expand Up @@ -4,7 +4,7 @@

use Psalm\Storage\Assertion;

class IsLessThan extends Assertion
final class IsLessThan extends Assertion
{
public int $value;

Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Storage/Assertion/IsLessThanOrEqualTo.php
Expand Up @@ -4,7 +4,7 @@

use Psalm\Storage\Assertion;

class IsLessThanOrEqualTo extends Assertion
final class IsLessThanOrEqualTo extends Assertion
{
public int $value;

Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Storage/Assertion/IsLooselyEqual.php
Expand Up @@ -5,7 +5,7 @@
use Psalm\Storage\Assertion;
use Psalm\Type\Atomic;

class IsLooselyEqual extends Assertion
final class IsLooselyEqual extends Assertion
{
public Atomic $type;

Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Storage/Assertion/IsNotAClass.php
Expand Up @@ -5,7 +5,7 @@
use Psalm\Storage\Assertion;
use Psalm\Type\Atomic;

class IsNotAClass extends Assertion
final class IsNotAClass extends Assertion
{
/** @var Atomic\TTemplateParamClass|Atomic\TNamedObject */
public Atomic $type;
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Storage/Assertion/IsNotCountable.php
Expand Up @@ -4,7 +4,7 @@

use Psalm\Storage\Assertion;

class IsNotCountable extends Assertion
final class IsNotCountable extends Assertion
{
public $is_negatable;

Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Storage/Assertion/IsNotIdentical.php
Expand Up @@ -5,7 +5,7 @@
use Psalm\Storage\Assertion;
use Psalm\Type\Atomic;

class IsNotIdentical extends Assertion
final class IsNotIdentical extends Assertion
{
public Atomic $type;

Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Storage/Assertion/IsNotIsset.php
Expand Up @@ -4,7 +4,7 @@

use Psalm\Storage\Assertion;

class IsNotIsset extends Assertion
final class IsNotIsset extends Assertion
{
/** @psalm-mutation-free */
public function getNegation(): Assertion
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Storage/Assertion/IsNotLooselyEqual.php
Expand Up @@ -5,7 +5,7 @@
use Psalm\Storage\Assertion;
use Psalm\Type\Atomic;

class IsNotLooselyEqual extends Assertion
final class IsNotLooselyEqual extends Assertion
{
public Atomic $type;

Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Storage/Assertion/IsNotType.php
Expand Up @@ -5,7 +5,7 @@
use Psalm\Storage\Assertion;
use Psalm\Type\Atomic;

class IsNotType extends Assertion
final class IsNotType extends Assertion
{
public Atomic $type;

Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Storage/Assertion/IsType.php
Expand Up @@ -5,7 +5,7 @@
use Psalm\Storage\Assertion;
use Psalm\Type\Atomic;

class IsType extends Assertion
final class IsType extends Assertion
{
public Atomic $type;

Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Storage/Assertion/NestedAssertions.php
Expand Up @@ -8,7 +8,7 @@

use const JSON_THROW_ON_ERROR;

class NestedAssertions extends Assertion
final class NestedAssertions extends Assertion
{
/** @var array<string, list<list<Assertion>>> */
public array $assertions;
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Storage/Assertion/NonEmpty.php
Expand Up @@ -4,7 +4,7 @@

use Psalm\Storage\Assertion;

class NonEmpty extends Assertion
final class NonEmpty extends Assertion
{
/** @psalm-mutation-free */
public function getNegation(): Assertion
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Storage/Assertion/NonEmptyCountable.php
Expand Up @@ -4,7 +4,7 @@

use Psalm\Storage\Assertion;

class NonEmptyCountable extends Assertion
final class NonEmptyCountable extends Assertion
{
public $is_negatable;

Expand Down