Matthew Brown
4b0667bb14
Group some functionality together
2022-03-07 14:40:28 -05:00
Matthew Brown
9f9fefe7d6
Simplify loop logic a little
2022-03-02 18:49:57 -05:00
Matthew Brown
766fc174a3
Remove unnecessary $child_stmt
2022-03-02 17:34:56 -05:00
Matthew Brown
54edbdabf6
A little light refactoring
2022-03-02 17:27:58 -05:00
orklah
cb158726a0
Merge pull request #7359 from Patrick-Remy/feat/properties-of
...
feat(types): add properties-of<T> type
2022-02-28 19:28:21 +01:00
Matthew Brown
569e97d5e9
Minor fix for single parent inheritance
2022-02-27 23:57:44 -05:00
Matthew Brown
d17d82e4e3
Simplify template population
2022-02-27 23:51:51 -05:00
orklah
2f3c150690
merge fixes
2022-02-26 21:28:15 +01:00
orklah
0fe6eaf5d9
Merge remote-tracking branch 'upstream/4.x' into upstream-master13
2022-02-26 21:26:59 +01:00
orklah
fc2c6ab4d5
Merge pull request #7727 from AndrolGenhald/attribute-analysis-improvements
...
Attribute analysis improvements
2022-02-24 21:34:05 +01:00
orklah
26bfc95b13
allow SimpleTypeInferer to infer non empty lists
2022-02-24 20:57:29 +01:00
Patrick Remy
51f3b9869b
docs: add properties-of type to plugins type system
2022-02-24 18:50:35 +01:00
AndrolGenhald
c82abe3017
Fix trailing commas for PHP 7.
2022-02-23 22:30:50 -06:00
AndrolGenhald
5f9a8c9240
Fix types.
2022-02-23 22:12:32 -06:00
AndrolGenhald
43764f0c3d
Add Reflection getAttributes analysis.
2022-02-23 22:12:32 -06:00
AndrolGenhald
1387f94324
Attribute analysis improvements.
2022-02-23 22:12:32 -06: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
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
Bei Xiao
6a3b5679fe
Support interfaces extending enums
2022-02-22 16:04:56 +02: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
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
Bruce Weirdan
997bded2e3
Merge branch '4.x' into upstream-master
2022-02-21 01:08:21 +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
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
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
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
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
Matthew Brown
6af3b502df
Remove unnecessary array assignment
2022-02-16 13:04:23 -05:00
Bruce Weirdan
e47752afb4
Merge pull request #7666 from AndrolGenhald/more-class-const-improvements
...
More class const improvements.
2022-02-16 03:43:37 +02:00
eb3df40fbb
Add option to disable @var parsing everywhere except for properties.
2022-02-15 10:04:56 +01:00
Vincent Langlet
694157b2e0
PDOException extends RuntimeException and can use int code errors
2022-02-14 21:04:10 +01:00
AndrolGenhald
cc2334f40d
More class const improvements.
...
Add InvalidClassConstType issue as alternative to LessSpecificClassConstType when type isn't contravariant.
Handle final class consts (#6395 ).
Use double quotes for types in class const issues.
2022-02-13 17:19:25 -06:00
orklah
1142c818c2
Merge remote-tracking branch 'upstream/4.x' into upstream-master9
2022-02-14 00:10:28 +01:00
orklah
b796f4558a
Merge pull request #7665 from orklah/matchcount
...
fix count with match on arrays
2022-02-13 22:49:31 +01:00