kkmuffme
5eacd301e9
Fixed ReturnTypeWillChange false positive https://psalm.dev/r/91c6992bf1 with missing return type signature
2023-11-18 08:55:20 +01:00
kkmuffme
0252bbbd7c
Fixed https://psalm.dev/r/7f112fd745 - MethodComparator only reported an error for this if the parent class was user defined (= not in stubs), which is wrong, since this will cause a fatal error when running the code
2023-11-18 08:55:20 +01:00
kkmuffme
c5655c510d
Fix param providers for native methods not working Fix array_filter params callable incorrect required params depending on the 3rd argument value (at this commit psalm doesn't report an error, due to https://github.com/vimeo/psalm/issues/8438 , which gets fixed by this PR later on though) Fix https://github.com/vimeo/psalm/issues/3047 and further improve types for array_multisort and add errors for invalid params Fix SimpleTypeInferer failing on bitwise operations with constants
2023-11-18 08:55:20 +01:00
kkmuffme
ba79797627
Fix https://github.com/vimeo/psalm/issues/10371
2023-11-18 08:55:20 +01:00
kkmuffme
506fb9c773
Fix https://github.com/vimeo/psalm/issues/8919
2023-11-18 08:55:20 +01:00
kkmuffme
be85cb02b9
remove now invalid test
2023-11-18 08:55:20 +01:00
kkmuffme
f3e9263ea4
Fix array_filter callback type
...
Fix https://github.com/vimeo/psalm/issues/9068
2023-11-18 08:55:19 +01:00
Ivan Sidorov
e677523843
Fixing a collisions on annotations with mixins
2023-11-17 15:50:34 +00:00
Ivan Sidorov
8bb68e9b3f
Find properties and methods annotated by mixin
2023-11-17 15:50:34 +00:00
Ivan Sidorov
0c4b8a3c49
Find annotated magic static methods on traits
2023-11-17 15:50:34 +00:00
Ivan Sidorov
ceba3d889d
Find annotated magic static methods on parent class
2023-11-17 15:50:34 +00:00
Ivan Sidorov
75394c5037
Find declared methods on parent classes and traits
...
Partial revert commit 2f039f9072
2023-11-17 15:50:26 +00:00
Ivan Sidorov
d533bb8c2e
Ignore annotated magic static methods with usage object gap
...
Magic methods annotated by methods `__call` and `__callStatic`.
Magic static methods implemented in `__callStatic`
are not required implementation in `__call'.
2023-11-17 15:14:56 +00:00
Ivan Sidorov
715f6f51e1
Ignore annotated magic properties with usage static gap
...
In PHP is not exists methods for implementation magic static properties.
So, these magic static properties must not be presented.
2023-11-17 15:14:56 +00:00
Ivan Sidorov
1cfc343c43
Ignore declared static properties with usage object gap
...
Usage static properties in PHP is allow only by static gap.
2023-11-17 15:14:56 +00:00
Ivan Sidorov
6f19440b02
Fix text-labels with type of property
...
The labels for magic and declared properties must be equal.
2023-11-17 15:14:56 +00:00
Ivan Sidorov
650b8fcd1b
Tests of current behaviors in the auto-completion feature
2023-11-17 15:14:56 +00:00
kkmuffme
b0adeb463d
fix test
2023-11-13 20:37:48 +01:00
kkmuffme
88e3cda3b9
remove unused function, fix unusedVariable error after suppress
2023-11-13 20:24:58 +01:00
kkmuffme
6a0a9d1c15
fix failing test caused by psalm-suppress as this should be invalidCodeParse test
2023-11-13 19:08:04 +01:00
kkmuffme
dcd53cadab
Suppressing NoValue should not treat subsequent code as unevaluated
...
Fix https://github.com/vimeo/psalm/issues/10302
2023-11-13 18:57:41 +01:00
Ivan Sidorov
2f039f9072
Fix auto-completion with declared static method by DocBlock
2023-10-27 09:35:30 +00:00
Ivan Sidorov
d6faff2844
Fix auto comletion by partial property or method
2023-10-26 21:31:47 +00:00
Daniel Linjama
a375f441f2
fix @param-out with named arguments
2023-10-23 10:39:09 +03:00
3b66272aa0
More rector fixes
2023-10-21 20:45:09 +02:00
576e4d2bc4
Fix method calls and property accesses after extension_loaded
2023-10-19 11:16:20 +02:00
orklah
5a862784ac
Merge pull request #10289 from ging-dev/add-fix
...
Additional caching fixes
2023-10-17 20:32:03 +02:00
robchett
e2d1e83b87
Fix memory explosion with calls to method_exists
2023-10-17 19:15:23 +01:00
ging-dev
8ee875086f
chore: add failing test
2023-10-17 20:17:15 +07:00
ging-dev
0162e75ee8
fix : #10080
2023-10-17 02:43:22 +07:00
orklah
b432d812fb
Merge pull request #10274 from tuqqu/enum-case-value-type-from-class-constant
...
Fix inferring enum case value from a class constant
2023-10-16 20:25:11 +02:00
orklah
7a7d6a25af
Merge pull request #10242 from cgocast/5.x
...
Allow tainted numerics except for 'html' and 'has_quotes'
2023-10-16 20:17:39 +02:00
tuqqu
6039e2be9b
Fix for inferring enum case value from a class constant
2023-10-10 22:56:36 +02:00
orklah
ee4e8aa720
Merge pull request #10271 from klimick/type-check-nested-templates
...
Type check nested templates
2023-10-09 19:47:15 +02:00
orklah
3f7306d8df
Merge pull request #10254 from tuqqu/never-function-return-error-message
...
Fix error message for implicitly returning functions with `never` return type
2023-10-09 18:51:11 +02:00
klimick
a3df6505f0
Type check nested templates
2023-10-09 17:07:52 +03:00
cgocast
eea7c33309
Merge branch 'vimeo:5.x' into 5.x
2023-10-09 14:17:50 +02:00
tuqqu
a4cebb2cb8
Disallow never type for parameters
2023-10-08 20:47:37 +02:00
orklah
16be90c351
Merge pull request #10262 from robchett/negated_class_exist_convert_class-string_to_string
...
Negated class_exist check on class-string converts to string instead of mixed
2023-10-08 19:09:14 +02:00
orklah
67ac81e220
Merge pull request #10261 from robchett/allow_named_params_for_callables
...
Allow parameter names in callable docblocks with templates
2023-10-08 19:08:23 +02:00
robchett
d874aab881
Add alias support to psalm-check-type
2023-10-08 17:46:59 +01:00
robchett
c729fcd5c8
Negated class_exist check on class-string converts to string instead of mixed
2023-10-08 15:48:48 +01:00
robchett
fc7f846fbd
Fix test case for named variadic callable docblock
2023-10-07 16:59:43 +01:00
robchett
c71a252dee
Add tests for callable docblock parsing
2023-10-07 16:04:48 +01:00
tuqqu
2bc330976f
Add tests for never return type
2023-10-04 21:18:59 +02:00
tuqqu
9f9e5f1e18
Emit MethodSignatureMismatch when descendant does not return by reference
2023-10-03 03:41:11 +02:00
cgocast
2eca720e9d
Merge branch '5.x' of https://github.com/cgocast/psalm into 5.x
2023-10-02 15:13:07 +02:00
cgocast
94a98ccddd
Allow tainted numerics except for 'html' and 'has_quotes'
2023-10-02 15:08:26 +02:00
orklah
c67dce7d14
Merge pull request #10240 from ging-dev/cache
...
fix : #10239
2023-09-30 18:26:59 +02:00
ging-dev
c312c76050
chore: add test
2023-09-30 17:33:50 +07:00
orklah
db07b05156
Merge pull request #10231 from MidnightDesign/sprintf-stringable-values
...
Allow stringable objects in `sprintf()` values
2023-09-29 11:38:37 +02:00
Rudolph Gottesheim
c4c8ef53c4
Delete an invalid test
2023-09-29 11:27:36 +02:00
orklah
2d3a625379
Merge pull request #10230 from ging-dev/lsp
...
feat(LSP): Improve the autocomplete for nested array shape
2023-09-28 23:42:02 +02:00
orklah
f57088646b
Merge pull request #10191 from boesing/bugfix/inherited-conditional-return-types
...
Resolve inherited conditional return types
2023-09-28 23:08:20 +02:00
orklah
bbcf50396d
Merge pull request #10189 from boesing/feature/inherited-assertions-v2
...
Inherited assertions v2
2023-09-28 23:07:15 +02:00
Rudolph Gottesheim
aa04c0063b
Allow Stringable in sprintf() values
2023-09-28 10:23:02 +02:00
orklah
83485f3fcf
Merge pull request #10234 from tuqqu/block-mode-declare-check
...
Check for declare strict_types in block mode
2023-09-28 09:13:13 +02:00
orklah
a8ef5a213d
Merge pull request #10202 from gmessier/issue-handlers-priority
...
Issue handlers priority
2023-09-28 09:09:33 +02:00
orklah
a843c30950
Merge pull request #10207 from boesing/bugfix/issue-10203
...
Allow object assertions for `mixed` values
2023-09-28 09:08:43 +02:00
tuqqu
09fbe99f5b
Check for declare strict types block mode
2023-09-26 20:59:06 +02:00
ging-dev
45807e27b8
feat(LSP): Improve the autocomplete for nested array shape
2023-09-26 01:52:23 +07:00
Rudolph Gottesheim
3b775f4617
Allow class-string<T> where T is a union
2023-09-18 12:13:34 +02:00
robchett
03e8d19eec
Only the binary op 'plus' works with two arrays
...
Treat the result of any other operation as int|float
Fixes #2123
2023-09-16 15:55:59 +01:00
Maximilian Bösing
3e100b15d9
bugfix: allow object assertions for mixed
...
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2023-09-15 20:19:54 +02:00
Guillaume Messier
ae427fd60e
Add 'safe' methods to prevent overriding issueHandlers already defined in the configuration
2023-09-13 16:30:33 -04:00
Maximilian Bösing
eda55a2d27
qa: make assertions more strict as we do want exact matches
...
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2023-09-11 11:14:12 +02:00
Maximilian Bösing
3dc00518c6
qa: add test for inherited conditional templated return types
...
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2023-09-10 23:57:02 +02:00
Maximilian Bösing
56b719b1e6
qa: remove unnecessary lines from tests
...
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2023-09-10 22:17:30 +02:00
Maximilian Bösing
f6f7c20f36
qa: extend inherited assertion test
...
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2023-09-10 22:17:29 +02:00
Bruce Weirdan
ea1664f30b
Merge pull request #10190 from boesing/feature/array-object-array-key
2023-09-10 20:09:10 +03:00
Maximilian Bösing
7f8ec79243
qa: modify tests since array keys are not mixed for ArrayObject
...
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2023-09-10 16:06:56 +02:00
George Steel
e98ed16577
DateTimeZone::getName()
always returns non-empty-string
and cannot be constructed with an empty string
...
Signed-off-by: George Steel <george@net-glue.co.uk>
2023-09-09 23:48:49 +01:00
Tinjo Schöni
8fbe14a34b
Restore support for namespaced functions in referencedFunction config
2023-09-09 01:47:09 +02:00
Bruce Weirdan
cd8fc46554
Flag invalid declares
2023-09-02 23:41:50 +02:00
robchett
d0c4d170b0
Apply psalm-inheritors to interfaces too
2023-08-31 23:12:10 +02:00
robchett
e23971ca29
InheritorViolation was only being triggered on grand-childen classes
...
Fixes #10167
2023-08-31 23:12:07 +02:00
Bruce Weirdan
3814fbb231
Merge pull request #10157 from boesing/bugfix/assertions-from-inherited-docblock
2023-08-28 12:04:47 +02:00
Bruce Weirdan
b3150d451a
Fix crash on property access to undefined property on a class with a missing dependncy
2023-08-28 01:58:02 +02:00
Maximilian Bösing
5e520e6bff
bugfix: properly inherit assertions from parents or implemented interfaces
...
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2023-08-28 01:12:28 +02:00
cgocast
c8b47b17bf
Fix typo
2023-08-26 21:54:26 +02:00
cgocast
72c9bf8575
New sinks for TaintedCallable #10117
2023-08-26 19:29:00 +02:00
Maximilian Bösing
5948559a31
feature: introducing proper handling of value-of
in combination with backed enums
...
This introduces both:
- a bugfix for a regression introduced by `31eaf83c4` which prevents backed enums are incorrectly identified as literals
- an additional feature so that `value-of` can be used with backed enums to assert any of the enum cases values
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2023-08-25 23:58:53 +02:00
Maximilian Bösing
22bcd576d3
qa: add test to verify backed enums are no literals
...
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2023-08-25 23:53:58 +02:00
Bruce Weirdan
1474340cf2
Fix crash on array access to undefined class
2023-08-20 23:45:30 +02:00
Bruce Weirdan
03f7c263fe
Correct type for $enum->name
2023-08-13 05:56:33 +02:00
Kuba Werłos
18a4752970
Add test
2023-08-12 12:28:23 +02:00
Yannick Gottschalk
a4de6d9dc0
Fix #9997
...
- make SimpleXmlElement and SimpleXmlIterator not a universal object crate
- added typed magic __get method to SimpleXmlElement
- adjusted tests to reflect new behaviour of SimpleXmlElement
- added tests
2023-08-05 17:07:08 +02:00
kkmuffme
02385c2b49
code style + update tests
2023-08-04 23:56:47 +02:00
kkmuffme
0a58a68e9a
make (s)printf error reporting more correct/literal
...
Fix https://github.com/vimeo/psalm/issues/10021
Fix https://github.com/vimeo/psalm/issues/9987 again now for all cases (specifically https://github.com/vimeo/psalm/issues/9987#issuecomment-1624360506 )
Use RedundantFunctionCall instead of InvalidArgument, where it's technically valid.
Report TooManyArguments when a format without placeholders is used
Report an error for splat with vprintf/vsprintf
2023-08-04 23:38:48 +02:00
orklah
b9d355e082
Merge pull request #10071 from weirdan/fix-10070
...
Allow method-like strings in `referencedFunction`
2023-08-01 07:16:55 +02:00
Bruce Weirdan
ec842c0f3d
Allow method-like strings in referencedFunction
...
Fixes vimeo/psalm#10070
2023-08-01 06:37:01 +02:00
klimick
809b27c499
Fix variadic callable type check
2023-07-30 11:43:07 +03:00
63347e71ae
Merge remote-tracking branch 'hub/5.x' into non_falsy_string_literal
2023-07-29 15:04:04 +02:00
orklah
73ebe227b2
Merge pull request #10055 from thbley/master
...
Add type detection for PDOStatement::fetchAll(PDO::FETCH_CLASS, SomeClass::class)
2023-07-27 19:03:09 +02:00
Thomas Bley
ee505259aa
#9974 extended test with PDO::ATTR_DEFAULT_FETCH_MODE for future implementation
2023-07-27 15:59:31 +02:00
Thomas Bley
d600705b0c
#9974 removed references_in_scope for setFetchMode
2023-07-27 15:53:05 +02:00
Thomas Bley
66bc28d2a8
#9974 extended return type detection for PDOStatement::fetchAll/fetch with FETCH_COLUMN and FETCH_KEY_PAIR
2023-07-27 01:39:21 +02:00
Bruce Weirdan
6c0a09a36a
Merge pull request #10050 from weirdan/lsp-modernize-progress-reporting
...
Modernize LSP progress reporting
2023-07-27 01:11:36 +02:00
Thomas Bley
fc74ae83e6
#9974 added return type detection for PDOStatement::fetchAll, extended return type detection for PDOStatement::fetch
2023-07-27 00:40:26 +02:00
orklah
be875f50e4
Merge pull request #10028 from thbley/master
...
added GitHub CI for unit tests with PHP 8.2 and 8.3
2023-07-26 19:23:15 +02:00
Bruce Weirdan
4f6fc3585b
Update tests to account for new progress protocol
2023-07-26 05:16:37 +02:00
Bruce Weirdan
0a2a0feaf2
CS fix
2023-07-24 21:59:34 +02:00
Bruce Weirdan
6eb7a688d1
Introduce --map-folder
switch
...
And create PathMapper based on its value
2023-07-24 21:59:34 +02:00
Bruce Weirdan
8a51aaedd4
CS fix
2023-07-24 21:59:34 +02:00
Bruce Weirdan
6b9d9805b1
Account for -r
option
2023-07-24 21:59:34 +02:00
Bruce Weirdan
a68c4804f4
Add path mapper
2023-07-24 21:59:34 +02:00
dfbc9dd177
Fix combination of non-falsy-string and falsy literal
2023-07-24 09:07:46 +02:00
Thomas Bley
603dfa2e5a
#10026 cleanup phpcs
2023-07-21 22:57:49 +02:00
Thomas Bley
fda483a98b
#10026 converted version_compare() to direct comparison with PHP_VERSION_ID
2023-07-21 22:42:27 +02:00
Thomas Bley
7f39dab07b
#10026 moved some more signature changes to CallMap_83_delta
2023-07-21 22:26:05 +02:00
Thomas Bley
9590279c62
#10026 added style changes to pass phpcs check
2023-07-21 21:50:30 +02:00
Thomas Bley
51058eb45e
#10026 cleanup
2023-07-20 02:02:28 +02:00
Thomas Bley
f34327e079
10026 extended InternalCallMapHandlerTest ignores for php 8.3
2023-07-20 01:01:10 +02:00
Thomas Bley
cbee1e094e
#10026 adapted DateTime tests for DateMalformedStringException in PHP 8.3
2023-07-19 23:52:25 +02:00
Thomas Bley
804087b5d5
#10026 added workaround for DateTimeInterface::__unserialize() signature
2023-07-19 23:14:04 +02:00
Thomas Bley
0f99799fa9
#10026 fixed AnnotationTest
2023-07-19 22:52:15 +02:00
rhertogh
c62d507a0e
Added addtitional cases for 'multiLineArrayShapeWithComments' in \Psalm\Tests\AnnotationTest::providerValidCodeParse()
2023-07-16 00:53:37 +02:00
rhertogh
fa107d5e01
Updated docs for comments in Array Shapes with //
in the key
2023-07-15 20:15:37 +02:00
rhertogh
f378ef1cab
Allow comments in types (e.g. array shape)
2023-07-15 18:43:47 +02:00
rhertogh
9935b2c71e
Merge branch 'master' into inline_comments_in_types
...
# Conflicts:
# tests/CommentAnalyzerTest.php
2023-07-15 15:46:01 +02:00
klimick
e9445cd422
Test inference with omitted closure param
2023-07-11 11:34:06 +03:00
rhertogh
5a1bb56fc2
3nd attempt to fix CommentAnalyzerTest::providerSplitDocLine()
docblock
2023-07-09 14:26:58 +02:00
rhertogh
d2ec23fc71
2nd attempt to fix CommentAnalyzerTest::providerSplitDocLine()
docblock ( https://github.com/vimeo/psalm/pull/10000#issuecomment-1627430145 )
2023-07-08 23:01:35 +02:00
rhertogh
a69b0caa23
Added return type specification for \Psalm\Tests\CommentAnalyzerTest::providerSplitDocLine()
( https://github.com/vimeo/psalm/pull/10000#issuecomment-1624354237 )
2023-07-07 16:25:10 +02:00
rhertogh
356e6d7bbd
First setup to allow comments in types (e.g. array shape)
2023-07-06 23:40:13 +02:00
rhertogh
fc85ecb1f6
Code style fixes for \Psalm\Tests\CommentAnalyzerTest ( https://app.circleci.com/pipelines/github/vimeo/psalm/11905/workflows/353387bb-1dcc-4527-9569-c83ebe43864c/jobs/39822 )
2023-07-06 18:31:26 +02:00
rhertogh
242a38c184
Allow space before array shape opening brace and added unit tests for \Psalm\Internal\Analyzer\CommentAnalyzer::splitDocLine()
2023-07-06 00:01:00 +02:00
kkmuffme
8d8adefb6c
no error for printf with only 1 arg
...
Fix https://github.com/vimeo/psalm/issues/9987
2023-07-03 22:59:02 +02:00
kkmuffme
b4126326eb
make stubbed constant types configurable with comment
...
Fix https://github.com/vimeo/psalm/issues/4024
2023-07-03 22:28:25 +02:00
orklah
8d1876a8a3
Merge pull request #9981 from kkmuffme/fix-replace-functions-return-type-provider-less-specific
...
fix mixed replace return types for arrays
2023-07-02 12:59:01 +02:00
orklah
53ce62bf28
Merge pull request #9975 from kkmuffme/sprintf-single-arg-splat-array
...
Fix sprintf single arg splat array
2023-07-02 10:08:08 +02:00
kkmuffme
c2388b4d90
fix failing tests and shepherd
2023-07-02 08:33:43 +02:00
Roland Franssen :)
039c526c58
Update PsalmRunnerTrait.php
2023-07-01 16:47:42 +02:00
Roland Franssen :)
06172740cd
Update PsalmRunnerTrait.php
2023-07-01 13:40:04 +02:00
Roland Franssen :)
f0e2856963
Update PsalmRunnerTrait.php
2023-07-01 13:36:42 +02:00
Roland Franssen :)
7cf87b28dc
Update PsalmRunnerTrait.php
2023-07-01 13:28:05 +02:00
kkmuffme
26eb870e47
fix mixed replace return types for arrays
...
* remove useless replace return type provider code that returned incorrect type for array replacements and was worse duplicate of existing stubs
* require preg patterns to be non-empty-strings as otherwise it will throw a PHP notice
* improve return type of array replacements to be more correct (not fully correct due to https://github.com/vimeo/psalm/issues/5994#issuecomment-1614601590 )
2023-06-30 17:08:03 +02:00
kkmuffme
2dd26cb0f1
Fix sprintf single arg splat array
...
Fix https://github.com/vimeo/psalm/issues/9873#issuecomment-1612901224
2023-06-29 13:47:42 +02:00
Yannick Gottschalk
f93d23899d
Fix glob CallMap and stub to prevent crash on alpine (and possibly other systems)
2023-06-25 13:17:13 +02:00
kkmuffme
0535c6b877
PHP 7 format with only placeholders isn't falsable if valid
...
limit tests to PHP 8 to avoid having to create them twice and add specific test for Issue 9941
2023-06-24 18:11:15 +02:00
kkmuffme
28b9e8dd95
run format checks for splat too
2023-06-24 18:11:15 +02:00
kkmuffme
fad17686bd
Fix false positive for array unpacking
...
Fix https://github.com/vimeo/psalm/issues/9873
2023-06-24 18:11:15 +02:00
Tinjo Schöni
a737ca8072
Consider a property type change as a signature change
2023-06-24 15:31:15 +02:00
Tinjo Schöni
703a4b46c3
Add test case for property type change not invalidating methods
2023-06-24 14:29:28 +02:00
Tinjo Schöni
1b1915eaf5
Make file storage cache handling consistent
2023-06-24 14:29:28 +02:00
Tinjo Schöni
9939cae52d
Support project analysis with file diffing in tests
2023-06-24 14:29:28 +02:00
Maximilian Bösing
2d84b06cfa
qa: introduce failing test
...
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2023-06-23 20:44:33 +02:00
orklah
01e2ac78d4
Merge pull request #9950 from orklah/iterableInt
...
fix reconciliation between a list and iterable
2023-06-22 23:45:39 +02:00
orklah
8929f8b4d8
fix reconciliation between a list and iterable
2023-06-22 23:37:40 +02:00
Tinjo Schöni
474f8874f0
Add test case for file deletes not invalidating methods
2023-06-20 01:01:24 +02:00
Tinjo Schöni
3e2de9d152
Implement a way to test cache issues
2023-06-20 01:01:23 +02:00
orklah
8e636086b3
put config to true to prevent deprecations for new config files ( #9857 )
...
* put config to true to prevent deprecations for new config files
2023-06-19 22:02:29 +02:00
orklah
e2dde5d200
Merge pull request #9922 from robchett/elseif_shouldnt_be_modifying_outer_scope
...
Don't update types of the outer scope when in an elseif conditional
2023-06-18 11:00:16 +02:00
robchett
620c7cd68a
Fix bug surfaced from removal of elseif scope modification
2023-06-17 15:02:31 +01:00
robchett
7792b6c36c
Don't update types of the outer scope when in an elseif conditional
2023-06-17 13:36:29 +01:00
robchett
338b50a959
Change __LINE__ to a positive-int
2023-06-17 12:24:09 +01:00
orklah
eb64a471c4
Merge pull request #9903 from ygottschalk/fix/9827-union-empty-array-and-false
...
Fixes #9827
2023-06-15 21:19:44 +02:00
kkmuffme
16aaa3ae2b
regex cleanup
2023-06-13 22:07:51 +02:00
kkmuffme
51fd63cfbb
fix CI warnings
2023-06-13 16:59:25 +02:00
kkmuffme
8a8aeb6452
fix tests
2023-06-12 19:44:22 +02:00
kkmuffme
d0f14ba19e
ignore complex placeholders for now
...
Fix https://github.com/vimeo/psalm/issues/9900
Fix https://github.com/vimeo/psalm/issues/9901
Fix original core stubs sprintf returning a wrong type too (unrelated to return type provider) for placeholders that are always empty
2023-06-12 19:44:22 +02:00
kkmuffme
9bc4752e29
add checks for complex empty format and make return type more specific
2023-06-12 19:44:22 +02:00
kkmuffme
9232e4e76b
code style
2023-06-12 19:44:22 +02:00
kkmuffme
697d06b24d
fix empty format return type, add errors for empty format or format without placeholders
2023-06-12 19:44:22 +02:00
orklah
715a91d15c
Merge pull request #9889 from dkarlovi/feat/cache.gz
...
feat: cache.gz
2023-06-12 18:50:01 +02:00
Yannick Gottschalk
d11bb90c96
Style fixes
2023-06-12 15:29:22 +02:00
Yannick Gottschalk
40ce0cf7d7
Fixes #9827
2023-06-12 15:25:17 +02:00
orklah
b6cba5a377
Merge pull request #9877 from kkmuffme/sprintf-improve-return-param-type-validation
...
Sprintf improve return param type validation
2023-06-11 13:08:24 +02:00
Dalibor Karlović
495a466c5e
init cache in child classes
2023-06-09 15:57:29 +02:00
kkmuffme
3179498643
check args for sprintf + printf
...
* check args for (s)printf for Invalid/TooMany/TooFew
* don't change the return type when we cannot infer it more specifically (nullable return)
* fix https://github.com/vimeo/psalm/issues/9874
* implement https://github.com/vimeo/psalm/issues/9817
* add tests
2023-06-09 12:59:13 +02:00
kkmuffme
0a54c84055
readonly does not have write access, therefore is safe as long as the type is contained in the parent type
...
Fix https://github.com/vimeo/psalm/issues/9831#issuecomment-1569022701
2023-06-09 12:37:41 +02:00
orklah
08d5b719c7
Merge pull request #9878 from ygottschalk/fix/9820-glob-stub
...
Glob return type stub
2023-06-07 20:32:40 +02:00
andrew
4f5dfa7350
Better intersection of template types during inheritance check
2023-06-07 17:58:25 +03:00
Yannick Gottschalk
8bab567aac
Merge branch 'master' into fix/9820-glob-stub
2023-06-07 11:45:16 +02:00
Yannick Gottschalk
c74d431fdf
Fixed style issues
2023-06-07 08:52:54 +02:00
kkmuffme
08d515d7af
don't autoload AllowDynamicProperties
2023-06-07 08:41:44 +02:00
kkmuffme
ed9fbab1c4
don't autoload Mockery/Closure
2023-06-07 08:31:53 +02:00
kkmuffme
40679e9a82
fix failing mock tests
2023-06-07 08:12:31 +02:00
Yannick Gottschalk
a130e2f06c
Fixes #9820
2023-06-06 17:02:28 +02:00
orklah
9d1c2c4596
Merge pull request #9866 from klimick/fix-generic-type-params-mapping
...
Fix generic type params mapping
2023-06-04 23:05:04 +02:00
orklah
43df1dc9ba
Merge pull request #9865 from klimick/intersection-with-template
...
Intersect template types during inheritance check
2023-06-04 23:01:28 +02:00
orklah
c15860508b
Merge pull request #9853 from kkmuffme/multiple-psalm-assert-if-for-array-list
...
Allow if/false assert for same variable to allow array/list distinction
2023-06-04 22:59:37 +02:00
andrew
02addbe79c
Fix generic type params mapping
2023-06-02 17:36:13 +03:00
andrew
38bd4d8c0d
Intersect template
2023-06-02 14:48:20 +03:00
orklah
75baaf7889
Merge pull request #9844 from kkmuffme/property-no-set-in-constructor-abstract-false-positive
...
PropertyNotSetInConstructor should not report for abstract constructors
2023-06-01 07:21:23 +02:00
kkmuffme
103e7b343c
PropertyNotSetInConstructor should not report for abstract constructors
...
since they do not have any code
Fix https://github.com/vimeo/psalm/issues/9830
2023-06-01 01:38:33 +02:00
kkmuffme
1f2db5f31c
Allow if/false assert for same variable to allow array/list distinction
...
Fix https://github.com/vimeo/psalm/issues/9037
2023-06-01 01:08:06 +02:00
orklah
a762b6c3bb
Merge pull request #9841 from kkmuffme/sprintf-basic-return-type-provider
...
sprintf basic non-empty-string return type provider
2023-05-31 23:36:03 +02:00
Alies Lapatsin
174cd5c0fe
Introduce and use IssueData constants for severity
...
they are not the same as Config::REPORT_* constants
2023-05-31 12:38:15 +02:00
kkmuffme
8606d5585f
sprintf basic non-empty-string return type provider
...
Fix https://github.com/vimeo/psalm/issues/9819
This PR is a starting point for improving the sprintf return type and eventually validate the format, param types and param count.
(see https://github.com/vimeo/psalm/issues/9817 , https://github.com/vimeo/psalm/issues/9818 )
2023-05-30 22:11:17 +02:00
orklah
88aae91e55
Merge pull request #9835 from staabm/patch-5
...
Fixed typo in ConstantTest
2023-05-30 21:08:47 +02:00
kkmuffme
e3e7373e99
fix test string format
2023-05-30 16:55:13 +02:00
kkmuffme
c185437955
fix string format in test
2023-05-30 16:49:10 +02:00
kkmuffme
9d7d4bff28
non-empty-string always returs non-empty-string, fix tests
2023-05-30 16:44:23 +02:00
kkmuffme
25c7f37a44
add test, fix wrong test and fix shepherd
2023-05-30 16:29:47 +02:00
Markus Staab
9af897f328
Fixed typo in ConstantTest
2023-05-30 08:43:54 +02:00
orklah
2bbfca6d9f
Merge pull request #9829 from klimick/map-closed-inheritance-to-union
...
Mapping closed inheritance to union during assertion
2023-05-29 20:14:31 +02:00
Yannick Gottschalk
a41eb35b24
Fix #9824
2023-05-28 17:37:16 +02:00
klimick
38c93db889
More closed inheritance assertion tests
2023-05-27 18:55:27 +03:00
klimick
b7b20771c0
Add closed inheritance assertion tests
2023-05-27 13:40:23 +03:00