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

119 Commits

Author SHA1 Message Date
8078b6dcbf Fixes 2023-04-21 15:58:05 +02:00
4fb5a615f1 Fix tests 2022-12-19 19:24:03 +01:00
Jack Worman
1c19260cdd Require trailing commas 2022-12-18 13:20:31 -06:00
Jack Worman
2b5407d2fb Added SlevomatCodingStandard.TypeHints.ParameterTypeHint sniff and removed php-cs-fixer 2022-12-14 20:26:17 -06:00
Jack Worman
69658e8315 SlevomatCodingStandard.Commenting.DocCommentSpacing 2022-12-14 13:34:41 -06:00
Jack Worman
643542346b Add codesniffer rules and expand php-cs-fixer to bin and test 2022-12-14 13:29:09 -06:00
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
Matthew Brown
8d36bdc3ed
Make array shapes strict by default (#8701)
* Make array shapes strict by default

* Fix PSL tests
2022-11-11 20:14:21 -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
7b6e09afc9 Merge branch 'merge_4.x' into immutable_readonly_3 2022-10-17 12:58:41 +02:00
748a74bb2c Merge remote-tracking branch 'origin/4.x' into HEAD 2022-10-16 13:41:27 +02:00
0155ad7472 Immutable readonly 3 2022-10-03 15:13:47 +02:00
Markus Staab
8f6e16add6 added truthy-string alias for non-falsy-string 2022-08-11 16:49:58 +02:00
orklah
a7b72b865f remove TPositiveInt usage for TIntRange 2022-01-23 22:04:18 +01:00
orklah
0e891f25ad refactor description of types in Atomic 2022-01-22 19:34:57 +01:00
Matthew Brown
b49682a485 Simplify issue suppression in tests 2022-01-13 14:38:17 -05:00
Matthew Brown
f439d6550b
Ensure that all entries in test arrays have explicit keys (#7386)
* Transformation that updates assertions

* Simplify transformation

* Ensure that all tests have keys

* Fix a few remaining keys
2022-01-13 13:49:37 -05: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
rarila
97e6511fab Set number of lines before and after namespace. 2021-12-15 04:58:32 +01:00
rarila
1c298c4605 Conversion of Psalm\Type 2021-12-14 02:31:22 +01:00
AndrolGenhald
23b781163a Use getSingleAtomic() instead of array_values(getAtomicTypes())[0]. 2021-12-11 13:44:34 -06:00
AndrolGenhald
a89e8ec28c Fix non-empty-literal-string to behave as subtype of non-empty-string (fixes #7095). 2021-12-08 13:38:32 -06:00
ralila
8fb2e0f885 Handle some partials 2021-12-04 21:55:53 +01:00
orklah
5d154e1bda fix test 2021-10-18 22:00:51 +02:00
orklah
a9e2284e79 add test 2021-10-18 21:51:36 +02:00
Matt Brown
9dde8eed9d Add support for literal-int annotations as well 2021-06-14 23:24:09 -04:00
Matt Brown
5ae8b2a23f Add preliminary support for literal-string 2021-06-14 15:30:25 -04:00
Bruce Weirdan
6abce3525a
Enforce use sort (#5900) 2021-06-07 22:55:21 -04:00
orklah
ab1732de66
combining never/empty twice gives never (#5756) 2021-05-12 18:46:37 -04:00
Matt Brown
0f7aaa5405 Fix #5696 - combinations of scalars should remove empty-scalar 2021-05-01 20:13:49 -04:00
AndrolGenhald
d022910599
ConcatAnalyzer improvements and non-falsy-string fixes. (#5544)
* ConcatAnalyzer improvements.

Deduplicate code.
Improve type inference.
Allow literal type inference when only one side has multiple types (fixes #5483).
Fix invalid type inference with negative int as right operand.

* Fix inference to be lowercase-string when concatenating int.

* Fix TNonEmptyLowercaseString to not be subtype of TNonFalsyString.

'0' is a non-empty-lowercase-string that is falsy.

* Fix other issues with non-falsy-string.

* Nest ands and ors

Co-authored-by: Matthew Brown <github@muglug.com>
2021-03-31 23:16:21 -04:00
Bruce Weirdan
ec7de89f0c
Do not let string subtypes subsume class-strings (#5497)
Previously, Psalm would treat unions like `class-string|numeric-string`
as `numeric-string`, while the only case when string should subsume
`class-string` is when we're combining `class-string` with non-specific
`string`.

Fixes vimeo/psalm#5491
2021-03-28 23:12:23 -04:00
Matt Brown
ff325b3e70 Fix #5141 - combine numeric-string and non-empty-string to non-empty-string 2021-02-03 17:40:41 -05:00
Matt Brown
a0420fb704 Add non-falsy-string to allow more accurate checks 2021-02-03 17:19:48 -05:00
Matt Brown
0624098865 Ensure getId() output can always be parsed as a type
Ref #5105
2021-01-25 23:41:51 -05:00
Matt Brown
bca58863ad Fix #5017 - handle combining literal and non-empty strings 2021-01-17 12:22:29 -05:00
Matt Brown
df2ec48018 Don’t erase already-known literal ints
Fixes #4644
2020-11-21 18:26:13 -05:00
Matt Brown
f0ae0e5cb4 Break aparat type combiner 2020-11-21 18:11:29 -05:00
Brown
0ae436d335 Fix a couple of false-positive redundant conditions 2020-09-19 18:12:14 -04:00
orklah
ead107fa9e
More return types (#4173)
* add native return types

* redundant phpdoc
2020-09-12 11:24:05 -04:00
Brown
92239add4d Add some backwards-incompatible changes for 4.x 2020-08-30 11:44:14 -04:00
Brown
7fc4a85534 Fix CI 2020-08-03 02:45:55 -04:00
Brown
74eea18563 Add better checks 2020-07-26 19:09:26 -04:00
Brown
7ef3d4711f Fix some more tests 2020-07-21 23:16:56 -04:00
Brown
2312523318 Support merging of numeric-string with literal 2020-05-18 16:56:09 -04:00
Brown
7dfa37beb2 Improve ergonomics of array assignment 2020-04-11 17:50:24 -04:00
Brown
bd2104c5ba Merge with mixed in nested arrays 2020-04-09 09:27:21 -04:00
Matthew Brown
43189b3d55 Allow types to be traversed 2020-03-14 23:54:51 -04:00
Brown
3c416482ec Fix #2932 - don’t crash when trying to expand callable object-like array 2020-03-09 10:56:37 -04:00