chore(deps): update dependency phpstan/phpstan to v0.12.100 #2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "renovate/phpstan-packages"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
0.12.29
->0.12.100
Release Notes
phpstan/phpstan (phpstan/phpstan)
v0.12.100
Compare Source
Message from the future
⚠️ You're running a really old version of PHPStan.️
The last release in the 0.12.x series with new features
and bugfixes was released on September 12th 2021,
that's 415 days ago.
Since then more than 67 new PHPStan versions were released
with hundreds of new features, bugfixes, and other
quality of life improvements.
To learn about what you're missing out on, check out
this blog with articles about the latest major releases:
https://phpstan.org/blog
Upgrade today to PHPStan 1.8 or newer by using
"phpstan/phpstan": "^1.8"
in yourcomposer.json
.v0.12.99
Compare Source
Improvements 🔧
CompoundTypeHelper
is deprecated (fff85f3c08
)phpstorm-stubs
(6fa12857c8
)Bleeding edge 🔪
empty()
rule (601460ccec
)MissingReturnRule
- make the error non-ignorable for native typehints (9ecefd56d8
)array_map()
andarray_filter()
calls, #5609, #5356, #1954IssetRule
everything whatVariableCertaintyInIssetRule
does (9689fbd0ed
), #970CatchWithUnthrownExceptionRule
everything whatDeadCatchRule
does (165504cf9c
)@throws void
does not have an explicit throw point (8b3382acea
)If you want to see the shape of things to come and adopt bleeding edge features early, you can include this config file in your project's
phpstan.neon
:Of course, there are no backwards compatibility guarantees when you include this file. The behaviour and reported errors can change in minor versions with this file included. Learn more
Bugfixes 🐛
checkExplicitMixed
- replace mixed type recursively (b4f81dbd77
), #5218checkExplicitMixed
withTemplateMixedType
(6ba9ef29cb
), #3566BaselineNeonErrorFormatter
: Sort errors by normalized relative path (#536), #5085, thanks @dktapps!7ddfa174a6
), #3283109bf999b8
), #5615, #5428, #2191StubSourceLocatorFactory
- always use PHP 8 parser for PhpStorm stubs (731ce1dd8d
)IntegerRangeType
(#669), thanks @staabm!array_map
- understand call with multiple arrays (3e0ecec8fc
), #5039range()
ofnumeric-string
s can produce array of float|int (3b6f0bf739
)Function signature fixes 🤖
Grpc\ChannelCredentials::createSsl
(#665), thanks @howyi!SimpleXMLElement
stub more specific (#666), thanks @devbanana!v0.12.98
Compare Source
Allow dynamic list of stub files thanks to StubFilesExtension (
2ba9332d29
), https://github.com/phpstan/phpstan-symfony/issues/195v0.12.97
Compare Source
Improvements 🔧
literal-string
PHPDoc type inspired byis_literal()
RFC (https://wiki.php.net/rfc/is_literal), #5507bool
as template type bound (9d191f9abb
)float
as template type bound (4e7d6c155c
), #5331ReflectionAttribute
generic (#640, #643), thanks @vhenzl!non-empty-array
type in[] != $arr
conditions (#649), thanks @staabm!5a44c297ad
), #5500a6ca5f7a7e
), #5527a82605fbb8
)Bugfixes 🐛
89ceb6a979
), #54973b17c0e1d5
)self::CONSTANT
can be precise even with PHPDoc type (5010ef4594
), #55179a9f193804
)Text.php
ofnl_BE
from Faker (a09a98d251
), #5525?parent
in return type (30c9b01fd1
), #552903d8312e3e
)__callStatic()
in the class (114a38f87a
), #5536sizeof()
as alias ofcount()
for Smaller/SmallerOrEqual (#647, #648), #4843, thanks @staabm!a6a23dcaf6
), #1870TemplateUnionType
((1b5710a3aa
), #5562Function signature fixes 🤖
8db058a52c
), #5513non-empty-array
(#633), thanks @staabm!sodium_base642bin()
is optional. (#644), thanks @tehbeard!filter_var()
returnnon-empty-string
if input is non-empty (#642), thanks @devbanana!iterator_count()
/iterator_apply()
(#646), thanks @staabm!array_count_values()
(#645), thanks @staabm!filter_var()
should return non empty string only when it will not be sanitized (#650), thanks @devbanana!parse_url
signature with PHP 8 (f7c6464067
)v0.12.96
Compare Source
24f6264bac
), #5494PHP_WINDOWS_*
constants todynamicConstantNames
(9762d371eb
)v0.12.95
Compare Source
Improvements 🔧
@var
above class constants (b932769213
), #4361, #3530TypeCombinator::CONSTANT_SCALAR_UNION_THRESHOLD
(c56d866e63
), #5447, #5454, #4925, #4793, #5062, #3366, #3555TypeCombinator::union()
- new optimization for constant scalar types (da9e0613b8
)6be077e92d
)502596f1a1
)PhpPropertyReflection::hasPhpDoc()
(d78d60a286
)Bleeding edge 🔪
780a54cd01
)89acb0db44
)0f4885aa10
), #4281static::
(bad2607a03
)static::
(d8e89538ac
)static::
(270326a1ed
)If you want to see the shape of things to come and adopt bleeding edge features early, you can include this config file in your project's
phpstan.neon
:Of course, there are no backwards compatibility guarantees when you include this file. The behaviour and reported errors can change in minor versions with this file included. Learn more
Bugfixes 🐛
cdf9cb5012
), https://github.com/phpstan/phpstan/discussions/5392DateTime|DateTimeInterface
union acceptsDateTimeInterface
(#586), thanks @VincentLanglet!parallel.processTimeout
10x bigger (abb4378d63
), #53412f1615bdfd
)ZEND_
dynamic constants (#613), thanks @dktapps!PDOStatement
implementsIteratorAggregate
on PHP 8 (dec054d330
), #5436non-empty-string
(6a33de94e4
), #5372aa9e2e8f49
)non-empty-string
array key type (7172e5fc42
), #5372TemplateTypeMap::isEmpty()
(f7250dbe9b
)4cb02d15c3
), #295929fcf80e16
)Function signature fixes 🤖
chr()
(#599), thanks @AIlkiv!imagejpeg
GD function (#619), thanks @mauriciofauth!openssl_seal()
$iv
parameter (#624), thanks @jlherren!pg_field_name
prototype (#626), thanks @thierry-f-78!Phar
/PharData::extractTo
type information (#628), thanks @Seldaek!abs()
return-type (#629), thanks @staabm!str_split()
length parameter is always positive (#631), thanks @staabm!non-empty-array
frommb_str_split
/str_split
(#632), thanks @staabm!non-empty-string
in more string fuctions (#606), #5350, thanks @staabm!rand()
dynamic return type extension (#606), thanks @staabm!WeakMap
(#623), thanks @dktapps!#[ReturnTypeWillChange]
stub (#618), thanks @zonuexe!non-empty-array
inarray_map()
(#601), thanks @Lctrs!mb_substitute_character
(#607), thanks @TRowbotham!strlen
: cover more scalar types (#630), thanks @staabm!min()
/max()
for two arguments (#627), #5072, thanks @staabm!array_fill()
: handle negative cases, support integer ranges andnon-empty-array
(#603), thanks @staabm!v0.12.94
Compare Source
Improvements 🔧
non-empty-array
inarray_flip
(#583), thanks @staabm!nikic/php-parser
to 4.12.0 (dca48f34bc
)1501229bb6
)d88b568cae
)readonly
property (PHP 8.1) (c19506b58e
)final
class constant (PHP 8.1) (092d8e3bbf
)48ec184015
)checkDependenciesOfProjectExtensionFiles
(#595), #5296, thanks @janedbal!91fde71dc6
)Bleeding edge 🔪
@final
classes (dffd2c2351
), https://github.com/phpstan/phpstan/discussions/5343If you want to see the shape of things to come and adopt bleeding edge features early, you can include this config file in your project's
phpstan.neon
:Of course, there are no backwards compatibility guarantees when you include this file. The behaviour and reported errors can change in minor versions with this file included. Learn more
Bugfixes 🐛
Memcache::get()
andMemcachePool::get()
(c5f9d2400e
)@throws void
(da3790efa9
), #5364rules
in config.neon
file (#594), thanks @janedbal!Function signature fixes 🤖
SplFixedArray
(#588), thanks @dktapps!proc_open()
acceptslist<string>
for$command
in 7.4+ (#590), thanks @dktapps!v0.12.93
Compare Source
Improvements 🔧
non-empty-string
:implode()
fornon-empty-string
return type (520ae229d5
), #5291non-empty-string
(1283db7ae4
), #5301non-empty-string
inarray_map
closure (b864a95b46
), #5293non-empty-string
when given one (4a9e0695fc
)str_pad()
function return type extension (84503ce886
), #5307str_repeat()
function return type extension (57d765f672
), #5307htmlentities()
(#574) (#574), thanks @staabm!substr
(#577), thanks @staabm!DateTimeImmutable
removed fromDateTimeInterface
results inDateTime
(5eb96f55b7
), #5259non-empty-array
inarray_combine
(#578), thanks @staabm!non-empty-array
inarray_merge
(#581), thanks @staabm!FileHelper
methods with BC promise (4f9488eb2e
), #5306Bugfixes 🐛
array_walk
also understandsobject
(#573), thanks @niconoe-!8fd9667c73
), #5231f5e88ae06e
), #52994220e431da
), #5129, #49703166ba31a8
), #5328, #5322Function signature fixes 🤖
next()
dynamic return type extension also valid forprev()
(2fd7bfec45
object
(a056d34916
)Memcached::deleteMulti
(#582), thanks @paulbalandan!v0.12.92
Compare Source
Improvements 🔧
non-empty-string
type (6ef5e91eff
), #4711, #3981checkPhpDocMissingReturn: false
more strict (2656081176
)nikic/php-parser
to work on PHP 8.1 again (0f8ead706b
), #5263Bleeding edge 🔪
c98d0a4946
)284af50d76
), #5222If you want to see the shape of things to come and adopt bleeding edge features early, you can include this config file in your project's
phpstan.neon
:Of course, there are no backwards compatibility guarantees when you include this file. The behaviour and reported errors can change in minor versions with this file included. Learn more
Bugfixes 🐛
!empty()
leads tonon-empty-string
(790a838494
), #5258ClassReflection::getInterfaces()
(cd02bf86a6
), #4854Function signature fixes 🤖
explode()
always returnsnon-empty-array
(25260db5d6
)sscanf()
signature (#567), thanks @fluffycondor!v0.12.91
Compare Source
Improvements 🔧
8fdc2d3fa8
), #4902, #3660, #4083, #4681php.ini
in child workers (#559), thanks @yangchaobj!strval()
dynamic return type extension (#568), thanks @jlherren!intval()
,boolval()
,floatval()
(#570), #4848, #5162, thanks @jlherren!next()
dynamic return type extension (599f59bbc6
), #5253nikic/php-parser
to 4.11.0 (e42ae89604
)Bugfixes 🐛
427b73d310
), #5219, #4829, #4844object
forReflectionClass
andReflectionMethod
constructor throw types (#566), #5195, thanks @VincentLanglet!!empty
(#569), #3784, #3700, #3297, thanks @ArtemGoutsoul!v0.12.90
Compare Source
Improvements 🔧
d36852a25b
), #5159getTraits()
recursive (#557), thanks @IAmRGroot!dce3c85e5e
)Bleeding edge 🔪
If you want to see the shape of things to come and adopt bleeding edge features early, you can include this config file in your project's
phpstan.neon
:Of course, there are no backwards compatibility guarantees when you include this file. The behaviour and reported errors can change in minor versions with this file included. Learn more
Bugfixes 🐛
b902c38565
), #51577acf7ca6e4
), #5161never
return type in PHPDoc wins over native type (2c976fb167
), #5089ClosureType
typeOnly description is justClosure
(476520d6c3
), #5164BenevolentUnionType
(2abb92e258
), #5169efa6aa6053
,01f99c18c5
), #3158Function signature fixes 🤖
null
forfile_put_contents()
$context
argument (#558), thanks @steevanb!v0.12.89
Compare Source
Improvements 🔧
ExceptionTypeResolver
as an interface allowing for custom implementations (a125304a79
,dec03af364
), #5044RecursiveArrayIterator
(8c33955c14
)93806cb5d6
)de00c86689
)Bleeding edge 🔪
8a05e0de75
)2f456b91bb
), #5148003d235cc5
), #37231de5de80ec
), #3753int|string
(724c8bad2e
), #37539070c5bce3
)If you want to see the shape of things to come and adopt bleeding edge features early, you can include this config file in your project's
phpstan.neon
:Of course, there are no backwards compatibility guarantees when you include this file. The behaviour and reported errors can change in minor versions with this file included. Learn more
Bugfixes 🐛
bb841d20fe
), #5030TARGET_PROPERTY
attributes on promoted properties (#528), #4418, thanks @dbrekelmans!IntegerRangeType
(d23b4b75a6
)30ec3a0738
), #5056d53a9a111b
), #5056838d1e45ea
), #5095, #4967, #37486eaf6c2d77
)688a87f703
), #514333c9bdc712
), #515357e3cbf90e
)Function signature fixes 🤖
implode()
with named arguments (18f8473fa5
), #5018intdiv()
throw extension (#527), thanks @VincentLanglet!SimpleXMLElement
constructor throw type extension (#532), thanks @VincentLanglet!e1efa03d7d
), #5049uopz_set_hook
fixes (4effc89cbb
)gmp_div
,odbc_exec
andunregister_tick_function
(#533), thanks @danielmarschall!phpstorm-stubs
(bba66317f1
)fcb5c12882
,1aa9af89b5
,63f40f1410
,10a833fa90
), #5137stream_bucket_make_writeable
(#537), thanks @bytestream!toPHP
optional (#543), thanks @franmomu!SplFileObject::fgetcsv()
(#479), thanks @VincentLanglet!mysqli_get_client_version()
(#545), thanks @johnbillion!number_format
(#553), thanks @BackEndTea!v0.12.88
Compare Source
Improvements 🔧
349b3b301b
), #4996editorUrl
to add clickable file URLs to output (#515), thanks @ThomasLandauer!Bugfixes 🐛
proc_open
function is disabled (#514), thanks @mvorisek!excludePaths
in the same config hierarchy (e7ac788e0e
), #4561\
is valid class name (428baf5f91
), #5002is_array()
false positive (187921e352
), #4999TemplateUnionType
as part of intersection (4a45db5947
), #5000*
ignore path whenopen_basedir
is set (#519), thanks @mvorisek!Function signature fixes 🤖
number_format()
with named arguments (#524), thanks @matyx!DateInterval
extension (#520), thanks @VincentLanglet!v0.12.87
Compare Source
Major new feature 🚀
New exceptions-related rules
@throws
@throws
that aren't actually thrownRead this article for more details »
Improvements 🔧
composer/xdebug-handler
(0b6b602601
)Bugfixes 🐛
b2bf7030d9
), #4982, #4761, #3331, #3446, #2640, #2413, #3106throw
expression throw point (1e4f2e12e1
)7306405736
)eeb08ba012
)00ff86b2ea
), https://github.com/phpstan/phpstan/discussions/4985Function signature fixes 🤖
getopt()
return type (94b6c03ba3
), #4987, thanks @dktapps!v0.12.86
Compare Source
Improvements 🔧
@throws
support (48bfa70312
)4ee1fa1df8
)Bugfixes 🐛
new ReflectionClass()
can throwReflectionException
(00d3ef418f
)179b2131de
)DateTime
andDateTimeImmutable
constructor does not always throw Exception (181f75ce89
)56566eb9a9
), #4953Function signature fixes 🤖
wincache_ucache_inc
andwincache_ucache_dec
(671f404140
), #4952Redis::scan()
signature (8fe9e606b5
), #4929IntlDateFormatter::parse
can define variable by reference (#509), thanks @francescolaffi!v0.12.85
Compare Source
Improvements 🔧
3af8630723
), documentation: https://phpstan.org/developing-extensions/testing2bf30bff0b
), #4814, #4819, documentation: https://phpstan.org/developing-extensions/dynamic-throw-type-extensions008f32479b
), https://github.com/phpstan/phpstan-symfony/pull/148Bugfixes 🐛
===
and!==
type inference withtreatPhpDocTypesAsCertain: false
(#476), thanks @ruudk!b48fd77987
), #4821yield
has implicit throw point (033aeffa4b
), #486309d34887f8
), #483854a204ee29
), #4820, #4879f6107ad8ff
), #4822, #262is_dir()
and similar function values for nonexistent files (1eaef0463d
), #4816662240117e
), #4757, #4690Function signature fixes 🤖
date_create_from_format
anddate_create_immutable_from_format
(#502), thanks @pascalheidmann!v0.12.84
Compare Source
Major new feature 🚀
Local type aliases
Thanks to @jiripudil and his PR https://github.com/phpstan/phpstan-src/pull/460, you can now enjoy
@phpstan-type
and@phpstan-import-type
in class-level PHPDoc. See the documentation for more details.Improvements 🔧
AlwaysUsedClassConstantsExtension
interface (#495), #4859, thanks @jdecool!2cd7a03473
)Bugfixes 🐛
unlink()
also clears stat cache (63d06709e4
), #47973e5621ea54
), #4800Closure::bind()
(566b44b1c7
), #4808new $expr()
(8463afd91e
), #4806$expr::foo()
(8c7cf85904
), #4805require
/require_once
for #4836 via a fake read (#491), thanks @rrazor!3be90f0591
), #4803fb62e5ec90
)7c0146cf80
), #4815Function signature fixes 🤖
rediscluster
inspections (#493), thanks @sudo-plz!array_sum
return type (#494), thanks @VincentLanglet!v0.12.83
Compare Source
Improvements 🔧
2c42ef18ae
), #4733, #4326, #987, #4215, #469556ae015b57
), #2977, #3190Bleeding edge 🔪
d4edc59b36
)ce9299c0e9
)3f712be7c4
)If you want to see the shape of things to come and adopt bleeding edge features early, you can include this config file in your project's
phpstan.neon
:Of course, there are no backwards compatibility guarantees when you include this file. The behaviour and reported errors can change in minor versions with this file included. Learn more
Bugfixes 🐛
8f0150d6dc
), #4729a843d87167
), #47255d37113e51
), #4731$foo ?? false
pattern when making sure variable exists (c4cc668959
), #560mt_rand
andrand
are not pure (edc84462e4
)random_int
andrandom_bytes
are not deterministic (f36fa71374
), #4190is_file()
calls and similar only afterclearstatcache()
(bcc8d61a5e
)f92b95ed5d
), #320390e49f7074
,2c0dda3212
), #429242d0b36372
), #44344db2e1427e
), #4762Closure::bind
(#489), thanks @VincentLanglet!array_sum()
dynamic return type extension (#490), thanks @VincentLanglet!NativeMethodReflection::hasSideEffects()
(98fb5404cb
), #4231, #4287count()
(7b417c7f3e
), #4700dbe08a6fea
,626f72aaf4
,1463c571cf
,91f477f040
), #4723baa371e865
), #4795Function signature fixes 🤖
v0.12.82
Compare Source
Improvements 🔧
@use
(8766923436
), #44231e53ab65f0
), https://github.com/phpstan/phpstan/discussions/4691RecursiveIterator
generic (82596f5d66
), #47183e1d2003e5
)Bugfixes 🐛
a1b7b38fb5
), #2575, #4130, #3623static::
preserves generic types (d4e0177a35
), #3251, #2231static
type in the typesystem, not in scope (#474), #4213, #4648, #3523, #3120, #1652, #4267static
in parameter type in implemented interfaces (d225a68cb3
), #4707, #3118parent::
preserves generic types (4acbc6c4f7
), #2231, #2621, #3537, #32516d523028e3
), https://github.com/phpstan/phpstan-deprecation-rules/pull/35::class
constant (431905c130
), #4713, #40668babba3f11
), #4288b51a26fd09
), #4702%h
and%H
in printf/sprintf (0cbbfba2a7
), #4717330eb221a9
), #4545d01431c5c2
), #3558, #3351, #1843Function signature fixes 🤖
XMLReader::open()
return type (https://github.com/phpstan/phpstan-src/pull/456), thanks @jeroennoten!v0.12.81
Compare Source
Improvements 🔧
469a8c3dc3
)vendor/bin/phpstan
, if you satisfy two conditions:phpstan.neon
(orphpstan.neon.dist
) in your current working directorylevel
parameter, andpaths
to analyseResource
orNever
are now correctly recognized in PHPDocs and have priority over PHP'sresource
type and PHPStan'snever
pseudotypenoreturn
in PHPDoc as NeverType (bce31f014d
)Bugfixes 🐛
8382e35a2b
)isSuperTypeOf()
between template union types (9f51f8e6dd
), #467049dcc504cf
), #463448aea56c5e
), #46420725f5a711
), #4641e68ca10bf5
), #4643Function signature fixes 🤖
SplFileObject::fgetcsv()
(#464), thanks @TomAdam!v0.12.80
Compare Source
Improvements 🔧
e671cc0a5d
), #2928, #3922@template T
+@template U of Query<T>
.T
ofRecursiveIteratorIterator
(d28b61b986
), #34250315dfa437
)72b02a6706
)Bugfixes 🐛
d29d098d62
), #4605@var
priority with prefixed PHPDoc tags (3186fff735
), #4606Function signature fixes 🤖
v0.12.79
Compare Source
Improvements 🔧
@template
type bound (ac7b49ef41
), #3769int
andstring
as@template
type bound (768bfab11b
)ReflectionClass::isSubclassOf()
(d3b5d60d27
), #4577BetterReflection
to version that uses PHPStan namespace instead of random prefixed one (06ef13e9c3
). See https://github.com/rectorphp/rector/pull/56655aa8a5589d
)PhpPropertyReflection::getNativeReflection()
(5fad625b77
)Bleeding edge 🔪
new $string
leads toobject
, notmixed
(78a9f057d7
)If you want to see the shape of things to come and adopt bleeding edge features early, you can include this config file in your project's
phpstan.neon
:Of course, there are no backwards compatibility guarantees when you include this file. The behaviour and reported errors can change in minor versions with this file included.
Bugfixes 🐛
GenericObjectType::isSuperTypeOf()
for covariant template types (3f6de01ead
)method_exists()
afternew $class
(70756b0939
), #4579--debug
message (#455), thanks @alamirault!c1f7aafc47
), #4498d97ddee4d5
)ea7e0ac0cb
), #4587756af18c18
)v0.12.78
Compare Source
Improvements 🔧
0f64ca749f
), #211267b2d1cfa5
)7d279fcfe8
), #39523457e58115
), #3416array_map
/array_filter
can resolve to a subtype of native type (bf320b0b25
)Bugfixes 🐛
count($array)
afterarray_shift()
(6b2afbccce
), #4558@template
name clash from different scopes (527269a28f
), #4557, #3121ec26a001da
), #3829method_exists()
might remain a string (91894ff918
), #4573Function signature fixes 🤖
v0.12.77
Compare Source
Improvements 🔧
continue
/break
outside of loop and switch (level 0) (df5c98d7bc
), #3588, #794Bugfixes 🐛
vendor/composer/installed.php
(6367eb6d09
), #4542isset()
(#452), thanks @VincentLanglet!ec2ef2af56
), #4550class-string<T>
(a7a46b11ce
), #4552, #4249Function signature fixes 🤖
simplexml_import_dom
(270d507b82
), #4536Redis::auth()
method also accepts array (#449), thanks @mvorisek!proc_get_status()
- array shape for PHP 8 (f9c571415c
)v0.12.76
Compare Source
Bugfixes 🐛
break X
andcontinue X
(31fcad649c
), #4535, #4346, #2913, #2926, #2549, #2003, #1945, #651, #1283990ba51cb3
), #4527v0.12.75
Compare Source
Improvements 🔧
b7d60809dd
)Bleeding edge 🔪
@var
PHPDoc tag (level 2) (58860536dc
)aae34d9350
), #3267If you want to see the shape of things to come and adopt bleeding edge features early, you can include this config file in your project's
phpstan.neon
:Of course, there are no backwards compatibility guarantees when you include this file. The behaviour and reported errors can change in minor versions with this file included.
Bugfixes 🐛
8633000546
), #4514785b66311e
), #4513cc9a674016
), #4519SplObjectStorage
's ArrayAccess will never return null (60624379b0
), #44366ef87d1d1f
)SplObjectStorage
) to a property (2017318c31
), #3777Function signature fixes 🤖
v0.12.74
Compare Source
Improvements 🔧
StaticType
coming from dynamic return type extensions (76b65b4a76
)Bugfixes 🐛
3d365fc7af
), #4504@var
in unreachable code (ec4e7edfe6
), #4505v0.12.73
Compare Source
Improvements 🔧
@var
above global keyword (fa5f8ec4a3
), #4500@var
(e5010911e9
)v0.12.72
Compare Source
Improvements 🔧
d0a35b5d18
)cec9ef6b6d
)0e8441471e
)@var
(a5a9a4dea4
)Bleeding edge 🔪
18bdd34a80
)If you want to see the shape of things to come and adopt bleeding edge features early, you can include this config file in your project's
phpstan.neon
:Of course, there are no backwards compatibility guarantees when you include this file. The behaviour and reported errors can change in minor versions with this file included.
Bugfixes 🐛
@var
aboveuse
statement (4fff79c64f
), #4486@var
abovenamespace
statement (26fb6dda9f
)composer install
(f11c0f0922
), #4495v0.12.71
Compare Source
Improvements 🔧
ca7e9ef41c
,369cc186b6
,fb85182b78
)compact()
function (2a75a25431
)CompactVariablesRule
- recognize array parameters (f2dd33a09a
)Bugfixes 🐛
@return never
on a separate line (136db047e3
), #4455never
return type in closure only with missing orvoid
native return typehint (809807af5a
), #4442bef5a261f3
)5ad91d26e2
), #4471CallableType::getReferencedClasses()
(09da0a3af0
)Function signature fixes 🤖
MemcachePool::get
declaration (return types) (#434), thanks @fizzka!v0.12.70
Compare Source
Improvements 🔧
phpstan.phar
is built with Composer v2, solvesOutOfBoundsException: Package "project/project" is not installed
error (https://github.com/getsentry/sentry-symfony/issues/383) thanks to https://github.com/composer/composer/pull/9635d3435dd97b
), #4435Bugfixes 🐛
ba4bc4f731
), #44226bbd6290c9
)a2ce51b4ec
)Function signature fixes 🤖
setcookie()
(#431), thanks @VincentLanglet!v0.12.69
Compare Source
Improvements 🔧
phpstan/phpstan
distribution (https://github.com/phpstan/phpstan/pull/4390), thanks @mvorisek!e4b6ffdcb6
), #4401isSuperTypeOf()
inObjectType
(e88491bb85
)self::
) across CallStaticMethodsRule, ClassConstantRule, AccessStaticPropertiesRule (863e6c600a
), https://github.com/composer/composer/pull/9635callable
signatures in PHPDocs: turn on withcheckMissingCallableSignature
parameter (off by default) (https://github.com/phpstan/phpstan-src/pull/430), thanks @dktapps!Bugfixes 🐛
array_reverse()
(3ccc152efd
), #4398c865bc3f9b
)getIterator()
doesn't have PHPDoc type (c75b0ea678
), https://github.com/phpstan/phpstan/discussions/4415@var
above property should not pollute scope inside methods (e832df4e99
), #4412never
from closure (98c8dd6b72
), #441609e4fbec99
), #44178b4cab5ed0
)Function signature fixes 🤖
proc_get_status()
(#429), thanks @Firehed!v0.12.68
Compare Source
Improvements 🔧
96750b5acd
), #3115, #3091, #2576Bugfixes 🐛
a81a8c3870
)c70325b4a4
)9a99aa5472
)v0.12.67
Compare Source
Improvements 🔧
@var
support so that view files can be analysed successfully (22d363cdb9
,27481c3c36
), #4155, #3516, #3515, #351a5f9f0c26d
), #38533c56362f74
)96f1e106bd
)PHPStan\Reflection\Generic\ResolvedFunctionVariant
in favor ofPHPStan\Reflection\ResolvedFunctionVariant
(959b6e9ab3
)Bugfixes 🐛
2de6a241ca
), #4214parent::__construct()
resets$this
state (c8174d59cc
), #4351cbbbd36189
), https://github.com/phpstan/phpstan-doctrine/issues/169v0.12.66
Compare Source
Improvements 🔧
@pure
and@phpstan-pure
annotations (#412), thanks @b1rdex!@impure
and@phpstan-impure
(#412)Bleeding edge 🔪
4a82eec404
)40a76e88d0
)ae9a558484
)If you want to see the shape of things to come and adopt bleeding edge features early, you can include this config file in your project's
phpstan.neon
:Of course, there are no backwards compatibility guarantees when you include this file. The behaviour and reported errors can change in minor versions with this file included.
Bugfixes 🐛
e9b783a5e4
), #433935db779fac
), #4343Function signature fixes 🤖
zip_open()
(#419), #4341, thanks @spud!d586b93926
)setcookie()
andsetrawcookie()
signatures (ccb1d4d414
), #4348array_combine()
dynamicExtension (#418), thanks @VincentLanglet!array_rand()
return type extension (#417), thanks @VincentLanglet!ctype_*
function signature (#421), thanks @BackEndTea!v0.12.65
Compare Source
Improvements 🔧
excludePaths
that replacesexcludes_analyse
and allows for more granular settings - different exclusions for analysed paths and discovering symbols in 3rd party code (bf35a10458
) - #3749, #1796. Read more about it in this comment.db0a5f61a4
), #4328Bugfixes 🐛
94e3443b2d
)3d0ac6f15e
), #4275array_filter
w/ arrow functions return type extension (#402), thanks @b1rdex!143741c9c6
)7ac6383557
), #4292, #3348isset()
bug (3d6461c333
), #4290count()
calls in TypeSpecifier (69e68a7a15
), #4300Function signature fixes 🤖
preg_replace_callback*
for PHP 7.4+ (#411), thanks @jabrandes!9e7bdf7c50
)v0.12.64
Compare Source
Major new feature 🚀
Dependent variables
PHPStan can now understand relationships between different variables. Cases like these are now understood correctly:
Additionally, this feature fixes all these issues: #801, #806, #1209, #1306, #1722, #1865, #2980, #3371, #3986
Bugfixes 🐛
TypesAssignedToPropertiesRule
(7458d1e09c
)nikic/php-parser
(19bf582aa3
), #4194Function signature fixes 🤖
Collator::compare
toint|false
(#410), thanks @vasekbrychta!44305499fe
), #4268v0.12.63
Compare Source
Bugfixes 🐛
#[Pure]
but having@throws
are considered to have side effects (7537f81d6c
), #4232d245daba79
), #423475d00c9a0f
), #4199893813ce0f
), #4205Function signature fixes 🤖
43e5399070
)v0.12.62
Compare Source
Support relative paths in extension-installer (
0e306c66ca
), https://github.com/phpstan/extension-installer/issues/17Starting with
phpstan/phpstan
0.12.62 andphpstan/extension-installer
1.1.0, relative paths to extension configs are used. This allows the generated config to be moved across filesystems, for example from a host system to a Docker container.v0.12.61
Compare Source
Bugfixes 🐛
5b89088469
), #4227Function signature fixes 🤖
posix_getpwuid
andposix_getgrgid
(#408), thanks @aragon999!v0.12.60
Compare Source
Improvements 🔧
030b4f53f2
)af5ba63fcf
), #420780d8afb450
)Bugfixes 🐛
c22e62052c
), #42001dfade1440
), #4204761c9623a2
), #4206a73b48f411
)Function signature fixes 🤖
static
(#407), #4222, thanks @voku!v0.12.59
Compare Source
Bugfixes 🐛
0e3230199e
), #4147Function signature fixes 🤖
v0.12.58
Compare Source
Improvements 🔧
518b20dc47
), #3755f956c6d1dc
)fb95fabcb9
)parametersSchema
before comparing config files (2a87b3af4a
)Bleeding edge 🔪
DateTime
instantiation (#380), thanks @b1rdex!If you want to see the shape of things to come and adopt bleeding edge features early, you can include this config file in your project's
phpstan.neon
:Of course, there are no backwards compatibility guarantees when you include this file. The behaviour and reported errors can change in minor versions with this file included.
Bugfixes 🐛
treatPhpDocTypesAsCertain: false
(a9ec1746ef
), #4099treatPhpDocTypesAsCertain: false
(64da8f9c05
), #3760602c71877c
), #41253e8ec5f0d4
), #413583c1e0b830
), #3965, #29972a39e5a411
), #3650Function signature fixes 🤖
mysqli_get_client_info()
argument is optional (b01c6c9f71
), #4013RedisArray::__construct()
(3e956033ad
), #3688DateTime
/DateTimeImmutable::getLastErrors()
return types (#380), thanks @b1rdex!mb_str_split
(#379), thanks @VincentLanglet!XMLWriter::*Ns()
can accept null in$prefix
(#383), thanks @spaze!v0.12.57
Compare Source
Improvements 🔧
ef84d9444f
) - this makes working with the baseline instantaneous!dd11e25000
)ba119bcc7b
)Bugfixes 🐛
1e42295fdc
)8ec0a96307
)50aff6d16c
), #4097e496d71a77
,f000222ca5
,3ea4fc3047
), #408973a0c1bf42
), #409586c11d335d
), #4107Function signature fixes 🤖
v0.12.56
Compare Source
Improvements 🔧
c507ae2ed6
)Bugfixes 🐛
63de0e86ef
), #40870524fb5c8e
), #3956v0.12.55
Compare Source
Improvements 🔧
(unset)
cast (PHP 8) (56471f6c5e
)current()
dynamic return type extension (dafba25bd5
), #2539450592cf77
)jetbrains/phpstorm-stubs
(fa8a365e03
)456f4435ae
)1639213192
)--debug -vvv
will show how much memory each file consumes (29f8938572
)Bugfixes 🐛
range()
with string arguments (67a905a920
), #237836dac3de03
)1a4f8b3e86
)310cb83932
), #407046c39e8d45
), #407637c6bbc8ec
), #1917138cabd75a
), #313298b5509441
)1fd761d139
,95101a0135
,14928bf41f
)9afec60a1c
), #4084Function signature fixes 🤖
stream_get_meta_data
(#369), thanks @SvenRtbg!9d5f053475
)v0.12.54
Compare Source
Improvements 🔧
@return never
as an alternative toearlyTerminatingMethodCalls
andearlyTerminatingFunctionCalls
(#366,cc91080c2f
), thanks @b1rdex!PHPStan\dumpType
dummy function and rule for debugging inferred types (c24c8ef699
)jetbrains/phpstorm-stubs
(51aaf579d7
), #4029Bugfixes 🐛
ConstantArrayType::toBoolean()
(d22abbea78
), #4043array_slice()
with mixed argument (#367), thanks @jlherren!void
can be combined with PHPDoc typenever
(1857c6cc90
), #4006ConstantArrayType::generalize()
should generalize item type too (fc052c46cf
), #4056e36e1cd85d
), #4054v0.12.53
Compare Source
Improvements 🔧
Stringable
(PHP 8) (3143833c4f
)jetbrains/phpstorm-stubs
(3714a73578
)no-return
andnever-returns
types as aliases ofnever
(#361), thanks @b1rdex!#[Pure]
from methods in phpstorm-stubs (500b160520
)21c50e3c87
)Bugfixes 🐛
IntegerRangeType
numerically (#357), thanks @jlherren!38fe693727
), #4006, #4003d67dae35c7
), #4016, #3752ConstantArrayType::isSuperTypeOf()
(1753f2f097
)b55656f558
, #363), #3836, thanks @b1rdex!fb5553533d
)3a57521362
), #4011, #40301c2b7271ff
), #4017, #4023parent::__construct()
(c8e4f8bb30
)3810804271
)Function signature fixes 🤖
system()
can return false (#358), thanks @jlherren!v0.12.52
Compare Source
Improvements 🔧
functionMetadata.php
from PhpStorm stubs'#[Pure]
attribute) (2817690757
)Bugfixes 🐛
extract()
call might exist (d3e7b9cd30
), #3990isset()
andempty()
(05942ca9da
), #3991assert()
bug (ca044c40c3
), #3994array_shift()
should invalidate rememberedcount()
call (26d29ec602
), #3993count()
method in implementations of Countable interface (MethodSignatureRule - read PHPDoc types instead of combined types) (fb8d3ef823
), #3997a97477bfb7
), #4000v0.12.51
Compare Source
Improvements 🔧
positive-int
andnegative-int
types (2fc6a5f96d
), #37906784a1ce7c
,a78a2e795a
)4a886db25a
), #397559c04234e9
,0f8a61a86e
)aa502ff6b5
)Bugfixes 🐛
(int)
(72194195a7
)assert_options()
(2164616b8c
), #3944isset($arr['key'])
(#346), thanks @jlherren!isset()
with multiple arguments (#345), thanks @jlherren!tmpDir
directory (5be8b8081b
)fadb43965e
)isset()
(3b21093bb5
), #3985isset()
- fix false positive (fcb78d9597
), #2816array_slice
with non-empty-array (273b3cef8f
)Function signature fixes 🤖
explode()
returns a non-empty array in certain scenarios (00691075ac
), #3596, #3961setlocale()
can take as argument string|null (#351), thanks @peter-gribanov!v0.12.50
Compare Source
Improvements 🔧
throw
expression (PHP 8.0) (5f2d42cec0
)::class
on expression (PHP 8.0) (cec1be72aa
)non-empty-array
andnon-empty-list
(a4038b2712
)Bugfixes 🐛
ea43e81b26
), #3942(int)
(842b468cc6
), #3939af5921e464
), #3958befb7433cf
), #39478113f3840d
), #3943Function signature fixes 🤖
hash
function return type (#343), thanks @Synchro!v0.12.49
Compare Source
Improvements 🔧
parameters.phpVersion
in yourphpstan.neon
to80000
and re-run PHPStan to see how well your code will fare once PHP 8 is released!@removed
annotation (a39a46f5b8
,4eecc4f7b8
)mixed
type (#339), #1014, thanks @jlherren!Bugfixes 🐛
hoa/Stream.php
- remove registerShutdownFunction (edd5c3c14d
), #39070e429416b5
), #39096c61e497f6
,34c48299d1
), #3910false
(917cdb1374
)c3d09898e8
)287b8b85ca
)2cd700142f
)Function signature fixes 🤖
mysqli_begin_transaction
(#331), thanks @MasterOdin!PHPStan\Reflection\ClassReflection::getName()
returnsclass-string
(3d1d930c00
)Memcache::get
signature (#338), thanks @dada-amater!SimpleXMLElement::children()
accepts null (7ce2e54b18
)71e7550ba3
,0c87f16948
)pow()
(c54e495319
)v0.12.48
Compare Source
Error::canBeIgnored()
which caused result cache to be silently unused (2af17d9aed
), #3897openssl_seal
optional (#329), thanks @phil-davis!d2f443ccfe
)false
for hash_hmac/hash_hmac_file on invalid algorithm (#328), thanks @pascalheidmann!v0.12.47
Compare Source
🚀 PHPStan Pro has been released 🚀
In few brief points:
Try it by running PHPStan with the
--pro
option.After 30-day free trial period it costs 7 EUR for individuals monthly, 70 EUR for teams (up to 25 members), you’ll support the development of open-source PHPStan 😊 If you’re using PHPStan at your job to prevent bugs reaching production, please consider paying for PHPStan Pro, 70 EUR monthly is less than a man-day 😊
You can read more about it on the blog: https://phpstan.org/blog/introducing-phpstan-pro
I’m looking forward to your feedback!
v0.12.46
Compare Source
nikic/php-parser
(e7203bc45c
), fixes #3885 (Internal error in StubPhpDocProvider.php)openssl_seal
has up to 6 parameters (#327), thanks @foppelfb!v0.12.45
Compare Source
bindec
returnsfloat|int
(#326), thanks @Synchro!v0.12.44
Compare Source
preg_split
sometimes returns array of arrays (#324), thanks @spaze!v0.12.43
Compare Source
Improvements 🔧
ff092a0187
)Bugfixes 🐛
92b57a5ec7
)$_SESSION
as always existing (#321), thanks @b1rdex!Function signature fixes 🤖
v0.12.42
Compare Source
Fix error:
Exception: Return value of PHPStan\PhpDoc\ResolvedPhpDocBlock::getNameScope() must be an instance of PHPStan\Analyser\NameScope, null returned
(6e73d64d0c
), #3820v0.12.41
Compare Source
Improvements 🔧
nikic/php-parser
to 4.9.1 (abf2d0fcb7
)Bugfixes 🐛
v0.12.40
Compare Source
Improvements 🔧
numeric-string
type for PHPDocsdate
function can sometimes return numeric string (1053ee754c
), #2899c9678cd71d
,ba40208daa
)Bugfixes 🐛
is_numeric()
(7f04f75c9c
,1d27c61ede
), #3664, #3489, #2710, #3133, #2964, #2550, #3161v0.12.39
Compare Source
Improvements 🔧
@method
tags (#302), thanks @yosatak!Bleeding edge 🔪
SplObjectStorage
stub (#301), #3111, thanks @VincentLanglet!If you want to see the shape of things to come and adopt bleeding edge features early, you can include this config file in your project's
phpstan.neon
:Of course, there are no backwards compatibility guarantees when you include this file. The behaviour and reported errors can change in minor versions with this file included.
Bugfixes 🐛
count($array) > 0
and similar conditions (#305), thanks @ossinkine!unset()
(e96481c321
)79bae4b17d
), #3776v0.12.38
Compare Source
Improvements 🔧
static
return type (75ff7054b0
)callable-string
type (#296), thanks @ste93cry!nikic/php-parser
to 4.9.0 (05b6a54115
)17315cb32f
)min()
andmax()
may return false if array size could be zero (#300), thanks @dktapps!Bugfixes 🐛
19fab3fc26
)??=
and other assign ops (efb11ec5cf
,71c51e40e7
), #3735, #3636src/
too (ca70ff0985
), #3731Function signature fixes 🤖
v0.12.37
Compare Source
Improvements 🔧
nikic/php-parser
to 4.8.0 (65a74c660d
)LexerFactory
to take advantage of the newEmulative
lexer capabilities (71013bc41e
) - some of the new syntax from PHP 7.3, 7.4, and 8.0 will now be marked as parse error on lower PHP versionsBugfixes 🐛
nette/di
characters in BaselineNeonErrorFormatter (7336df1a85
), #3705v0.12.36
Compare Source
Improvements 🔧
e72ef39e15
)@phpstan-throws
(#292), thanks @VincentLanglet!Bugfixes 🐛
818830419d
), #3712e964816ea5
), #337911ef998efb
), #3716v0.12.35
Compare Source
Bugfixes 🐛
353cb012ab
), #3690d3044eef82
), #3635, #3629cdbed8608a
), #36305958c29890
), #36374cad0c63d5
), #36636d818816d6
), #3686Function signature fixes 🤖
odbc_connect()
andodbc_prepare()
(#289), thanks @duncan3dc!v0.12.34
Compare Source
Improvements 🔧
@mixin
above classes with__callStatic()
creates static methods (aa38695f37
), #3641542238a6e8
), #36385a3deae451
)Bugfixes 🐛
yield
in for loop, foreach loop, while loop, do-while loop, if condition, switch statement (#286), thanks @dantleech!Generator::throw()
(153c874ad7
), #3683, #3418Function signature fixes 🤖
v0.12.33
Compare Source
Improvements 🔧
39f8909dfa
)mixed
type (a9043e0121
)phpVersion
parameter in yourphpstan.neon
, you can for example tell PHPStan to analyse source code like it's written for PHP 7.4 even if you're running PHP 8. ThephpVersion
config parameter is inPHP_VERSION_ID
format - for PHP 7.4, use70400
.phpVersion
to80000
.a1eb1f5b65
), #2984checkUninitializedProperties: true
.()
in ignoreErrors (8479d405a4
), #3602Bleeding edge 🔪
config.platform.php
in project'scomposer.json
is respected and overrides the current runtime PHP version (d235195220
).If you want to see the shape of things to come and adopt bleeding edge features early, you can include this config file in your project's
phpstan.neon
:Of course, there are no backwards compatibility guarantees when you include this file. The behaviour and reported errors can change in minor versions with this file included.
Bugfixes 🐛
4d082805ae
), #3569Function signature fixes 🤖
e1f492c1dc
), #3539, #3512, #3525image*
functions (#265), thanks @javajawa!v0.12.32
Compare Source
Improvements 🔧
6fd85e3b7d
)--error-format checkstyle | cs2pr
, you can omit this part from your build script!--error-format table
.github
for GitHub Actions (#261), thanks @Quetzacoalt91!Bleeding edge 🔪
6905d66cf4
)If you want to see the shape of things to come and adopt bleeding edge features early, you can include this config file in your project's
phpstan.neon
:Of course, there are no backwards compatibility guarantees when you include this file. The behaviour and reported errors can change in minor versions with this file included.
Bugfixes 🐛
a21012d142
), #3481v0.12.31
Compare Source
Bugfixes 🐛
8390949321
), #3527e6dd87bd19
), #3460Function signature fixes 🤖
ZipArchive::open()
returns true on success, int (error code) on failure (#253), thanks @dktapps!mysqli_stmt_fetch()
andmysqli_stmt::fetch()
can return NULL (#255), thanks @morozov!openssl_pkey_export()
allows null for the passphrase (#256), thanks @ConradSollitt!enchant_broker_list_dicts()
return type (#257), #3530, thanks @villfa!v0.12.30
Compare Source
Improvements 🔧
$this
in the root scope are always "maybe-defined" which means they won't be reported on level 0 but on level 1 (0613451c60
,14b17a8f05
), #351@var
PHPDoc (44f9d08dd0
)428c8e594f
)~
) operator (#249), thanks @dktapps!Bugfixes 🐛
install-path
frominstalled.json
available in Composer v2 (4cf01410bb
), #3426d1990b804a
), #342609f0bebde6
), #3478Function signature fixes 🤖
dbase_open
anddbase_create
can also return false (#246), thanks @swen100!Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Renovate Bot.
3b9750e533
todeab626dba