1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-13 17:57:37 +01:00
Commit Graph

212 Commits

Author SHA1 Message Date
Brown
a4d57e5524 Fix #2018 - prevent fatal error on class_aliased class reference 2019-08-15 10:17:27 -04:00
Brown
3d01708c6c Improve backtrace of property-involved issues 2019-08-14 11:47:58 -04:00
Brown
e92896f145 Fix taint records 2019-08-14 09:52:59 -04:00
Matthew Brown
600999a3a8 Add better typing 2019-08-14 00:47:57 -04:00
Brown
c3949e3194 Improve taint protection for exec-related commands 2019-08-13 19:18:50 -04:00
Brown
d6e084ec9c Remove false-positive for callmap function arg 2019-08-13 14:53:31 -04:00
Brown
55cfbdcd5f Fix erroneous complaint for str_replace 2019-08-13 14:26:25 -04:00
Brown
b5614d03f8 Add detection for unused function calls 2019-08-13 13:15:23 -04:00
Matthew Brown
d5b026839c Add support for different taint types ref #1990 2019-08-12 23:16:05 -04:00
Matthew Brown
dec612a47e Remove blank line 2019-08-08 23:06:52 -04:00
Matthew Brown
53817ed40b Fix #1991 - allow overlapping code to subsume manipulations inside 2019-08-08 22:58:54 -04:00
Brown
955899ade0 Builtin functions are assumed to be pure 2019-08-07 15:21:15 -04:00
Brown
16a1dc8538 Fix errors 2019-08-06 18:56:36 -04:00
Brown
14b37b95af Fix potential recursion 2019-08-06 17:29:44 -04:00
Brown
fc8d2bd563 Do more taint creation for magic properties 2019-08-06 14:27:21 -04:00
Brown
6eb62591ab Specialise calls when functions are pure 2019-08-05 18:33:33 -04:00
Matthew Brown
b2c0993cdc Add framework for taint analysis to Psalm
Ref #611
2019-08-04 10:37:36 -04:00
Matthew Brown
c76380174f Fix infinite recursion on property types 2019-07-22 23:54:33 -04:00
2e3s
f15cc7dd5b Mark private properties unused when referenced only in constructor (#1962)
* Mark private properties unused when referenced only in constructor

If a private property is used only in constructor then most likely
it's a dead code since there is no need to have the class property.
But such static properties can be accessed between the calls.

* Ignore the private property issue on alter

* Fix the related dead code psalm

* Add a missing condition into the test
2019-07-21 23:29:16 -04:00
Tyson Andre
5d5a9c6eac Remove redundant casts and unused use statements (#1955)
* Remove redundant casts

(not sure about older versions of php-parser)

* Remove unused use statements
2019-07-18 23:37:36 -04:00
Bruce Weirdan
e0a59ce117 Fixed PHP 7.4 related issues (#1957)
- s/fn/f/g (fn is a reserved keyword in 7.4)
- ReflectionType::__toString() warning (this method is deprecated in 7.4)

Note that some issues are caused by `phpspec/propecy` code and will be
fixed when phpspec/propecy#432 lands. Most were caused by
`ReflectionType::__toString()` usage in
`Psalm\Internal\Codebase\Reflection` though.
2019-07-18 23:36:39 -04:00
Matthew Brown
74e1b521a5 Add support for completing builtin class names
Fixes #1863
2019-07-17 22:50:57 -04:00
Matthew Brown
ab50c6ce2e Fix #1949 - check that aliased name doesn’t exist before transforming 2019-07-17 20:33:44 -04:00
Sergey Melesh
af875439e7 Inherit throws docblock from parent class by default (#1947) 2019-07-14 17:29:04 -04:00
Sergey Melesh
ee1387473f Fix throws docblock inheritance (#1945) 2019-07-13 10:10:51 -04:00
Brown
12eeb8b320 Fix #1935 - clear stub grandchildren 2019-07-11 18:23:02 -04:00
Brown
7268558aa7 Prevent unnecessary warnings 2019-07-11 11:07:39 -04:00
Matthew Brown
da42be175f Apply PHPCS fixes
Fixes #1880
2019-07-05 16:27:53 -04:00
Matthew Brown
422d9944d8 Fix #1903 - inherit @method from parent interfaces 2019-07-04 22:39:28 -04:00
Ilija Tovilo
67c3726254 Implement signature help - closes #1841 (#1862)
* Implement signature help - closes #1841

* Add explicit signature count

* [LSP] Do analysis for every signatureHelp request

See here: https://github.com/vimeo/psalm/pull/1862#issuecomment-507007346

* Don’t language server information when checking property for init

* Fix signature help for functions

* Add try-catch around signature help Functions::getStorage()
2019-07-01 15:54:32 -04:00
Brown
e876feb0ea Allow users to pass file names to Function::getStorage 2019-07-01 14:20:14 -04:00
Matthew Brown
ca53019d6b Simplify class completion lookup
Ref #1822
2019-06-29 21:32:26 -04:00
Matthew Brown
6b7788b502 Fix FileAnalyzer memory leak 2019-06-29 21:06:21 -04:00
Tyson Andre
791b30a6d8 Fix redundant casts/conditions in psalm (#1874)
This includes a check for array_map that was accidentally an assignment
2019-06-29 12:32:44 -04:00
LeSuisse
f29826b958 Fully qualify constants and function calls (#1849)
This should give a small performance boost.
Part of #1837.

The change is enforced via phpcs and can be autofixed
with phpcbf.
2019-06-26 16:52:29 -04:00
Brown
16bf5f11e1 Fix #1845 - prevent string return when expecting template 2019-06-25 15:06:02 -04:00
Matthew Brown
d96246a824 Improve template handling robustness 2019-06-25 09:06:23 -04:00
Matthew Brown
c0b86bd40d Use uppercase template_type_extends keys 2019-06-24 23:43:04 -04:00
Brown
69b05f5052 Improve handling of parent method calls 2019-06-24 17:45:10 -04:00
Matthew Brown
766b1b0384 Add reference, not type
Ref #1835
2019-06-23 09:10:43 -04:00
Matthew Brown
37ffd6dad6 Fix #1832 - add references to docblock types 2019-06-23 08:47:49 -04:00
Brown
aa6677a177 Add autocompletion for some classes
Ref #1822
2019-06-21 17:10:35 -04:00
Matthew Brown
7fc11af49e Fix docblocks with @andrew-demb’s suggestions 2019-06-16 09:12:32 -04:00
Matthew Brown
41cdde514f Fix #1784 - detect missing end brackets 2019-06-15 17:57:40 -04:00
Matthew Brown
2d5f332ebf Fix #1781 by improving handling of callmap options 2019-06-15 16:10:48 -04:00
Brown
edf3307f84 Fix Psalm errors 2019-06-14 15:55:23 -04:00
Brown
1bc1af140f Move method calls outside classes and __CLASS__ constants 2019-06-14 15:54:15 -04:00
Brown
58b6ce3483 Fix bugs when moving methods that reference each other 2019-06-14 14:41:44 -04:00
Brown
844442e039 Fix #1780 - set open file contents on save 2019-06-13 15:25:55 -04:00
Brown
9c4599a0f0 Add better support for inheriting docblocks 2019-06-11 11:19:57 -04:00