Fixesvimeo/psalm#5405
Requires new patch release.
This PR reverts changes to the signature of `IssueBuffer::finish()` and
introduces separate method to be used to capture `$_SERVER`
* Wrap entrypoints into IIFE to protect their variables
Fixesvimeo/psalm#5359
* Add tests for Psalm variable isolation
* Capture environment before registering autoloader
* 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
* Added new language server options and functionality.
Added new extended diagnostic code information to the language server.
-- It must be enabled via a command line switch.
Added telemetry data for language server initialization and operation.
Added verbose log messages for language server.
-- It must be enabled via a command line switch.
* fixed phpcs issues
* fixed failing tests
* changed the language server reported error code to be the help link
Co-authored-by: Anthony Rainer <0@0ze.ro>
This change makes stringified types more normalized. Concretely it sorts
all union types, reconciled types, and sorts the keys within object-like
types.
* Extract function getPsalmHelpText() from psalm.php
* Extract initialiseConfig from psalm.php
* Add -c as valid short option for psalter and psalm-refactor
* Use initialiseConfig in psalter, psalm-refactor and psalm-language-server as well as psalm
* Rely on psalm --alter resolving directory from config file in test
* Remove erronous condition for config file path
This code was based on me wrongly thinking that the config file location
was seprated from the argument name with a space instead of an equals
sign
* Use config dir as current dir in psalm and psalm-refactor, as with psalter and psalm-language-server
* Remove redundant duplicated code
* Refactor: move calls to \Psalm\Config::setComposerClassLoader inside initialiseConfig
* PHPCS fix
* Extract function get_path_to_config from command scripts
* Refactor - extract functions from \Psalm\Config::loadFromXML
* Refactor - reduce verbosity of config loading code
* Allow running e2e tests on windows
* Fix testCompactReport on Windows
* convert line endings to make testCompactReport pass on Windows