1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00
Commit Graph

71 Commits

Author SHA1 Message Date
rarila
97e6511fab Set number of lines before and after namespace. 2021-12-15 04:58:32 +01:00
rarila
39402c233d
Return type hints (#7065)
Co-authored-by: ralila <>
2021-12-05 19:51:26 +02:00
ralila
8fb2e0f885 Handle some partials 2021-12-04 21:55:53 +01:00
ralila
2a956498bf Import instead of using fqn functions 2021-12-03 21:07:25 +01:00
ralila
711be643c6 Import instead of using fqn exceptions 2021-12-03 20:29:06 +01:00
ralila
245920e53c Import instead of using fqn 2021-12-03 20:11:20 +01:00
Bruce Weirdan
d19aad7db1
Display target PHP version
Historically it was often not quite clear to users what PHP version
Psalm assumes, and why. This PR addresses this issue by printing the
version and where we got it from right before scanning the files.
2021-11-27 02:18:09 +02:00
Matthew Brown
88c4e2468e
Support interface-string<Foo> as temporary alias of class-string<Foo> (#6106) 2021-07-16 18:38:39 -04:00
Bruce Weirdan
76be96ce53
Drop FakeFileProvider from tests folder
And use Psalm\Internal\Provider\FakeFileProvider
2021-07-02 03:57:57 +03:00
Bruce Weirdan
6abce3525a
Enforce use sort (#5900) 2021-06-07 22:55:21 -04:00
orklah
ff0c1ce567
update hardcoded Psalm version (#5783)
* change hardcoded Psalm version to something more recent

* change hardcoded Psalm version to something more recent
2021-05-17 08:27:08 -05:00
Bruce Weirdan
65f0fb0288
Allow multiple version-dependent method stubs (#5337)
Fixed vimeo/psalm#4836
2021-03-06 17:18:51 -05:00
Vincent Langlet
a80d5b736b
Rename stub to avoid phpstorm conflict (#5213) 2021-02-13 18:42:34 -05:00
Matt Brown
75a6d88773 Fix #4705 - clear documenting method ids when scanning stubs 2020-12-01 11:23:38 -05:00
Matt Brown
27d928b684 Add failing testcase for #4705 2020-12-01 10:26:45 -05:00
Matt Brown
6acd667e55 Fix #4509 - treat expression-derived constants as mixed 2020-11-08 15:36:38 -05:00
orklah
37a2f8a33d
unused use statements (#4228) 2020-09-22 01:10:46 -04:00
Brown
c4450b930c Fix various things 2020-09-13 22:39:03 -04:00
Brown
3f911662f7 Fix stub test 2020-09-13 22:13:39 -04:00
Bruce Weirdan
cd110c7e2f
Added @psalm-stub-override for classlikes and methods (#4177)
Fixes vimeo/psalm#1252
2020-09-13 16:40:31 -04:00
orklah
ead107fa9e
More return types (#4173)
* add native return types

* redundant phpdoc
2020-09-12 11:24:05 -04:00
orklah
f66d57f19d
add native return types (#4116)
* add native return types

* remove redundant phpdoc
2020-09-04 16:26:33 -04:00
Brown
8ad1c2eeb1 Use immutable data structures for clause calculations 2020-08-26 10:41:47 -04:00
Bruce Weirdan
1cf5153700
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
2020-08-23 10:32:07 -04:00
Brown
209d17c868 Fix #2891 - treat autoloaded constants better 2020-08-13 09:14:27 -04:00
Bruce Weirdan
931d35a703
Collect and scan files included by the autoloaders (#3183)
Refs vimeo/psalm#2861
2020-07-11 17:17:22 -04:00
Brown
317571f1b2 Fix reset call 2020-06-21 13:03:55 -04:00
Brown
fbe3433edd Use escape terminology 2020-06-21 11:43:08 -04:00
Matthew Brown
39f7296670 Fix #2191 - allow inheritance from stub-only files 2020-03-29 00:13:01 -04:00
Matthew Brown
47c1470e3b Refactor reference checks to use more appropriate properties 2020-03-28 16:30:56 -04:00
Matthew Brown
2e6fe993a8 Fix #2890 - phpstorm.meta.php scanner should be insensitive to method names 2020-03-01 17:11:44 -05:00
kolja
d3727fe45f Made StubTest for relative and absolute paths work on windows too. 2020-02-27 17:07:24 -05:00
kolja
f189b25b99 Fixed stub files with absolute paths not being loaded. 2020-02-26 17:13:40 -05:00
Brown
821f3528d2 Fix #701 - indicate issues fixable with Psalter 2019-12-02 15:24:01 -05:00
Matthew Brown
5f0514b3da Remove stray comma 2019-09-01 16:55:03 -04:00
Matthew Brown
9cbe389285 Fix #910 - dead code issues with abstract vendor method 2019-09-01 16:52:40 -04:00
Brown
12eeb8b320 Fix #1935 - clear stub grandchildren 2019-07-11 18:23:02 -04:00
Brown
7d05568e22 Add skipped test for broken stubbing behaviour
Ref #1935
2019-07-11 12:51:43 -04:00
Matthew Brown
da42be175f Apply PHPCS fixes
Fixes #1880
2019-07-05 16:27:53 -04:00
Brown
6514f2084c Fix #1860 - be less restrictive about class_exists checks 2019-06-28 10:17:59 -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
158a2150a7 Fix #1752 - don’t enter if/else when class/interfaces/functions don’t exist 2019-06-09 23:50: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
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
Brown
0bd4dbcbc4 Bump to PHP 7.1
Fixes #1650
2019-05-16 18:36:36 -04:00
Brown
d75ac7f55d Move test fixtures to a single directory 2019-05-09 18:23:14 -04:00
Matthew Brown
d68e501bfa Fix #1528 - double check for missing dependency 2019-04-21 11:30:50 -04:00
Matthew Brown
496a175a9f Fix #1497 - respect constants stubbed in define() calls 2019-03-25 00:07:32 -04:00
Matthew Brown
c772914910 Add some formatting 2019-03-23 14:27:54 -04:00