1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-02 17:52:45 +01:00
Commit Graph

42 Commits

Author SHA1 Message Date
cca276768e
List refactoring v5 (#8820)
* Squash

* Remove BC break

* Suppress

* Possibly fix

* Fixes

* Fix test

* Trigger build

* Update psl

* Update psl

* Fixes

* Fixes

* Cleanup

* fix

* Fix build

* Do not consider never when getting the max count

* Add assertion

* Cleanup

* Fix

* Cleanup
2022-12-13 21:40:19 +01:00
98a5dc313d
Cleanup documentation (#8702)
* Cleanup documentation

* Cleanup

* Cleanup
2022-11-12 14:50:46 -05:00
1986c8b4a8
Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395)
* Immutable CodeLocation

* Remove excess clones

* Remove external clones

* Remove leftover clones

* Fix final clone issue

* Immutable storages

* Refactoring

* Fixes

* Fixes

* Fix

* Fix

* Fixes

* Simplify

* Fixes

* Fix

* Fixes

* Update

* Fix

* Cache global types

* Fix

* Update

* Update

* Fixes

* Fixes

* Refactor

* Fixes

* Fix

* Fix

* More caching

* Fix

* Fix

* Update

* Update

* Fix

* Fixes

* Update

* Refactor

* Update

* Fixes

* Break one more test

* Fix

* FIx

* Fix

* Fix

* Fix

* Fix

* Improve performance and readability

* Equivalent logic

* Fixes

* Revert

* Revert "Revert"

This reverts commit f9175100c8452c80559234200663fd4c4f4dd889.

* Fix

* Fix reference bug

* Make default TypeVisitor immutable

* Bugfix

* Remove clones

* Partial refactoring

* Refactoring

* Fixes

* Fix

* Fixes

* Fixes

* cs-fix

* Fix final bugs

* Add test

* Misc fixes

* Update

* Fixes

* Experiment with removing different property

* revert "Experiment with removing different property"

This reverts commit ac1156e077fc4ea633530d51096d27b6e88bfdf9.

* Uniform naming

* Uniform naming

* Hack hotfix

* Clean up $_FILES ref #8621

* Undo hack, try fixing properly

* Helper method

* Remove redundant call

* Partially fix bugs

* Cleanup

* Change defaults

* Fix bug

* Fix (?, hope this doesn't break anything else)

* cs-fix

* Review fixes

* Bugfix

* Bugfix

* Improve logic

* Add support for list{} and callable-list{} types, properly implement array_is_list assertions (fixes #8389)

* Default to sealed arrays

* Fix array_merge bug

* Fixes

* Fix

* Sealed type checks

* Properly infer properties-of and get_object_vars on final classes

* Fix array_map zipping

* Fix tests

* Fixes

* Fixes

* Fix more stuff

* Recursively resolve type aliases

* Fix typo

* Fixes

* Fix array_is_list assertion on keyed array

* Add BC docs

* Fixes

* fix

* Update

* Update

* Update

* Update

* Seal arrays with count assertions

* Fix #8528

* Fix

* Update

* Improve sealed array foreach logic

* get_object_vars on template properties

* Fix sealed array assertion reconciler logic

* Improved reconciler

* Add tests

* Single source of truth for test types

* Fix tests

* Fixup tests

* Fixup tests

* Fixup tests

* Update

* Fix tests

* Fix tests

* Final fixes

* Fixes

* Use list syntax only when needed

* Fix tests

* Cs-fix

* Update docs

* Update docs

* Update docs

* Update docs

* Update docs

* Document missing types

* Update docs

* Improve class-string-map docs

* Update

* Update

* I love working on psalm :)

* Keep arrays unsealed by default

* Fixup tests

* Fix syntax mistake

* cs-fix

* Fix typo

* Re-import missing types

* Keep strict types only in return types

* argc/argv fixes

* argc/argv fixes

* Fix test

* Comment-out valinor code, pinging @romm pls merge https://github.com/CuyZ/Valinor/pull/246 so we can add valinor to the psalm docs :)
2022-11-05 22:34:42 +01:00
AndrolGenhald
66ebf4a55c Rename TKeyOfArray to TKeyOf. 2022-07-18 14:44:29 -05:00
AndrolGenhald
b51b5ac903 Allow value-of to work with backed enums (fixes #7874). 2022-07-18 14:10:06 -05:00
Jordi Boggiano
1eb8b5a853
without with 2022-03-23 14:49:51 +01:00
Jordi Boggiano
88a93294b4
Fix int-mask-of doc example 2022-03-23 12:19:07 +01:00
Patrick Remy
51f3b9869b
docs: add properties-of type to plugins type system 2022-02-24 18:50:35 +01:00
orklah
2e01e9b7cd
Merge pull request #7396 from Patrick-Remy/feat/key-of-value-of-improvements
feat: make key-of/value-of usable with non-const arrays
2022-01-31 21:39:01 +01:00
Bruce Weirdan
997592de64
Merge pull request #7530 from ohader/issue-7528 2022-01-31 10:36:47 +02:00
Oliver Hader
f5986950a2
[FEATURE] Introduce BeforeStatementAnalysisEvent
As counterpart to existing `AfterStatementAnalysisEvent` - invoked in
`\Psalm\Internal\Analyzer\StatementsAnalyzer` - this changed introcued
a corresponding `BeforeStatementAnalysisEvent`.

Resolves: #7534
2022-01-30 19:27:19 +01:00
Oliver Hader
e3602bbfe1
[FEATURE] Allow to intercept adding issue in IssueBuffer
This change introduces new `BeforeAddIssueEvent` which is invoked
from `IssueBuffer::add`, which allows to collect and intercept code
issue in a generic way.

Resolves: #7528
2022-01-30 17:46:08 +01:00
Oliver Hader
62a0ece035
!!! Allow plugins to modify Config::$fileExtensions early
ProjectAnalyzer consumed Config::$fileExtensions early in its
constructor - without having processed plugins' modifications,
registering their custom scanners or analyzer implementations.

This change
* adds new specific interface \Psalm\Plugin\FileExtensionsInterface
  to be used by plugin implementations
* extracts file extension handling from \Psalm\PluginRegistrationSocket
  and interface \Psalm\Plugin\RegistrationInterface to a new dedicated
  \Psalm\PluginFileExtensionsSocket and new interface
  \Psalm\Plugin\FileExtensionsInterface
  !!! this is a breaking change in PluginRegistrationSocket !!!
* adds runtime in-memory cache for Config::$plugins
* calls new method Config::processPluginFileExtensions(), providing
  modifications to file extension only early in ProjectAnalyzer
* adjusts documentation
2022-01-30 13:06:00 +01:00
adrew
5b78125d11 Add doc for DynamicFunctionStorageProviderInterface 2022-01-28 15:18:30 +03:00
Patrick Remy
8cd5ccd076
feat: make value-of<T> capable for template types 2022-01-27 22:28:40 +01:00
Patrick Remy
2880d046ce
feat: make key-of/value-of usable with non-const arrays 2022-01-27 22:22:14 +01:00
orklah
63b802bff4 remove TPositiveInt 2022-01-23 23:49:23 +01:00
Bruce Weirdan
afa6497051
Dropped THtmlEscapedString 2022-01-03 22:48:59 +02:00
Matthew Brown
83911c7408
Remove unnecessary references to empty in TypeCombiner 2022-01-03 04:10:41 +02:00
orklah
0747b48d06
remove TEmpty 2022-01-03 04:09:59 +02:00
orklah
df42172f8e
update documentation about authoring plugins (#5958) 2021-06-20 14:12:07 -04:00
yoshifp
cf6a4e70c5
Add login required to see 'Use this template' button (#5919) 2021-06-10 22:18:47 -04:00
Oliver Hader
e457a7d5af
[FEATURE] Allow plugins to declare their custom scanner or analyzer (#5883)
* [FEATURE] Allow plugins to declare their custom scanner or analyzer

Related: #5882

* [TEST] Check plugin declaring own scanner/analyzer

* [TASK] Document plugins declaring scanner or analyzer

* [TEST] Clean up code

* [!!!][TASK] Extend Psalm\Plugin\RegistrationInterface

* add method `addFileTypeScanner(string $fileExtension, string $className): void`
* add method `addFileTypeAnalyzer(string $fileExtension, string $className): void`

* [TASK] Ignore IntelliJ/PhpStorm workspace folder in VCS

* [TASK] Remove superfluous class import
2021-06-04 15:32:53 -04:00
orklah
b60c42adca
improve Atomic Types documentation (#4735)
* improve Atomic Types documentation

* add doc

* add doc
2020-11-29 21:41:36 -05:00
Lukas Reschke
5df2b771aa
Fix typo (#4555) 2020-11-15 20:28:51 -05:00
Matthew Brown
8ed34442d0
Update the managing section
cc @weirdan
2020-10-03 10:28:58 -04:00
Matthew Brown
fcc3df12de
Update the discovering plugins docs 2020-10-03 10:23:55 -04:00
Bruno Ribarić
c23406fe36
Fix typo (#4261)
* Fix typo

* Remove word

Co-authored-by: Matthew Brown <github@muglug.com>
2020-09-30 17:48:49 -04:00
Adrien LUCAS
107f596f24
Document Xdebug usage (#4164)
* Document Xdebug usage

* Change to non-persistent approache

Co-authored-by: Bruce Weirdan <weirdan@gmail.com>

Co-authored-by: Bruce Weirdan <weirdan@gmail.com>
2020-09-11 23:35:37 -04:00
Brown
92239add4d Add some backwards-incompatible changes for 4.x 2020-08-30 11:44:14 -04:00
lhchavez
ab3016af6e
Fix File-related analysis plugin hooks (#3970)
This change does a few things:

* Renames `BeforeAnalyzeFileInterface` to `BeforeFileAnalysisInterface`.
* Adds a few more parameters to `BeforeFileAnalysisInterface`.
* Since the analysis was never called due to a bug, the above two
  changes are safe to do.
* Fix the above-mentioned bug, and now adds the hooks to the config.
* Update the documentation about the File-related analysis plugin hooks.
* Add a test to ensure that this does not break again in the future.

Fixes: #3969
2020-08-10 10:49:53 -04:00
Tom Klingenberg
ea52b9d23a
Fix minor typos in docs (#3956)
While I was searching for some code, ran across these.
2020-08-08 08:09:41 -04:00
Brown
8c2f1d7683 Fix capitalisation 2020-06-11 13:40:28 -04:00
Joe Hoyle
1c3796d2a0
Add BeforeAnalyzeFileInterface to Plugin documentation (#3413)
This was missing for one reason or another.
2020-05-20 09:13:29 -04:00
Bruce Weirdan
4f7b51a462
Streamline plugins docs (#3356) 2020-05-14 07:47:55 -04:00
orklah
8571746f8a
Add hook for plugins after FunctionLikeAnalysis (#3258) 2020-04-28 15:30:51 -04:00
Philip Hofstetter
395cf587d3 add plugin hook to be called after every function call
compared to AfterFunctionCallAnalysisInterface which gets only called
after a call to a function declared within the project, a plugin
implementing AfterEveryFunctionCallAnalysisInterface will get called for
every function call, including calls of PHP builtins.

On the other hand, this interface doesn't allow modification of the code
nor tweaking the return type, but it's still useful for accounting
purposes and for depreacting calls to PHP builtins

this fixes #2804
2020-02-13 09:10:24 -05:00
Chad Burrus
7ded79bb27 typo fix : "you" -> "your" (#1976) 2019-07-30 13:22:26 -04:00
Roland Franssen
e58660f38b Add docs for optional ObjectLike (#1942)
* Add docs for optional ObjectLike

ref #634

* Update plugins_type_system.md

* Use better letters
2019-07-17 22:54:01 -04:00
Tyson Andre
220513c5f2 Fix typos with codespell (#1870) 2019-06-28 13:59:09 -04:00
Matthew Brown
a2f444f1b9 Fix link 2019-06-09 01:05:03 -04:00
Matthew Brown
7a1a728cee Move docs into subfolders 2019-06-09 00:54:13 -04:00