1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-12 01:09:38 +01:00
Commit Graph

9082 Commits

Author SHA1 Message Date
orklah
2b37bdf253 get rid of the final check that was there only for static:: before 2021-08-17 23:40:03 +02:00
Bruce Weirdan
9e1f7ade86
Merge pull request #4738 from BenMorel/is_subclass_of 2021-08-18 00:29:40 +03:00
Benjamin Morel
621c4dd8d1 Enforce class-string in is_subclass_of() 2021-08-17 23:14:11 +02:00
orklah
ee53c57952 add back alter blocks but remove renaming the $stmt->class part when it's a variable 2021-08-17 23:11:28 +02:00
Bruce Weirdan
e5b797c764
Merge pull request #6327 from boesing/bugfix/class-alias 2021-08-17 23:35:25 +03:00
Maximilian Bösing
990723ce64
qa: rework unit test to use already available project_initializer
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2021-08-17 21:46:00 +02:00
Maximilian Bösing
158f2144b5
qa: use ClassLikes#getUnAliasedName instead of accessing the classlike_aliases
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2021-08-17 21:43:58 +02:00
Maximilian Bösing
5ef606a5f6
qa: avoid array_keys
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2021-08-17 21:39:53 +02:00
Bruce Weirdan
fdd286f70c
Merge pull request #6328 from bdsl/internal-call-from-root-namespace-fix
Fix error message for call to internal method from root namespace
2021-08-17 21:38:08 +03:00
Bruce Weirdan
cc717f7267
Merge pull request #6324 from VincentLanglet/strsplit 2021-08-17 21:03:40 +03:00
Barney Laurance
88276d7f1e Fix error message for call to internal method from root namespace 2021-08-17 18:54:57 +01:00
orklah
1bf7447685 small refactor, add LiteralClassString, remove alter code blocks 2021-08-17 18:51:59 +02:00
Vincent Langlet
4b84793b2f Add false back for mb_str_split 2021-08-17 18:45:02 +02:00
Maximilian Bösing
7ab5d29e08
qa: add unit test to verify aliased interface is properly detected
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2021-08-17 18:40:18 +02:00
Maximilian Bösing
f8db5a0461
bugfix: enable ClassLikes to properly detect implementing class aliases
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2021-08-17 18:40:18 +02:00
Vincent Langlet
1cdad83630 Remove false if length is positive int 2021-08-17 17:47:22 +02:00
piporoid
1df5f3012a Prevent @property annotations on class properties 2021-08-17 23:40:26 +09:00
Bruce Weirdan
285fa13d3a
Merge pull request #6323 from boesing/bugfix/atomic-non-empty-mixed
bugfix: add missing `TNonEmptyMixed` to `Atomic#create`
2021-08-17 12:26:52 +03:00
Vincent Langlet
786d926d78 str split return non empty 2021-08-17 11:03:54 +02:00
Maximilian Bösing
cb244d5c1e
bugfix: add missing TNonEmptyMixed to Atomic#create
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2021-08-17 10:46:45 +02:00
Bruce Weirdan
b343ae5b5a
Merge pull request #6320 from Forceu/master
Fix false positive when passing null to socket_select
2021-08-17 09:29:15 +03:00
orklah
7308c86bb2 fix build 2021-08-16 21:56:37 +02:00
orklah
9264ea5cbb Allow type inference on dynamic ClassConstFetch 2021-08-16 21:20:20 +02:00
Marc Ole Bulling
1818609f43 Fix for #6318 2021-08-16 19:23:10 +02:00
Bruce Weirdan
2e7763c314
Merge pull request #6311 from weirdan/fix-6309
Prevent failures when parsing in-array assertions
2021-08-16 03:52:54 +03:00
Bruce Weirdan
3e6f5bdc2f
Merge pull request #6312 from TysonAndre/fix-80-delta
Fix issues in php 8.0 delta
2021-08-16 03:06:59 +03:00
Bruce Weirdan
babfb6a637
Fix histories 2021-08-16 02:52:18 +03:00
Tyson Andre
ff72d2c92e Fix issues in php 8.0 delta
In a last minute change in php 8.0 after the feature freeze,
PhpToken::getAll was changed to tokenize

Also, https://www.php.net/manual/en/function.mb-get-info
has been around since php 4.2 - it's in psalm/dictionaries/CallMap.php
already with the same signature. Same for ReflectionNamedType::isBuiltin

Also, add signatures for getAttributes.

Also, use the same param names for fdiv that are found in reflection in
php 8.0 and 8.1 to support named arguments
2021-08-15 19:28:44 -04:00
Bruce Weirdan
f245c4ace7
Prevent failures when parsing in-array assertions
Fixes vimeo/psalm#6309
2021-08-16 01:23:48 +03:00
Bruce Weirdan
2b524107f4
Merge pull request #6310 from weirdan/simplexmliterator-signatures
Fix `SimpleXMLIterator` historic and current signatures
2021-08-16 01:04:48 +03:00
Bruce Weirdan
cc1335022f
Fix SimpleXMLIterator historic and current signatures
Historically, `SimpleXMLIterator` had only implemented `Iterator` and
`RecursiveIterator` methods. This changed in 8.0, when iterator methods
were moved to `SimpleXMLElement`, and `SimpleXMLIterator` was made a
dummy class extending `SimpleXMLElement`.

Fixes vimeo/psalm#6305, in the sense that Psalm would no longer report
different errors depending on the runtime PHP version.
2021-08-16 00:04:59 +03:00
Bruce Weirdan
1a7a44a602
Merge pull request #6306 from orklah/misc6
Change > assertion back to @ and put back a perf threshold
2021-08-15 22:56:34 +03:00
orklah
1e17069c24 Change > assertion back to @ and put back a perf threshold 2021-08-15 10:13:05 +02:00
Bruce Weirdan
4c26293260
Merge pull request #6304 from vimeo/revert-6210-int-range3 2021-08-14 19:19:38 +03:00
Bruce Weirdan
a9ead63ae1
Revert "Assertions for Integer Range" 2021-08-14 18:06:41 +03:00
Matthew Brown
6cc5ba970a Fix tests 2021-08-14 10:45:32 -04:00
Matthew Brown
a4479761a7 Fix #3660 - ensure mixed percentage for file never drops below 0 2021-08-14 10:35:31 -04:00
Bruce Weirdan
1b19670c39
Merge pull request #6302 from thomasbley/master
Fixed ReflectionException: Class \LanguageServerProtocol\TextDocumentContentChangeEvent does not exist
2021-08-14 15:04:39 +03:00
Thomas Bley
04177496cc Fixed ReflectionException: Class \LanguageServerProtocol\TextDocumentContentChangeEvent does not exist 2021-08-14 05:54:36 +02:00
Bruce Weirdan
f7def9fecf
Merge pull request #6268 from vudaltsov/debug_backtrace-return-type 2021-08-13 02:02:27 +03:00
Valentin Udaltsov
a335535945
Added debug_backtrace return type to CallMap_historical 2021-08-13 01:45:41 +03:00
Bruce Weirdan
7ff2a660dd
Merge pull request #6233 from supersmile2009/fix-in-array-assert 2021-08-13 01:39:31 +03:00
Bruce Weirdan
a4b6fbcbdf
Simplified InArrayTest a bit 2021-08-13 01:27:28 +03:00
Bruce Weirdan
568a9e0412
Prevented empty assertions
and simplified the code a bit.
2021-08-13 00:39:24 +03:00
Bruce Weirdan
c4def5d13d
Merge pull request #6290 from weirdan/unpack-in-constant-arrays 2021-08-12 20:52:28 +03:00
Bruce Weirdan
6294e06955
Improve constant array inference
This fixes int offset inference and adds handling for array unpacks in
constant arrays. Mostly it's copy/pasted from `ArrayAnalyzer` with
further adjustments.

Fixes vimeo/psalm#6263
Fixes vimeo/psalm#6289
2021-08-12 20:39:21 +03:00
Bruce Weirdan
82e0a9b428
Merge pull request #6291 from zonuexe/patch-1
Remove unnecessary [
2021-08-12 12:24:07 +03:00
USAMI Kenta
4985109e56
Remove unnecessary [ 2021-08-12 12:08:00 +09:00
Bruce Weirdan
7c339c1f7d
Merge pull request #6279 from weirdan/refactor-constant-array-inference 2021-08-11 11:00:52 +03:00
Bruce Weirdan
8f85f580da
Extract item handling 2021-08-11 01:18:23 +03:00