Samuel Mortenson
e07337650b
Make taint source keys unique to the added taints. ( #5444 )
2021-03-20 15:42:24 -04:00
Matt Brown
04f3e29f94
Expand documentation method return type to ensure we’re giving a fair shot
2021-03-18 11:07:02 -04:00
Matt Brown
3046468d1e
Add hints for MixedAssignment issues
2021-03-17 01:10:42 -04:00
Claas Augner
3c66b755e2
Always return type inference summary, even if no files were analyzed due to caching ( #5329 )
...
* Fix #5319 – Always return type inference summary
Even if no files were analyzed (e.g. due to caching).
* fix code style
2021-03-06 17:20:01 -05:00
Matt Brown
f5ed12f038
Fix tests by removing references
2021-02-28 23:58:21 -05:00
Matt Brown
3f4bb25a35
Simplify reference map updates
2021-02-28 10:36:36 -05:00
Matt Brown
ad82c93edb
Fix #5297 - be more sensitive to additions and deletions in language server mode
2021-02-28 01:36:06 -05:00
Bruce Weirdan
26978fcea1
Convert PHP errors / warnings / notices to exceptions ( #5260 )
...
* Sort uses
* Add ErrorHandler
* Use new error handler
* Drop old exception handler
* Suppress error-triggered exceptions during external autoload calls
2021-02-22 09:19:34 -05:00
Matt Brown
3106635953
Fix inference of conditional types when wildcard constant given
2021-02-20 12:21:52 -05:00
Matt Brown
bd6efd7cf2
Improve completion for namespaced classes
...
cc @joehoyle - this mainly allows us to get a correct list when the user starts typing Foo (without the new before it) inside a namespace
2021-02-14 23:25:13 -05:00
Matt Brown
6b53e79505
When there’s an irrecoverqable syntax error invalidate all issues in the file
2021-02-14 21:16:12 -05:00
Matt Brown
1d5020f59f
Only match functions where the first character has the same case as stub
...
cc @joehoyle - this prevents seeing lots of date_* functions when writing Date
2021-02-14 20:08:31 -05:00
Joe Hoyle
4077de2c93
Add completions for functions ( #5128 )
...
* Add completions for functions
Provide autocompletions in the LSP for all global functions and functions from namespaces used in the current context.
* Uncomment code
* PHPCS
* Simplify functions map
Co-authored-by: Matthew Brown <github@muglug.com>
* Switch to storing lowercase function string in array key
* Fix spacing
Co-authored-by: Matthew Brown <github@muglug.com>
2021-02-12 16:59:47 -05:00
Matt Brown
03665b9646
Revert "Correct Psalm’s concept of string emptiness"
...
This reverts commit 331ce8ead4
.
It was too hasty
2021-02-03 01:09:58 -05:00
Matt Brown
331ce8ead4
Correct Psalm’s concept of string emptiness
...
It contrasted with PHP’s idea
2021-02-02 23:07:51 -05:00
Matt Brown
15e87b13b8
Prevent infinite loop while scanning in some situations
2021-01-26 15:51:15 -05:00
Matt Brown
62a5a74640
Fix #5108 - prevent crash on 0 type
2021-01-26 14:06:43 -05:00
Matt Brown
dc7ffe2810
Fix long line
2021-01-24 14:02:55 -05:00
Joe Hoyle
531cd36767
Support completions on class references ( #5085 )
...
* Support compleitions on class references
This provides completions on class references (as opposed to initiated objects via the type map), so you can do `MyClass::` and get completitions for static methods and constants etc.
* Only provide completions for references that don't exist
2021-01-24 13:29:21 -05:00
Joe Hoyle
ba43e6d0f3
Remove file map cache when re-analyzing files ( #5084 )
...
* Remove file map cache when re-analyzing files
When the project is re-analyzed under the single thread condition (not using a process pool), the filemaps are not cleared before re-analyzing files. This means that file maps only get appended to. If you delete the contents of a file via the LSP, the file map will still be populated with all the old values for example.
In doing this I had to write a few more tests to check my assumptions too, so adding those additional tests.
* Rename test
* Formatting
* Formatting again!
2021-01-22 16:05:28 -05:00
Adrien LUCAS
6f1f680b2d
Add option to dump taint graph ( #5080 )
...
* Add option to dump taint graph
* Fix types
* Simplify types
Co-authored-by: Matthew Brown <github@muglug.com>
2021-01-22 16:04:15 -05:00
Bruce Weirdan
d659957b88
Resolve class aliases when accessing properties ( #5068 )
...
* Resolve class aliases when accessing properties
* Moved Properties::getClasslikeStorage() to ClassLikes::getStorageFor()
2021-01-21 19:38:17 -05:00
Vincent Langlet
c912b6c2b9
Catch InvalidArgumentException ( #5061 )
2021-01-20 17:42:45 -05:00
orklah
f9fccb2b2d
implement DTO for plugins ( #4881 )
...
* implement DTO for plugins
* introduce EventHandler + reintroduce legacy API for plugins
2021-01-06 09:05:53 -05:00
Matthew Brown
b3b2389aff
Ignore recently-deleted files for scanning
2021-01-04 19:00:44 +00:00
orklah
09fb141e49
Document lowercase-string when possible ( #4904 )
...
* document lowercase-string
* fix missing strtolower
2020-12-29 11:42:12 +00:00
Matt Brown
fbaaf05f48
Fix psl inheritance stuff cc @azjezz
2020-12-13 16:58:03 -05:00
Matt Brown
e6dad6e65f
Be smarter when choosing inherited param types
...
Ref #4803
2020-12-10 00:15:37 -05:00
Matt Brown
524084a64c
Tighten up rules arouund when mutation-free methods get memoised
2020-12-08 16:39:06 -05:00
Matt Brown
3f155792a7
Allow nested specialisation
2020-12-04 15:44:29 -05:00
Matt Brown
fd67d41120
Fix #4769 – don’t use unique ids for new generated nodes
2020-12-04 15:44:29 -05:00
Matt Brown
fb88145780
Fix #4767 - rescan directly-affected class-interface relationships
2020-12-04 01:19:51 -05:00
Matt Brown
1a629ccc82
Fix a few issues
2020-12-01 18:26:15 -05:00
Matt Brown
75a6d88773
Fix #4705 - clear documenting method ids when scanning stubs
2020-12-01 11:23:38 -05:00
orklah
a760a2418a
support shift and bitwise operations in constants ( #4740 )
2020-11-29 21:43:49 -05:00
Matt Brown
4d22723525
Break out replacement of templated types with their inferred result
2020-11-29 16:16:16 -05:00
Matt Brown
15a5bd5e29
Simplify storage and retrieval of extended template params
2020-11-29 15:05:32 -05:00
Matt Brown
b717356f95
Simplify more things
2020-11-27 17:48:39 -05:00
Matt Brown
2626f008be
Only show possibly unused params on methods that don’t extend others
2020-11-27 17:17:03 -05:00
Matt Brown
6db8132b4c
Simplify call analysers a bit
...
Ref #4714
2020-11-27 16:31:10 -05:00
Matt Brown
5f065d3d74
Turn template bound tuples into object
...
Ref #4714
2020-11-27 11:43:30 -05:00
orklah
b6a3282589
Detect redundant cast ( #4695 )
...
* detect redundant cast
* fix redundant cast issues
* fix redundant cast in tests
2020-11-25 12:04:48 -05:00
orklah
2bf25d5f50
Emit an issue when returning a Stringable object when a string is expected ( #4657 )
...
* Emit an issue when returning a Stringable object when a string is expected
* Fix issue in Psalm codebase
2020-11-24 00:18:24 -05:00
Markus Staab
e5493f59cd
Mark finfo_open and finfo_file as impure ( #4678 )
...
* Mark finfo_open and finfo_file as impure
* fix CS
2020-11-23 15:19:50 -05:00
Markus Staab
d151f1c36e
mark file_get_contents as impurce ( #4679 )
2020-11-23 11:33:30 -05:00
Markus Staab
387bfbd9e0
is_file
and is_dir
should be impure (#4676 )
...
* `is_file` and `is_dir` should be impure
* newline
Co-authored-by: Matthew Brown <github@muglug.com>
2020-11-23 09:53:39 -05:00
Matt Brown
8325317e16
Fix #4674 - is_readable should be impure
2020-11-23 08:54:11 -05:00
Matt Brown
9a03a9a5d0
Move param taint sink addition after arguuments have been analysed
2020-11-22 19:39:40 -05:00
Matt Brown
853432a6aa
Fix tests
2020-11-22 16:24:33 -05:00
Matt Brown
6399707dd6
Prevent flows through TaintedInput-suppressed files
2020-11-22 16:04:57 -05:00