Tyson Andre
2e6a2f14ed
Fix typos in psalm with codespell's dictionary
2019-03-24 23:01:20 -04:00
Tyson Andre
fc83f1c3ea
Fix typo: "Arithmentic" -> "Arithmetic"
2019-03-24 23:00:51 -04:00
Matthew Brown
6bcc3d0261
Don’t stop analysing on var_dump
2019-03-23 10:58:26 -04:00
Matthew Brown
ee56419fd6
Improve accuracy and durability of mixed counts
2019-03-23 09:50:47 -04:00
Brown
9cf78e9097
Remove unused var
2019-03-22 19:12:06 -04:00
Brown
c221eccbf5
Tidy up method call analyser
2019-03-22 18:02:33 -04:00
Brown
cacd5a1946
Cast null array key to empty string
...
Fixes #1487
2019-03-22 16:45:17 -04:00
Brown
cc568422d8
Fix #1488 - allow inheritance when dummy template exists
2019-03-22 16:29:30 -04:00
Brown
b9ba24929d
Refactor storage of template names to prevent clashes
2019-03-22 15:59:10 -04:00
Brown
ab6ca4dc35
Fix #1491 - allow comparison to typed value
2019-03-21 17:26:10 -04:00
Brown
8d06c6a700
Fix #1480 by remembering where a property was set
2019-03-19 19:43:18 -04:00
Brown
6081c742c5
Fix incorrect InvalidArgument for array value scalar mismatch
2019-03-19 16:45:26 -04:00
Brown
880b07783f
Error should be InvalidScalarArgument
2019-03-19 16:12:38 -04:00
Matthew Brown
472ab29d74
Add PossiblyInvalidCast for more refined checks
2019-03-17 17:10:51 -04:00
Matthew Brown
bf586bf93b
Fix #1471 - report issue with string casting inside string
2019-03-17 16:31:56 -04:00
Matthew Brown
9ee4a7414b
Fix #1461 - check interfaces when analysing abstract method call
2019-03-17 14:16:52 -04:00
Matthew Brown
2f8bfffe95
Fix #1475 but, like, properly this time
2019-03-17 13:50:02 -04:00
Matthew Brown
ca765cba58
Fix errors caused by bad generic param counts
...
Fixes #1474
2019-03-17 12:20:57 -04:00
Matthew Brown
de7df3175b
Fix #1368 - improve message formatting
2019-03-16 12:53:54 -04:00
bugreportuser
e31cfa503d
Allow reconciling superglobal types
2019-03-16 12:49:38 -04:00
Matthew Brown
01d6caf6a2
Catch negated instanceof bugs
2019-03-16 12:34:48 -04:00
Matthew Brown
a0659a02f1
Fix #1418 - support templated union types
2019-03-16 11:15:25 -04:00
Matthew Brown
ab832207a4
Fix #1453 - traits are not valid classes
2019-03-15 22:12:35 -04:00
Matthew Brown
b82709897a
Fix #1460
2019-03-15 21:50:16 -04:00
Brown
85f34f2aca
Add defining class and increas string length
2019-03-12 12:58:04 -04:00
bugreportuser
0e9fb04f06
Define globals in more places
2019-03-11 15:53:21 -04:00
Matthew Brown
95b986d2d4
Fix #1367 - allow assertions on mixed arrays to define objectlike type
2019-03-10 23:38:30 -04:00
Matthew Brown
848b070946
Fix #1413 - don’t complain about byref use param
2019-03-10 16:36:35 -04:00
bugreportuser
57a4522ee7
Flesh out callable arg types
2019-03-07 23:24:50 -05:00
Matthew Brown
85f0fa6e7d
Add support for literal templated defaults
2019-03-07 22:32:38 -05:00
Brown
5beb26659e
Add special type for SQL select strings for plugins to consume
2019-03-07 14:56:18 -05:00
bugreportuser
b34dbe26e2
Allow setting superglobal types
2019-03-06 15:59:41 -05:00
bugreportuser
056e5a5b1e
Allow setting globals in config
2019-03-06 15:59:41 -05:00
Brown
9442805763
Mutation checks should not care about return type
2019-03-06 11:12:36 -05:00
Brown
ae69695f89
Prevent tests in PHP 7.1
2019-03-05 18:27:25 -05:00
Matthew Brown
48b39a15b9
Don’t change value of $this by reference
2019-03-03 20:16:11 -05:00
Matthew Brown
a31420be5b
Fix checks for existing vars used in by-ref assignments
2019-03-03 18:21:12 -05:00
Matthew Brown
b7320e2778
Remove unnnecessary param
2019-03-03 16:45:35 -05:00
Matthew Brown
fb9e9bea32
Fix const reference in current context
2019-03-03 16:43:24 -05:00
Matthew Brown
472cdf6bea
Fix #1379 - allow @param-out to change type
2019-03-03 15:11:09 -05:00
Matthew Brown
82e6876011
Fix #1397 - fix get_class behaviour for new instances
2019-03-02 18:02:11 -05:00
Matthew Brown
4757c2fe8e
Fix messaging
2019-03-02 15:19:59 -05:00
Matthew Brown
5e61f198e1
Fix #1419 - allow checks against empty arrays
2019-03-02 15:18:29 -05:00
Matthew Brown
efbcf7dc5b
Fix #1417 - store root file path when scanning for manipulations
2019-03-02 15:07:26 -05:00
Matthew Brown
5c76ab35c8
Allow properties to be set regardless of visibility
2019-03-01 17:30:55 -05:00
Matthew Brown
4cc93644e5
Added more descriptive type for callables
...
Ref #1408
2019-03-01 09:06:37 -05:00
Matthew Brown
317f790bde
New plugin hooks ( #1405 )
...
* Add a bunch of new hooks
* Add more integrations
* Add some broken tests
* Add more things
* Fix remaining interfaces
* Suppress proper issue
* UndefinedMethod should not stop analysis
* Add handlers for two custom method return types
2019-03-01 08:57:10 -05:00
Matthew Brown
d1cf9d61ba
Fix #1398 - improve casting rules for resource
2019-03-01 00:50:22 -05:00
Matthew Brown
55e125f495
Check method args before returning
2019-02-28 23:59:17 -05:00
Matthew Brown
b8b752ed01
Fix #1402 - don’t halt after suppressing static UndefinedMethod
2019-02-28 23:46:11 -05:00
Brown
815bf845dc
Improve handling of method/function return types
2019-02-27 17:06:44 -05:00
Brown
119687f934
Fix redundant condition message when negating a docblock type
2019-02-27 14:02:02 -05:00
Matthew Brown
b310cc07b5
Array access on objects should always be treated as method call
2019-02-26 21:24:30 -05:00
Matthew Brown
8650f9eb1a
Fix #1356 - improve assertion system to work better on function calls
2019-02-26 01:03:33 -05:00
bugreportuser
7f7125f334
Fix crash for empty string array access
2019-02-25 08:26:12 -05:00
Matthew Brown
4f770d356e
Fix #1384 - evaluate array fetches even when we don’t know function
2019-02-24 09:58:11 -05:00
Matthew Brown
3ad1abece4
Add generation of json artifacts
2019-02-24 01:33:25 -05:00
Matthew Brown
cdae79b9fe
Fix unnecessary params in Psalm codebase
2019-02-23 11:31:33 -05:00
Matthew Brown
ce4f2e6334
Fix #1364 - use proper types for extended getIterator calls
2019-02-21 23:01:34 -05:00
Matthew Brown
1c8a573b5f
Change TGenericParam to TTemplateParam
2019-02-21 21:40:06 -05:00
Brown
154e1fa38b
Fix #1375 - improve treatment of dynamically-declared namespaces
2019-02-21 18:19:12 -05:00
Brown
653555a8cc
Remove unused var
2019-02-21 17:49:33 -05:00
Brown
41b133178a
Improve handling of count comparisons
2019-02-21 17:17:10 -05:00
Brown
b7a0950aea
Prevent passing casts to byref vars
2019-02-21 13:26:37 -05:00
Brown
1e2c29041f
@param-out should not override @param byref type def
...
when checking for unuitialised vars
2019-02-20 18:53:42 -05:00
Brown
079ac44263
Prevent pass by ref when type type is given
2019-02-20 17:43:12 -05:00
bugreportuser
14ee221075
Fix errors
2019-02-20 10:55:36 -05:00
bugreportuser
cd23a19931
Allow concat for define first arg
2019-02-20 10:55:36 -05:00
bugreportuser
f603449745
Infer literal string for __namespace__
2019-02-20 10:55:36 -05:00
Brown
348b8eef1f
Fix #1366 - don’t complain about invalid array offset when possibly mixed
2019-02-19 11:42:24 -05:00
Matthew Brown
f49be31aeb
Fix #1332 - use the correct identifier for trait property resolution
2019-02-18 16:52:09 -05:00
Matthew Brown
6b419452af
Fix #1337 - don’t crash when examining __call methods in initialisation checks
2019-02-18 16:04:27 -05:00
Matthew Brown
709a5c31da
Allow bitwise or ops to change type
...
Ref #1340
2019-02-18 12:53:55 -05:00
Matthew Brown
12f1ffca11
Fix issue reconciling mixed vars inside loop
2019-02-18 11:39:05 -05:00
Matthew Brown
5777e008c0
Remove var_dump
2019-02-17 13:18:23 -05:00
Bruce Weirdan
8408effe57
Dropped unused uses
2019-02-17 13:17:45 -05:00
Matthew Brown
40a91eab6e
Fix #1339 - no crash when using self/static/parent in closure
2019-02-17 13:14:59 -05:00
Matthew Brown
0739d017ac
Use information from .phpstorm.meta.php files in stubs
2019-02-16 11:16:52 -05:00
Matthew Brown
d76459e138
Move to a PHPStan-like return type provider class model
2019-02-15 18:00:40 -05:00
Brown
27c99aed2f
Improve recovery from InvalidScalarArgument issue
2019-02-14 16:55:54 -05:00
Brown
50421b297a
Don’t report undefined properties when collecting initialisations
2019-02-13 14:04:10 -05:00
Brown
3deea3980d
Add checks for unitialized properties
...
Fixes #1328
2019-02-13 13:32:19 -05:00
Matthew Brown
c58100e3af
Fix #1313 - don’t allow mixed function calls
2019-02-10 16:15:52 -05:00
Matthew Brown
62fb8035bf
Fix #1309 - no PropertyNotSetInConstructor warnings for grandchild of class
2019-02-10 15:01:10 -05:00
Matthew Brown
c765d0e969
Fix #1307 - improve generator array type
2019-02-09 15:48:15 -05:00
Matthew Brown
83e22a10f8
Fix #1299 - vars defined in catches before throw are possibly-defined for finally
2019-02-09 15:39:30 -05:00
Matthew Brown
e6f3948f7b
Fix #1297 - prevent false positive TypeDoesNotContainType for class const array offset
2019-02-07 16:24:31 -05:00
Matthew Brown
ed4ed957c8
Use more specific templated argument
2019-02-07 15:21:34 -05:00
Matthew Brown
c758678022
Fix remaining issues
2019-02-06 16:08:41 -05:00
Matthew Brown
dfe45e7d26
Fix #1290 - improve handling of more specific template
2019-02-06 15:56:40 -05:00
Matthew Brown
c83afc1af2
Fix element type inference for DOMNodeList
2019-02-05 13:34:59 -05:00
Matthew Brown
6033345694
Fix #1281 - improve handling of mixed property array assignment
2019-02-05 00:36:57 -05:00
Brown
bbf013bfb8
Fix #1279 - speed up analysis of large arrays
2019-02-04 16:06:14 -05:00
Matthew Brown
ab22634d23
Fix #1274 - fix parent:: call to templated method
2019-02-04 00:52:31 -05:00
Matthew Brown
f06ed8bf84
Fix #1273 - don’t change type with unpacked var
2019-02-03 16:36:10 -05:00
Matthew Brown
e97d4f85ee
Break large CallAnalyzer funtions apart
2019-02-03 16:21:37 -05:00
Matthew Brown
194bb31221
Fix #204 - allow missing param types to be added with Psalter
2019-02-02 14:16:49 -05:00
Matthew Brown
3a01afbe0a
Refine inferred type when possible
2019-02-02 12:10:52 -05:00
Matthew Brown
db89b3cc3f
Add initial support for fixing MissingParamType
2019-02-02 11:28:48 -05:00
Matthew Brown
509709d6bc
Fix #1267 - flesh out self static property types
2019-02-01 08:59:01 -05:00
Brown
fd88f00526
Fix a few small bugs
2019-01-31 17:48:48 -05:00
Brown
2054e3753f
Fix #1260 - improve handling of ArrayAccess assignment
2019-01-31 12:45:47 -05:00
Brown
c195e8fd21
Add more nuanced analysis of array access fetch
2019-01-30 15:40:37 -05:00
Brown
661c7ee707
Fix #1256 - detect illegal closure use
2019-01-30 11:36:21 -05:00
Matthew Brown
bfb2a5c19e
Fix #1257 - transform docblock types for magic methods to something more meaningful
2019-01-30 09:46:23 -05:00
Brown
9edbae2bdc
Fix possible fatal when builtin function is called in array_filter
2019-01-28 17:54:50 -05:00
Brown
a801923502
Add support for SplQueue templating
2019-01-28 12:27:04 -05:00
Matthew Brown
45058ea494
Fix possible crash when class-string class doesn’t exist
2019-01-28 01:12:41 -05:00
Matthew Brown
be06393b9c
Fix #1251 - allow instanceof comparisons to class strings
2019-01-27 14:10:33 -05:00
Matthew Brown
16c2a0f899
Fix #1246 - check @var annotations
2019-01-26 17:30:44 -05:00
Matthew Brown
22ee72808a
Remove a bunch of hacks around generic offsets
...
Also fixes #1245
2019-01-26 16:58:49 -05:00
Brown
c9e1df510e
Fix #1241 - allow negative string offsets on a string
2019-01-25 10:23:50 -05:00
Brown
5352084188
Fix #1234 - apply @template-extends to inherited method signatures
2019-01-24 16:09:04 -05:00
Brown
8a97e32e16
Add code to make handling interfaces with magic get/set
...
Ref #1228
2019-01-23 16:58:50 -05:00
Brown
60e9d4f245
Don’t give up after method_exists if static method exists
2019-01-23 15:50:12 -05:00
Matthew Brown
8bc17e47be
Fix #1227 - allow genric params in @psalm-assert
2019-01-22 23:42:54 -05:00
Brown
51c6621925
Add property lookup
2019-01-22 11:10:37 -05:00
Matthew Brown
ea137fc20c
Don’t complain about mixed after unpacking arg
2019-01-21 17:42:25 -05:00
Matthew Brown
e0067e53c5
Fix param chosen to be expected
2019-01-21 17:35:55 -05:00
Matthew Brown
1b0c426c52
Improve error message when type cannot be inferred, fixes #1110
2019-01-21 17:29:12 -05:00
Matthew Brown
5eb0bb8126
Make foreach var annotation use more cautious
2019-01-20 11:49:13 -05:00
Matthew Brown
681391f970
Fix #1220 - improve constant resolution
2019-01-20 09:52:26 -05:00
Matthew Brown
0ac7d106a3
Fix #1221 - no TypeDoesNotContainType in catch or finally
2019-01-20 09:27:46 -05:00
Matthew Brown
7fa05abb5a
Remove unused vars
2019-01-20 01:52:58 -05:00
Matthew Brown
7dfcefd35d
Support intersections on LHS of static calls
2019-01-19 23:25:23 -05:00
Matthew Brown
394d6509c6
Restrict class-string types to named objects (and intersections)
2019-01-19 22:46:06 -05:00
Matthew Brown
ed68cb973d
Fix #1109 - add bad usort protection
2019-01-19 18:11:49 -05:00
Matthew Brown
9c5ef33997
Allow @property to override parent class property type
...
Fixes #1214
2019-01-19 14:26:27 -05:00
Matthew Brown
ee2b06ac43
Add initial support for @param-out
2019-01-19 13:32:43 -05:00
Matthew Brown
545c7e3cba
Fix #1211 - allow docblocks to override foreach type earlier
2019-01-19 11:31:51 -05:00
Matthew Brown
94af3b6c51
Add automatic inheritance to properties
...
Fixes #1210
2019-01-19 10:09:26 -05:00
Matthew Brown
b313971935
Remove unused code
2019-01-18 11:57:52 -05:00
Matthew Brown
eddaaea01b
Add support for static @method annotations
2019-01-18 11:37:52 -05:00
Matthew Brown
22ec7e537c
Fix #1208 - respect inheritance when combining in boolean operation
...
Also fixes issue reconciling inside trait
2019-01-18 10:08:16 -05:00
Matthew Brown
4ec7903e8b
Fix #390 - add support for object{foo:int, bar:string} annotation
2019-01-18 00:56:24 -05:00
Brown
d78c70d521
Add better messaging for MixedMethodCall
2019-01-17 14:04:40 -05:00
Brown
1ac51fcea6
Allow binding params of extended templates
...
Fixes #1207
2019-01-16 12:07:30 -05:00
Brown
8d61cb4816
Fix #1200 - no fatal error in array_map when not checking functions
2019-01-15 17:53:23 -05:00
Brown
f5a81249e0
Fix #1202 - don’t allow undefined constants in enums
2019-01-15 11:31:13 -05:00
Matthew Brown
3ca5ec9281
Fix templated class conversion allowing child class
2019-01-13 14:40:21 -05:00
Matthew Brown
bd9f2ec546
Add separate issue type for undefined interface method
2019-01-13 13:07:53 -05:00
Matthew Brown
0cca0d76cb
Fix #813 - allow constant array to be refined with isset
2019-01-13 11:54:39 -05:00
Matthew Brown
7e0928d775
Fix #833 - warn on some invalid operands
2019-01-13 10:15:15 -05:00
Matthew Brown
e9b7c9e08b
Fix #1129 - mock class method arguments should be evaluated
2019-01-13 09:49:34 -05:00
Matthew Brown
9ef1ce1535
Make @template-extends more robust
2019-01-12 18:18:23 -05:00
Matthew Brown
a49b5af3e9
Refactor the method call analyzer a little
2019-01-12 09:13:54 -05:00
Brown
1fddc19172
Add initial support for property types
2019-01-11 17:21:50 -05:00
Brown
cdbc63c99a
Fix #1195 - check assignments in byref
2019-01-11 14:57:21 -05:00
Brown
bf327f4933
Prevent echo removing all types
2019-01-11 14:46:03 -05:00
Brown
4ec8d1a8dd
Fix #1198 - add support for template param extends checks
2019-01-11 10:55:44 -05:00
Matthew Brown
d891c068b4
Fix #1197 - add support for method templating without override
2019-01-11 09:35:32 -05:00
Matthew Brown
ff958ef643
Fix inheritance of method params
2019-01-11 08:54:10 -05:00
Brown
9947bc56f6
Fix Psalm errors and improve error output
2019-01-10 19:18:02 -05:00
Brown
ddc2637fc5
Add support for @template-extends Foo<SomeClass>
2019-01-10 17:58:32 -05:00
Brown
f108badd03
Fix #1067 - add support for @template-extends
2019-01-10 16:59:44 -05:00
Brown
b8d822cd26
Prohibit leaking of template params across class boundaries
2019-01-10 12:13:49 -05:00
Matthew Brown
01e41951e7
Support backslash in is_a/is_subclass_of string name
2019-01-09 08:42:27 -05:00
Matthew Brown
11bfaaa5f7
Prevent crash in constructor checks
2019-01-09 08:35:53 -05:00
Brown
43bbd739a2
Fix generic param fetches
2019-01-08 16:55:53 -05:00
Matthew Brown
b6865b130b
Catch exception in more places
2019-01-08 09:57:14 -05:00
Matthew Brown
a89a201c71
Fix #1180 - array key maths was wrong
2019-01-08 09:56:54 -05:00
Matthew Brown
dfba6e0dec
Fix #1181 - prevent allowed memory errors with large conditionals
2019-01-08 09:19:33 -05:00
Brown
be337a03cf
Simplify output of method call complaints
2019-01-07 16:38:37 -05:00
Brown
14f456e160
Fix #1176 - always evaluate assignments in unknown function calls
2019-01-07 12:24:44 -05:00
Matthew Brown
bcbede07ba
Fix issue with do analysis while loops
2019-01-07 01:15:30 -05:00
Matthew Brown
a6357b413c
Don’t complain when rescanning file with function in
2019-01-06 17:03:13 -05:00
Matthew Brown
9c9e57cf6b
Fix #1153 - ignore redundant conditions in finally block
2019-01-06 12:39:18 -05:00
Matthew Brown
b19dd25881
Fix #742 - infer template type from closure
2019-01-06 12:16:09 -05:00
Matthew Brown
90e1648d5b
Fix #979 - be more conservative about method_exists handling
2019-01-06 09:36:25 -05:00
Matthew Brown
4d6031b39b
Fix #1172 - treat is_subclass_of similarly to is_a
2019-01-05 16:58:34 -05:00
Matthew Brown
c7723df8ff
Allow gettype vars to be compared to strings
2019-01-05 16:23:18 -05:00
Matthew Brown
8024b4e275
Add support for $a::class
2019-01-05 15:12:42 -05:00
Matthew Brown
f5378bdca8
Improve function call resolution
2019-01-05 14:50:11 -05:00
Matthew Brown
6f1d56a80f
Upcast iterables to traversables when used in a templated class string
2019-01-05 10:32:39 -05:00
Matthew Brown
9d8c2792e2
Add array-key type and improve general type handling
...
Fixes #1144
2019-01-05 00:15:53 -05:00
Matthew Brown
2dc3d9651f
Separate iterable into its own type
...
Fixes #1151
2019-01-04 14:54:40 -05:00
Matthew Brown
87052537cf
Fix #1167 - don’t worry about AbstractInstantiation when it could be a descendant
2019-01-04 12:28:00 -05:00
Matthew Brown
e5559e3012
Allow callables to be plain objects, and vice versa
...
Previously Psalm required they be *known* objects
2019-01-04 08:04:26 -05:00
Brown
53749bd5c5
Do better at finding things that exit
2019-01-02 18:14:47 -05:00
Brown
2b4b55fd33
Add support for @return no-return
...
Fixes #1155
2019-01-02 17:05:39 -05:00
Brown
69d9fd7e28
Fix regression when reasoning about class strings
2019-01-02 11:35:49 -05:00
Matthew Brown
c4d024a72d
Check variable static calls
...
Fixes #1142 and #1160
2019-01-02 09:00:45 -05:00
Matthew Brown
901596281c
Fix #1143 - check some variable new calls
2019-01-02 06:58:49 -05:00
Matthew Brown
6fbf395f70
Fix #1152 - don’t complain about trait class-string comparisons
2019-01-01 21:00:34 -05:00
Matthew Brown
10a36def96
Fix issue with by-ref args
2018-12-21 13:53:22 -05:00
Matthew Brown
fab4d135b2
Fix static calls on class_aliased classes
2018-12-21 11:39:28 -05:00
Matthew Brown
947e3bf0f1
Fix crashes when analysing aliased class instances
2018-12-21 11:32:44 -05:00
Matthew Brown
c3a1e77a53
Fix errors in doctrine/dbal
2018-12-20 01:06:43 -05:00
Brown
fb848d62e9
Add checks for if (count($a)) and if (count($a) [operator] [number])
2018-12-19 16:15:19 -05:00
Brown
8e5e3564bc
Fix erroneous redundant condition warning
2018-12-19 16:10:09 -05:00
Matthew Brown
ea89a6ba29
Revert "First pass"
...
This reverts commit 9ed047234f
.
2018-12-19 08:45:14 -05:00
Matthew Brown
9ed047234f
First pass
2018-12-19 01:59:14 -05:00
Matthew Brown
13e14b3162
Remove code that was breaking things
2018-12-19 00:28:11 -05:00
Matthew Brown
ca6149ed17
Improve treatment of templated params within function analysis
2018-12-17 23:29:27 -05:00
Brown
7b03e0159c
Prevent invalid static invocation
...
Fixes #1134
2018-12-17 17:48:13 -05:00
Brown
ca1a615026
Don’t call reconciliation on empty vars
2018-12-17 15:23:56 -05:00
Brown
699d763cc1
Make isset($a[foo]) imply $a is not a string
2018-12-14 18:52:29 -05:00
Brown
b7d4db892c
Fix #1130 - improve handling of invalid array offsets
2018-12-14 15:10:10 -05:00
Matthew Brown
a8851ff425
Improve handling of T::class when mixed is passed
2018-12-13 01:54:15 -05:00
Matthew Brown
8b5e8402a1
Add support for @param T:class $foo
2018-12-13 00:09:01 -05:00