1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 12:55:26 +01:00
Commit Graph

123 Commits

Author SHA1 Message Date
Matt Brown
4acaf40f26
Avoid crash when callable type is missing 2021-01-29 11:39:54 +01:00
Matt Brown
49dcec6d4a
Fix #4287 - intersection of regular arrays should not result in crash 2021-01-29 11:39:50 +01:00
Brown
95cc274192
Support more array intersections in type parsing 2021-01-29 11:39:37 +01:00
orklah
db45ff1ba4
More return types (#4173)
* add native return types

* redundant phpdoc
2021-01-29 11:38:57 +01:00
orklah
1348e61afb
add native param types (#4137)
* add native param types

* redundant phpdoc

* add more param types and adds "?" to nullable types

* remove redundant phpdoc

* add more param types and remove redundant phpdoc

* add more param types and remove redundant phpdoc
2021-01-29 11:38:54 +01:00
orklah
61512da144
add native return types (#4116)
* add native return types

* remove redundant phpdoc
2021-01-29 11:38:53 +01:00
Brown
c96ba8d1f5
Add some backwards-incompatible changes for 4.x 2021-01-29 11:38:48 +01:00
Bruce Weirdan
dabfb16e34
Test parallelization (#4045)
* Run tests in random order

Being able to run tests in any order is a pre-requisite for being able
to run them in parallel.

* Reset type coverage between tests, fix affected tests

* Reset parser and lexer between test runs and on php version change

Previously lexer was reset, but parser kept the reference to the old
one, and reference to the parser was kept by StatementsProvider. This
resulted in order-dependent tests - if the parser was first initialized
with phpVersion set to 7.4 then arrow functions worked fine, but were
failing when the parser was initially constructed with settings for 7.3

This can be demonstrated on current master by upgrading to
nikic/php-parser:4.9 and running:

```
vendor/bin/phpunit --no-coverage --filter="inferredArgArrowFunction" tests/ClosureTest.php
```

Now all tests using PHP 7.4 features must set the PHP version
accordingly.

* Marked more tests using 7.4 syntax

* Reset newline-between-annotation flag between tests

* Resolve real paths before passing them to checkPaths

When checkPaths is called from psalm.php the paths are resolved, so we
just mimicking SUT behaviour here.

* Restore newline-between-annotations in DocCommentTest

* Tweak Appveyor caches

* Tweak TravisCI caches

* Tweak CircleCI caches

* Run tests in parallel

Use `vendor/bin/paratest` instead of `vendor/bin/phpunit`

* Use default paratest runner on Windows

WrapperRunner is not supported on Windows.

* TRAVIS_TAG could be empty

* Restore appveyor conditional caching
2021-01-29 11:38:04 +01:00
Brown
7253e01000 Fix #3716 - prevent crash for Foo|? return type 2020-06-29 17:52:55 -04:00
Matthew Brown
3d7288afcb Fix #3529 - static intersected with itself is static 2020-06-06 20:10:50 -04:00
Brown
118b700436 Simplify sink mapping for internal calls 2020-05-25 13:10:06 -04:00
Brown
8becefda04 Forbid :: in object-like key name
Ref #3399
2020-05-19 14:38:46 -04:00
Brown
813302206a Improve rendering of tuples 2020-05-11 09:08:53 -04:00
Brown
117a4d4d40 Require callable() have a return type when in conditional
Fixes #3260
2020-04-30 23:35:13 -04:00
Brown
bb1c8a9d74 Don’t clobber intersection types after generic in union
Fixes #3274
2020-04-30 23:15:16 -04:00
Brown
470bf807b7 Add better handling of expression termination 2020-04-30 22:23:37 -04:00
Brown
ce8fb459e9 Allow complex types in conditional is expressions
Ref #3277
2020-04-30 22:02:37 -04:00
Brown
05ff8d0142 Prevent invalid [] brackets in tree
Fixes #3246
2020-04-28 15:18:50 -04:00
Brown
d56c5c9782 Fix #3256 - fix parsing of colons in callable inside conditional 2020-04-28 10:55:17 -04:00
Pierre Grimaud
e7990390a6
Fix typos (#3255) 2020-04-28 09:17:31 -04:00
Brown
5e2af1d7f6 Fix #1518 - add escaping of object-like keys 2020-04-26 17:36:02 -04:00
lhchavez
be87bb7300
Support intersection types for object-like arrays (#3064)
This change allows expressing the intersection of multiple object-like
arrays. The resulting type will contain the (merged via intersection)
properties of all the object-like arrays involved in the intersection.

This should allow to express the resulting type of an `array_merge()`
operation, which is tricky to do in the context of a templated type.
2020-04-08 09:35:53 -04:00
Matthew Brown
6058725256 Add prototype for conditional return type 2020-03-22 10:44:48 -04:00
Matthew Brown
952045e2ba Fix return type checks 2020-02-22 11:28:24 -05:00
Brown
d5f71bf529 Localise template checks to class being tested 2020-02-06 16:38:45 -05:00
Matthew Brown
55c2f7faa2 Fix #2508 - don’t replace templated types with generic ones inside own function 2019-12-28 18:38:02 -05:00
Matthew Brown
068afa09d3 Add very basic implementation for class-string-map
Fixes #1969
2019-12-27 12:49:28 -05:00
Matthew Brown
ab03ac06f4 Add support for spread operator before type as well
Ref #2429
2019-12-19 00:29:01 +00:00
Brown
c9e77d30d6 Add return type 2019-12-11 11:29:26 -05:00
Brown
79f3a5d371 Allow empty string parsing 2019-12-11 10:52:46 -05:00
Matthew Brown
baef66061e Fix class-string test 2019-12-01 23:09:34 -05:00
Matthew Brown
abdf37afb8 Add workarounds for class-string tests 2019-11-30 12:57:18 -05:00
Brown
06653f6322 Fix #2362 - support single value type in docblocks 2019-11-21 10:44:24 -05:00
Jáchym Toušek
f2c82fa212 Add support for Iterator<X> type (#2285)
* Add support for Iterator<X> type

* Fix tests
2019-10-30 18:00:27 +00:00
lhchavez
216f991b0c Normalize stringified type names (#2239)
This change makes stringified types more normalized. Concretely it sorts
all union types, reconciled types, and sorts the keys within object-like
types.
2019-10-17 01:14:33 -04:00
Matthew Brown
a5f79353ed Fix #2157 - don’t merge closures and callable params 2019-09-22 00:58:30 -04:00
Brown
cf53f5d825 Ignore spaces when array keys have $ at start 2019-08-08 18:01:08 -04:00
Matthew Brown
da42be175f Apply PHPCS fixes
Fixes #1880
2019-07-05 16:27:53 -04:00
Matthew Brown
8aadf93402 Fix return type 2019-06-29 21:56:34 -04:00
Matthew Brown
62fb86aef0 Fix #1875 - improve printing of iterable type 2019-06-29 21:46:01 -04:00
Brown
ba121a94e7 Allow union of class-strings in signature
Ref #1851
2019-06-27 11:44:35 -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
Matthew Brown
a553adb232 Fix test array spacing 2019-06-16 09:42:34 -04:00
Matthew Brown
41cdde514f Fix #1784 - detect missing end brackets 2019-06-15 17:57:40 -04:00
Matthew Brown
b5cbc84351 Fix #1617 - add option to only show errors in reports 2019-06-09 12:37:28 -04:00
Ilija Tovilo
5a14e4b1cf Progress bar (#1709)
* Revert "Revert "Implement better progress""

This reverts commit 4302596654.

* Revert "Revert "Implement dots progress bar""

This reverts commit e41733d789.

* Revert "Revert "Switch to VoidProgress by default""

This reverts commit 304ffeb0a3.

* Revert "Revert "Pass success flag to progress""

This reverts commit 62a690ee4e.

* Improve socket communication

* Use an underscore

* Add means to disable progress

* Add extra newline before progress bar
2019-05-30 10:30:41 -04:00
Matthew Brown
962d8f30a1 Fix #710 - treat keyed intersections of iterators properly 2019-05-29 19:58:54 -04:00
Brown
7df88197ef Fix #762 - support key-of and value-of types 2019-05-28 10:44:04 -04:00
Matthew Brown
4302596654 Revert "Implement better progress"
This reverts commit 042070d0fd.
2019-05-27 13:07:02 -04:00
Ilija Tovilo
042070d0fd Implement better progress 2019-05-26 23:18:48 -04:00