1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-14 02:07:37 +01:00
psalm/stubs
Marco Pivetta ed2cde1b93 Mark Reflection(Method|Property)#setAccessible() as pure starting from PHP 8.1 onwards
This will highlight unused code.

Ref: https://github.com/php/php-src/pull/5412
Ref: https://wiki.php.net/rfc/make-reflection-setaccessible-no-op
Ref: https://github.com/php/php-src/pull/5411

Example https://3v4l.org/PNeeZ

```php
<?php

class Foo {
    private $bar = 'baz';
    private function taz() { return 'waz'; }
}

//var_dump((new ReflectionProperty(Foo::class, 'bar'))->getValue(new Foo));
//var_dump((new ReflectionMethod(Foo::class, 'taz'))->invoke(new Foo));
```

Produces (starting from PHP 8.1):

```
string(3) "baz"
string(3) "waz"
```
2022-12-07 14:22:15 +01:00
..
extensions Add stubs for ext-random (PHP 8.2) 2022-11-02 15:59:56 +03:00
CoreGenericClasses.phpstub Configure a correct attribute target in stubs/CoreGenericClasses.phpstub 2022-08-24 21:32:26 +02:00
CoreGenericFunctions.phpstub Allowed taints to pass through urlencode() 2022-12-05 17:25:36 -06:00
CoreGenericIterators.phpstub Merge remote-tracking branch 'origin/4.x' into HEAD 2022-11-08 10:25:04 +01:00
CoreImmutableClasses.phpstub Make array shapes strict by default (#8701) 2022-11-11 20:14:21 -05:00
ext-apcu.phpstub bugfix/#7912: Add Iterator implements to stub 2022-05-17 23:55:44 +02:00
Php80.phpstub Declaring more precise types and purity boundaries on ext-reflection symbols in .phpstub files 2022-12-06 11:08:30 +01:00
Php81.phpstub Mark Reflection(Method|Property)#setAccessible() as pure starting from PHP 8.1 onwards 2022-12-07 14:22:15 +01:00
Php82.phpstub Refine ReflectionUnionType and ReflectionIntersectionType for PHP 8.1 and PHP 8.2 2022-12-06 18:26:50 +01:00
phpparser.phpstub Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395) 2022-11-05 22:34:42 +01:00
phpredis.phpstub some more string values 2022-10-09 17:01:38 +02:00
Reflection.phpstub Removed templated parameters from ReflectionClass#isInstance() 2022-12-06 11:21:09 +01:00
SPL.phpstub Fix template param for SplDoublyLinkedList. 2022-10-14 11:54:53 +05:30