orklah
97a6abd823
don't anonymize call to count to allow assertions on count to be retrieved
2022-02-13 22:38:38 +01:00
AndrolGenhald
fd0ecf2528
Rename variable to be consistent with existing convention.
2022-02-13 15:34:21 -06:00
AndrolGenhald
32c389482c
Fix issue with nested try
block and add more tests.
2022-02-13 15:30:06 -06:00
AndrolGenhald
7b1599d783
Fix false positive for unused variable in try ( fixes #7613 ).
2022-02-13 15:14:59 -06:00
orklah
8a49caccac
Merge pull request #7663 from orklah/never2
...
Consistency for empty reconciliations
2022-02-13 20:01:45 +01:00
orklah
093d9b2821
allow use of an empty reconciliation if the type is from docblock
2022-02-13 19:44:12 +01:00
orklah
5f1b796af9
redundant condition
2022-02-13 19:38:44 +01:00
orklah
586c70c8d3
Reconcile IsNotType between EnumCase and NamedObject
2022-02-13 19:38:44 +01:00
orklah
cf25363fa1
empty reconciliation should return never or mixed depending of the source of the type
2022-02-13 19:36:09 +01:00
orklah
59d3d2aa31
Merge pull request #7655 from orklah/enumCollapsing
...
Enum collapsing
2022-02-13 11:01:07 +01:00
orklah
954884eb48
consistency between TernaryAnalyzer and IfElseAnalyzer
2022-02-13 10:52:22 +01:00
Bruce Weirdan
52ad607c96
Merge pull request #7661 from weirdan/fix-array_fill_keys
2022-02-13 11:05:05 +02:00
Bruce Weirdan
edddc87002
Merge branch '4.x' into upstream-master
2022-02-13 07:14:23 +02:00
Bruce Weirdan
4ee8a80a17
Use array_fill_keys
...
There was a number of calls to `array_map(fn()=>true, array_flip($array))` that got replaced with a simpler (and more performant) `array_fill_keys($array, true)`
2022-02-13 07:09:28 +02:00
Bruce Weirdan
dc776d3ada
Suppress false-positive
2022-02-13 00:48:58 +02:00
Bruce Weirdan
45a19b3f3c
Honour global function suppressions for UndefinedFunction
...
Fixes vimeo/psalm#7610
2022-02-13 00:22:55 +02:00
orklah
60feb5fd71
allow collapsing enum cases under named object in combiner
2022-02-12 20:31:39 +01:00
orklah
1d224cebf7
Merge pull request #7651 from orklah/new
...
remove totallyTyped
2022-02-12 10:29:23 +01:00
orklah
a915ef5853
also remove a from_calculation flag which was scheduled for removal in Psalm 5
2022-02-12 10:19:39 +01:00
orklah
85fca56850
remove totallyTyped
2022-02-12 10:19:14 +01:00
orklah
6355597250
fix CS
2022-02-12 10:05:53 +01:00
orklah
e6d491a4ab
Merge remote-tracking branch 'upstream/master' into upstream-master7
2022-02-12 10:01:08 +01:00
orklah
fac55576ab
Merge remote-tracking branch 'upstream/4.x' into upstream-master7
2022-02-12 09:59:55 +01:00
orklah
a3852b8a55
Merge pull request #7650 from orklah/totallytyped
...
deprecate totallyTyped
2022-02-12 09:56:39 +01:00
orklah
dbf47b16c3
deprecate totallyTyped
2022-02-12 09:30:37 +01:00
orklah
c13a536386
Merge pull request #7614 from kkmuffme/add-phpredis-stubs
...
add phpredis stubs
2022-02-11 23:15:48 +01:00
sasezaki
c46818ac24
Removed unnecessary var annotation
2022-02-11 22:51:31 +01:00
sasezaki
d0baffb534
DOMElement instead of DomElement - https://php.net/DOMElement
...
to avoid composer-require-check reports false-positive,
just did - find src/ -type f -exec sed -i -e 's/DomElement/DOMElement/g' {} \;
2022-02-11 22:51:31 +01:00
m1ke
92aedd6f7f
Fix cherry pick issues
2022-02-11 11:27:01 +00:00
m1ke
fc694d7a98
Allow psalm to load threads from the config
2022-02-11 11:23:17 +00:00
m1ke
a688bd6da3
Use config threads if lower than detected threads
2022-02-11 11:23:09 +00:00
m1ke
810880c71b
Alter order of precedence and upated docs to match
2022-02-11 11:12:36 +00:00
Bruce Weirdan
11e60fa261
Merge branch '4.x' into upstream-master
2022-02-11 03:51:48 +02:00
Matthew Brown
6d057669fc
Fix #6683 by improving simplification of CNF ( #7631 )
2022-02-10 19:37:42 -05:00
Matthew Brown
b49b5f1c20
Make error message for truthy/falsy more accurate
2022-02-10 18:46:22 -05:00
Bruce Weirdan
161519883a
Merge pull request #7623 from weirdan/finalize-types
2022-02-11 00:27:10 +02:00
Matthew Brown
c885dbcbe0
Prevent duplicate type comparison errors
2022-02-10 01:04:14 -05:00
Bruce Weirdan
7c344366a3
Fix RedundantCondition
2022-02-10 01:44:50 +02:00
Bruce Weirdan
26e238cdc5
Finalize types nodes
2022-02-10 01:44:25 +02:00
orklah
9984397766
Merge pull request #7622 from orklah/assertions
...
consistency in AssertionFinder
2022-02-09 22:53:28 +01:00
orklah
511177556b
only remove int from array-key if we're dealing with a general Int
2022-02-09 22:46:41 +01:00
orklah
a236aa2a41
only remove int from array-key if we're dealing with a general Int
2022-02-09 22:44:26 +01:00
Matthew Brown
2eca28c912
Remove more unused code from LoopAnalyzer
2022-02-09 16:37:15 -05:00
orklah
1c74774c40
consistency
2022-02-09 21:48:33 +01:00
orklah
0f1efa9079
documentation
2022-02-09 21:15:22 +01:00
Matthew Brown
5575fa1e32
Remove unnecessary method
2022-02-09 12:18:15 -05:00
Office
432d0be658
load phpredis stubs
2022-02-09 15:56:51 +01:00
Bruce Weirdan
21e6371ce2
Strip colours from success message
...
Fixes vimeo/psalm#7619
2022-02-09 15:35:40 +02:00
Matthew Brown
9d8b6d641b
Remove more unused code
2022-02-08 18:20:14 -05:00
Matthew Brown
48b702b76a
Remove some unnecessary code
2022-02-08 17:12:18 -05:00
Matthew Brown
e130dd9b1c
Fix too-long line
2022-02-08 16:28:21 -05:00
Matthew Brown
e35e6fe992
Improve naming of variables
2022-02-08 16:25:33 -05:00
Matthew Brown
457abc6e13
Don’t subtract int from array-key if not equality
2022-02-08 11:24:05 -05:00
Matthew Brown
13824d5a33
Fix awkward workaround for loop assignment map
2022-02-08 10:59:29 -05:00
Matthew Brown
eda8e04a81
Narrow graph arrayfetch dataflow
2022-02-08 10:59:29 -05:00
Bruce Weirdan
b25a93e753
Finalize virtual nodes
2022-02-07 02:05:47 +02:00
Bruce Weirdan
958d1ca695
Finalize storages
2022-02-06 23:09:03 +02:00
Bruce Weirdan
a331ac0b21
Finalize issues
2022-02-06 00:27:18 +02:00
Bruce Weirdan
3e837cabd0
Finalize (and internalize) more classes
2022-02-05 23:51:03 +02:00
Tomasz Kusy
124aa22fe9
Resolve __DIR__ / __FILE__ when const/variable is used for include CS fix fix fix :)
2022-02-04 20:27:45 +01:00
Tomasz Kusy
8da45aa7d8
Resolve __DIR__ / __FILE__ when const/variable is used for include CS fix fix
2022-02-04 20:26:06 +01:00
Tomasz Kusy
b73f2c96d8
Resolve __DIR__ / __FILE__ when const/variable is used for include CS fix
2022-02-04 19:43:55 +01:00
Tomasz Kusy
bcbfbed072
Resolve __DIR__ / __FILE__ when const/variable is used for include
2022-02-04 19:39:39 +01:00
Matthew Brown
3a298d028e
Rename getArrayVarId to getExtendedVarId
2022-02-04 12:49:12 -05:00
AndrolGenhald
5b469ca577
Fix crash when assigning reference to unknown array offset.
2022-02-04 08:32:35 -06:00
AndrolGenhald
588d9e08bc
Fix extension capitalization issue, add extensions to version message.
2022-02-03 11:34:50 -06:00
phptest2
582624a932
improving error message for Could not resolve config path
...
$directory_path is false, so better use $prospective_directory_path in the error message.
2022-02-03 17:58:12 +01:00
Matthew Brown
8098755ce5
Remove comma
2022-02-02 11:29:31 -05:00
Matthew Brown
b382d7db3c
Remove some unnecessary code around taint analysis
2022-02-02 11:25:03 -05:00
Matthew Brown
2b81990259
Simplify var naming
2022-02-02 11:25:02 -05:00
Vincent
3c3e692e7e
AtomicStaticCallAnalyzer: clear tmp var from context ( fix #7556 )
2022-02-02 13:51:54 +01:00
orklah
1c2ffc81c2
tweaks
2022-02-01 22:49:20 +01:00
Bruce Weirdan
dadb1f2167
Merge pull request #7539 from vimeo/revert-7363-81_returntypewillchange
2022-02-01 01:03:09 +02:00
Bruce Weirdan
f61193b798
Reinstate MethodSignatureMustProvideReturnType
...
It's never emitted, but is there for BC.
2022-01-31 23:38:15 +02:00
orklah
68e67aeb10
Merge pull request #7546 from orklah/impure-callable
...
Handle first class callable on unknown functions
2022-01-31 22:02:35 +01:00
orklah
2e01e9b7cd
Merge pull request #7396 from Patrick-Remy/feat/key-of-value-of-improvements
...
feat: make key-of/value-of usable with non-const arrays
2022-01-31 21:39:01 +01:00
orklah
a598efb4ab
Handle first class callable on unknown functions
2022-01-31 21:36:01 +01:00
adrew
e284b91b82
Remove redundant flag from SimpleTypeInferer
2022-01-31 23:03:34 +03:00
adrew
121a801616
Fix object constant inference
2022-01-31 23:03:34 +03:00
orklah
48e09ab308
fix
2022-01-31 20:55:53 +01:00
Patrick Remy
51d4bf556a
fix: replace template args in key-of/value-of
...
Extend TTemplateKeyOf from Atomic instead of Scalar, to ensure it is
only compared in AtomicTypeComparator to reduce duplicate code.
2022-01-31 20:53:36 +01:00
orklah
fc281672ea
fix wrong detection of purity
2022-01-31 20:52:25 +01:00
Matthew Brown
fcfd4d30f3
Simplify passing in template result for calls
2022-01-31 09:36:40 -05:00
Bruce Weirdan
603714518b
Revert "PHP 8.1: Report missing typehints in overridden native methods"
2022-01-31 14:37:42 +02:00
ada778e8df
Remove unused field
2022-01-31 10:06:32 +01:00
8d0c1c62e8
Ensure all template parameters are specified in classes, interfaces, traits
2022-01-31 10:06:31 +01:00
Bruce Weirdan
997592de64
Merge pull request #7530 from ohader/issue-7528
2022-01-31 10:36:47 +02:00
Bruce Weirdan
b51cb75f76
Merge pull request #7535 from ohader/issue-7534
2022-01-31 10:34:57 +02:00
Oliver Hader
c4c7138329
Update src/Psalm/Plugin/EventHandler/Event/BeforeStatementAnalysisEvent.php
...
Co-authored-by: Bruce Weirdan <weirdan@gmail.com>
2022-01-31 07:53:44 +01:00
Oliver Hader
ffafccc2ca
Update src/Psalm/Plugin/EventHandler/BeforeAddIssueInterface.php
...
Co-authored-by: Bruce Weirdan <weirdan@gmail.com>
2022-01-31 07:52:33 +01:00
Oliver Hader
995ecd0964
Update src/Psalm/Plugin/EventHandler/Event/BeforeAddIssueEvent.php
...
Co-authored-by: Bruce Weirdan <weirdan@gmail.com>
2022-01-31 07:52:24 +01:00
Oliver Hader
6fd31cb5fa
[TASK] Remove deprecated AfterFunctionLikeAnalysisEvent::getClasslikeStorage
2022-01-31 00:34:03 +02:00
Bruce Weirdan
a2977a5ca9
Merge branch '4.x' into upstream-master
2022-01-31 00:16:27 +02:00
Oliver Hader
ff07a8d662
[TASK] Use final event class declarations
2022-01-30 19:29:12 +01:00
Oliver Hader
f5986950a2
[FEATURE] Introduce BeforeStatementAnalysisEvent
...
As counterpart to existing `AfterStatementAnalysisEvent` - invoked in
`\Psalm\Internal\Analyzer\StatementsAnalyzer` - this changed introcued
a corresponding `BeforeStatementAnalysisEvent`.
Resolves : #7534
2022-01-30 19:27:19 +01:00
orklah
31941d15e2
Merge pull request #7533 from orklah/emptyBack
...
add back empty keyword
2022-01-30 18:56:22 +01:00
orklah
84d9b5e10c
add back empty
2022-01-30 18:43:44 +01:00
Oliver Hader
e3602bbfe1
[FEATURE] Allow to intercept adding issue in IssueBuffer
...
This change introduces new `BeforeAddIssueEvent` which is invoked
from `IssueBuffer::add`, which allows to collect and intercept code
issue in a generic way.
Resolves : #7528
2022-01-30 17:46:08 +01:00
Oliver Hader
1e072cb904
[TASK] Add AfterFunctionLikeAnalysisEvent::getFunctionlikeStorage
...
AfterFunctionLikeAnalysisEvent's method `getClasslikeStorage` actually
returned the current `FunctionLikeStorage`. This change streamlines the
naming and adds corresponding `getFunctionlikeStorage` method.
Method `getClasslikeStorage` is deprecated in will be removed
in Psalm v5.0.
2022-01-30 16:55:39 +01:00
orklah
f93bd10c61
Merge pull request #7517 from orklah/fixEmptyArray
...
Fix empty array
2022-01-30 16:14:24 +01:00