AndrolGenhald
1387f94324
Attribute analysis improvements.
2022-02-23 22:12:32 -06:00
Patrick Remy
8ebc9b599f
docs: describe template support of properties-of<T>
2022-02-23 21:53:02 +01:00
Patrick Remy
be49037d70
feat: add template support to properties-of<T>
2022-02-23 21:30:09 +01:00
orklah
3a85f49268
Merge pull request #7673 from VincentLanglet/pdoException
...
PDOException extends RuntimeException and can use int code errors
2022-02-23 13:45:57 +01:00
Bruce Weirdan
919775c937
Merge pull request #7719 from whatUwant/4.x
2022-02-23 01:10:06 +02:00
Bei Xiao
40cc346991
Update stub
2022-02-23 00:52:53 +02:00
Bei Xiao
0b24b07423
Specify required php version for test
2022-02-22 23:41:53 +02:00
Patrick Remy
5e74445f70
docs: add utility types chapter
2022-02-22 20:51:17 +01:00
Patrick Remy
d81c74eb62
style: fix linting issues and failing tests
2022-02-22 20:13:24 +01:00
Bei Xiao
c9666bbeb5
Reduce method complexity
2022-02-22 20:50:43 +02:00
Patrick Remy
6e783d863d
feat: ignore static properties in properties-of<T>
2022-02-22 19:49:03 +01:00
Nicolas Giraud
9a95ba97e9
Also update the historical CallMap to be aligned with latest changes on CallMap.
2022-02-22 15:47:58 +01:00
Nicolas Giraud
b43c4af2d4
Cast the read streams to an array while looping over as it can be NULL.
2022-02-22 15:47:27 +01:00
Bei Xiao
6a3b5679fe
Support interfaces extending enums
2022-02-22 16:04:56 +02:00
Nicolas Giraud
e1980122da
Fix #3036 : make argument $read of internal PHP function stream_socket nullable.
2022-02-22 12:49:29 +01:00
orklah
d2493e2656
Merge pull request #7715 from trowski/fix-ffc-in-loop
...
Fix first-class callable in loop
2022-02-22 07:06:03 +01:00
Aaron Piotrowski
97b5685f55
Fix first-class callable in loop
2022-02-21 18:37:20 -06:00
Patrick Remy
9c6deacc69
feat: expand properties-of to keyed array
2022-02-21 23:02:27 +01:00
Patrick Remy
30fac906c6
feat(types): add properties-of<T> type
2022-02-21 21:15:02 +01:00
orklah
1a5b120081
Merge pull request #7713 from AndrolGenhald/bugfix/self-in-attribute
...
Use current context when analyzing attributes
2022-02-21 18:50:22 +01:00
Bruce Weirdan
35fa8b2ddd
Merge pull request #7708 from M1ke/4.x-config-threads-xsd
2022-02-21 19:22:03 +02:00
AndrolGenhald
103ec628b0
Improve tests.
2022-02-21 10:44:59 -06:00
AndrolGenhald
04c0db5aff
Use current context when analyzing attributes ( fixes #7710 ).
2022-02-21 10:38:50 -06:00
m1ke
628bf584c2
Alter config file to actually load threads param
2022-02-21 11:07:21 +00:00
m1ke
9d78c3e22a
Add threads config to xsd
2022-02-21 10:26:34 +00:00
Bruce Weirdan
997bded2e3
Merge branch '4.x' into upstream-master
2022-02-21 01:08:21 +02:00
Bruce Weirdan
6cc3da861e
Merge pull request #7596 from azjezz/chore/enable-psl
2022-02-21 00:24:03 +02:00
orklah
b8cda9eb00
Merge pull request #7684 from AndrolGenhald/bugfix/minor-reference-fixes
...
Fix some minor issues with references.
2022-02-20 23:21:56 +01:00
azjezz
d47c0140ed
chore: enable psl tests again
...
Signed-off-by: azjezz <azjezz@protonmail.com>
2022-02-21 00:08:15 +02:00
orklah
ad91df5ee1
Merge pull request #7692 from AndrolGenhald/bugfix/7685-attribute-analysis
...
Analyze attribute statements instead of constructing virtual statements.
2022-02-20 18:57:11 +01:00
Bruce Weirdan
d7d846edc8
Merge branch '4.x' into upstream-master
2022-02-20 02:31:15 +02:00
Bruce Weirdan
97bd81cf5e
Merge pull request #7699 from AndrolGenhald/bugfix/int-range-unpacking
2022-02-19 00:04:32 +02:00
AndrolGenhald
9310a4ff5a
Fix issues with int range unpacking and with min/max.
2022-02-18 15:55:26 -06:00
Bruce Weirdan
6a68287700
Merge pull request #7696 from AndrolGenhald/improve-bool-to-int-cast
2022-02-18 22:17:29 +02:00
AndrolGenhald
525a86e19d
Improve bool to int casting.
2022-02-18 13:22:17 -06:00
Bruce Weirdan
2d83a4bdd3
Merge pull request #7693 from AndrolGenhald/improve-invalid-global-documentation
2022-02-18 20:15:02 +02:00
AndrolGenhald
c1077f32d3
Improve documentation for InvalidGlobal to explain that it's sometimes valid.
2022-02-18 11:36:25 -06:00
AndrolGenhald
0476ca7844
Fix trailing commas for PHP < 7.3.
2022-02-18 08:44:51 -06:00
AndrolGenhald
ea2f452c25
Analyze attribute statements instead of constructing virtual statements.
2022-02-18 08:18:34 -06:00
Bruce Weirdan
d8bec4c7aa
Merge pull request #7690 from dmitryuk/fix-enable-error
2022-02-18 06:34:15 +02:00
a.dmitryuk
8e1e0d1e5e
style-ci
2022-02-18 10:33:35 +07:00
a.dmitryuk
dc8764153e
Throw exception if file_put_contents failed
2022-02-18 10:05:23 +07:00
orklah
2e2099ebe7
Merge pull request #7687 from AndrolGenhald/bugfix/documentation-issue-links
...
Fix issue documentation links.
2022-02-17 20:12:21 +01:00
AndrolGenhald
bd963e4baa
Fix issue documentation links.
2022-02-17 13:04:25 -06:00
orklah
ec95244504
Merge pull request #7686 from AndrolGenhald/feature/type-check-annotations
...
Add `@psalm-check-type` and `@psalm-check-type-exact`.
2022-02-17 18:51:02 +01:00
AndrolGenhald
d09e420939
Add @psalm-check-type
and @psalm-check-type-exact
.
...
I initially added these as part of my TryAnalyzer rewrite to allow testing complicated `finally` types like this:
```
$foo = 1;
try {
$foo = 2;
} catch (Exception $_) {
$foo = 3;
} finally {
$bar = $foo;
/** @psalm-check-type-exact $bar = 1|2|3 */;
}
/** @psalm-check-type-exact $bar = 2|3 */;
```
Using the `'assertions'` in tests doesn't work since the type is different inside the `finally`.
I decided to extract the new annotation from the rest of my changes and do a separate pull request since I think others may find it useful, and it should be much easier to review than the entire TryAnalyzer rewrite.
2022-02-17 10:37:13 -06:00
AndrolGenhald
8f710cc37f
Fix crash when data_flow_graph is null.
2022-02-17 10:34:34 -06:00
AndrolGenhald
580278d323
Fix some minor issues with references.
...
References assigned to properties on `$this` should never be unused.
Using a `@var` docblock before a reference should be allowed if it targets a variable instead of the assignment statement.
2022-02-17 09:31:33 -06:00
Bruce Weirdan
1ee764894a
Merge pull request #7683 from weirdan/fix-psr4-warnings
2022-02-17 04:00:03 +02:00
Bruce Weirdan
e517295f7e
Fixed PSR-4 warnings
...
Fixes the following warnings that were emitted by `composer install`:
```
Generating optimized autoload files
Class Psalm\Tests\KeyOfTemplateTest located in ./tests/Template/KeyOfTemplateTest.php does not comply with psr-4 autoloading standard. Skipping.
Class Psalm\Tests\ValueOfTemplateTest located in ./tests/Template/ValueOfTemplateTest.php does not comply with psr-4 autoloading standard. Skipping.
```
2022-02-17 03:52:07 +02:00