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

31 Commits

Author SHA1 Message Date
Bruce Weirdan
448534fd7c
Cli command classes (#5858)
* Move psalm entry-point to a Cli command class

* Moved psalter to the CLI command class

* Moved psalm-language-server to the CLI command class

* Moved psalm-refactor to the CLI command class

* Moved psalm_plugin to the CLI command class

* Use CLI commands directly and deprecate trampolines

* Require CLI commands directly and don't use trampolines

* Announce isAbsolutePath() removal

* Deprecate \Psalm\requireAutoloaders() function

* Deprecate \Psalm\getVendorDir() function

* Deprecate Psalm\getArguments() function

* Deprecate \Psalm\getPathsToCheck() function

* Deprecate \Psalm\getPsalmHelpText() function

* Deprecate \Psalm\initialiseConfig() function

* Deprecate Psalm\update_config_file() function

* Deprecate \Psalm\get_path_to_config() function

* Deprecate Psalm\getMemoryLimitInBytes() function

* CS fix

* Untangle Psalm entrypoint

* Untangle Psalter entrypoint

* Drop command_functions.php references

* Adjust phar build
2021-05-31 22:23:54 -04:00
Bruce Weirdan
105c6f3a1c
Remove (and prevent) unused uses (#5704)
* Updates `slevomat/coding-standard`
* Removes unused uses
* Prevents unused uses
* Fixes a number of symbol case mismatches
2021-05-03 17:22:15 -04:00
Bruce Weirdan
97fe86c4e1
Fix BC break introduced in 4.6.3 (#5410)
Fixes vimeo/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`
2021-03-16 19:28:18 -04:00
Bruce Weirdan
205fdd197e
Wrap entrypoints into IIFE to protect their variables (#5366)
* Wrap entrypoints into IIFE to protect their variables

Fixes vimeo/psalm#5359

* Add tests for Psalm variable isolation

* Capture environment before registering autoloader
2021-03-11 00:14:22 -05:00
Bruce Weirdan
26978fcea1
Convert PHP errors / warnings / notices to exceptions (#5260)
* Sort uses

* Add ErrorHandler

* Use new error handler

* Drop old exception handler

* Suppress error-triggered exceptions during external autoload calls
2021-02-22 09:19:34 -05:00
Matt Brown
e7e5904d2d Remove unused uses in Psalm’s codebase 2020-11-13 13:16:39 -05:00
orklah
10f2966dcb
return types (#4311)
* return types

* remove willReturn for void methods
2020-10-12 15:02:52 -04:00
Saif Eddin G
0475f379aa
add support for 'COMPOSER' env variable for alternate name of 'composer.json' (#4275) 2020-10-03 02:26:37 -04:00
orklah
37a2f8a33d
unused use statements (#4228) 2020-09-22 01:10:46 -04:00
orklah
ead107fa9e
More return types (#4173)
* add native return types

* redundant phpdoc
2020-09-12 11:24:05 -04:00
orklah
73f6fcde48
Short list syntax (#4102)
* Short list syntax

* revert unrelated CS
2020-09-02 00:17:41 -04:00
Matthew Brown
84945a7d1b Fix #3877 - prevent impossible subtr comparisons 2020-07-24 10:08:57 -04:00
Brown
1e01e90fba Namespace base files 2020-07-22 15:57:24 -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
Tyson Andre
bee10a2eb4
Add a --debug-emitted-issues flag (#3637)
And support --debug-by-line in psalter and psalm-refactor.
Those were previously not supported in getopt()

Fixes #3634
2020-06-22 18:16:47 -04:00
Brown
370ffa28e4 Fix #3117 - invalidate all caches when composer lockfile changes 2020-04-12 11:41:37 -04:00
Brown
ee50542b8f Allow users to disable caching full files 2020-04-12 08:34:57 -04:00
Tyson Andre
b713066d32 Add an exception handler that prints full exception trace (#2418)
By default, php will only print the first few thousand bytes of the
exception, for an uncaught exception
(I think that's the default, and not just my configuration)

Instead, print all of the parts of the exception.

For #1083 (this PR does not cover set_error_handler)
2019-12-04 23:17:08 -05:00
SignpostMarv
943705ce0e load an xdebug stub when required, re: vimeo/psalm#2118 (#2133)
* load an xdebug stub when required, re: vimeo/psalm#2118

* correcting case sensitivity of XDebug to Xdebug

* only load the Xdebug stub when needed
2019-09-14 10:13:39 -04:00
Matthew Brown
deb36e8b27 Allow array_map alone when it uses a closure 2019-09-09 21:28:56 -04:00
Brown
a6baa2d04c Allow callables to be understood as pure
Fixes #2112
2019-09-09 12:11:04 -04:00
Tyson Andre
b88fe2cfe0 Fix typos (#2003) 2019-08-11 17:13:43 -04:00
Barney Laurance
ea83068deb Allow resolving directories from config file location (continued) (#1910)
* 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
2019-07-07 08:55:53 -04:00
Matthew Brown
b5cbc84351 Fix #1617 - add option to only show errors in reports 2019-06-09 12:37:28 -04:00
Matthew Brown
7a1a728cee Move docs into subfolders 2019-06-09 00:54:13 -04:00
Matthew Brown
c6063d1378 Only replace same-file param docblock types 2019-06-05 19:32:27 -04:00
Brown
99e6cd819f Remove unnecessary command 2019-06-03 12:30:20 -04:00
Brown
65a7c1bbcd Improve documentation for psalm-refactor 2019-06-03 12:24:32 -04:00
Matthew Brown
fc0f625f62 Add safeguards to prevent bad refactor input 2019-06-02 23:33:57 -04:00
Matthew Brown
2439a9f6a0 Allow instance method renaming, too 2019-06-02 12:02:39 -04:00
Matthew Brown
2b0a17c1c8 Add simple tool to move static methods 2019-06-02 01:10:50 -04:00