Skip to content
Permalink
Browse files

Change @immutable to @psalm-immutable

  • Loading branch information...
muglug committed Aug 31, 2019
1 parent 5fa0605 commit dcc4de59df1e69c2eb219b9279ec6ead43ac6437
@@ -151,7 +151,7 @@ public static function parse($docblock, $line_number = null, $preserve_format =
'generator-return', 'ignore-falsable-return', 'variadic', 'pure',
'ignore-variable-method', 'ignore-variable-property', 'internal',
'taint-sink', 'taint-source', 'assert-untainted', 'scope-this',
'mutation-free', 'external-mutation-free',
'mutation-free', 'external-mutation-free', 'immutable',
],
true
)) {
@@ -274,7 +274,7 @@ public static function parsePreservingLength(\PhpParser\Comment\Doc $docblock)
'generator-return', 'ignore-falsable-return', 'variadic', 'pure',
'ignore-variable-method', 'ignore-variable-property', 'internal',
'taint-sink', 'taint-source', 'assert-untainted', 'scope-this',
'mutation-free', 'external-mutation-free',
'mutation-free', 'external-mutation-free', 'immutable',
],
true
)) {
@@ -864,7 +864,7 @@ public static function extractClassLikeDocblockInfo(
$info->sealed_methods = true;
}
if (isset($parsed_docblock['specials']['immutable'])
if (isset($parsed_docblock['specials']['psalm-immutable'])
|| isset($parsed_docblock['specials']['psalm-mutation-free'])
) {
$info->mutation_free = true;
@@ -17,7 +17,7 @@ public function providerValidCodeParse()
'immutableClassGenerating' => [
'<?php
/**
* @immutable
* @psalm-immutable
*/
class A {
/** @var int */
@@ -39,7 +39,7 @@ public function setA(int $a) : self {
'callInternalClassMethod' => [
'<?php
/**
* @immutable
* @psalm-immutable
*/
class A {
/** @var string */
@@ -70,7 +70,7 @@ public function providerInvalidCodeParse()
'immutablePropertyAssignmentInternally' => [
'<?php
/**
* @immutable
* @psalm-immutable
*/
class A {
/** @var int */
@@ -93,7 +93,7 @@ public function setA(int $a): void {
'immutablePropertyAssignmentExternally' => [
'<?php
/**
* @immutable
* @psalm-immutable
*/
class A {
/** @var int */
@@ -116,7 +116,7 @@ public function __construct(int $a, string $b) {
'callImpureFunction' => [
'<?php
/**
* @immutable
* @psalm-immutable
*/
class A {
/** @var int */
@@ -139,7 +139,7 @@ public function bar() : void {
'callExternalClassMethod' => [
'<?php
/**
* @immutable
* @psalm-immutable
*/
class A {
/** @var string */
@@ -101,7 +101,7 @@ function makesACounter(int $i) : Counter {
],
'canCreateImmutableObject' => [
'<?php
/** @immutable */
/** @psalm-immutable */
class A {
private string $s;

0 comments on commit dcc4de5

Please sign in to comment.
You can’t perform that action at this time.