Jack Worman
643542346b
Add codesniffer rules and expand php-cs-fixer to bin and test
2022-12-14 13:29:09 -06:00
Corey Taylor
902ea9d7e2
Fix DOM and Reflection unreflectable methods
2022-12-14 10:18:15 -06:00
Corey Taylor
e57079f581
Add validation for Class::Method names in CallMap
2022-12-13 03:34:47 -06:00
Corey Taylor
d9b651a126
Fix return types for date functions in callmap
2022-12-03 17:55:29 -06:00
Fran Moreno
c3bd060f06
Fix DateTimeZone::listAbbreviations return type
...
Also fixes DateTimeZone::getOffset return type
2022-11-18 08:50:00 +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
68a5511057
Merge remote-tracking branch 'origin/4.x' into HEAD
2022-11-08 10:25:04 +01:00
Corey Taylor
b87ebd697f
Fix assert testing callmap return types
2022-11-06 00:59:55 -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
Alies Lapatsin
30dc46528d
Cleaup $ignoredFunctions
2022-10-09 17:40:36 +03:00
Peter de Blieck
15453d4306
Removed imap_delete and imap_undelete from the ignoredFunctions list.
2022-10-06 14:44:49 +02:00
ef60a0c88c
Fix properties-of on generics&intersections
2022-10-03 11:28:01 +02:00
kkmuffme
328561d388
add code for faster debugging next time
2022-09-22 01:01:08 +02:00
kkmuffme
ce76158085
fix crash in <PHP8 with ResourceBundle
...
partially reverts https://github.com/vimeo/psalm/pull/8217
2022-09-22 01:01:08 +02:00
kkmuffme
e2e6265ba1
ignore nullable issues for $argv/$argc
2022-09-19 09:45:55 +02:00
kkmuffme
5c39e66b15
fix tests
2022-09-15 19:38:51 +02:00
kkmuffme
62df25a741
fix test cache inconsistency
2022-09-11 10:28:16 +02:00
kkmuffme
8da5f5eb1a
use exceptions instead of error_log for ParserCacheProvider
...
* use exceptions instead of error_log for ParserCacheProvider like all other cache providers do
* remove duplicate code in ParserCacheProvider
* use same hash as other cache providers
* update Config.php cache directory creation to use same code as ParserCacheProvider
2022-09-11 10:22:48 +02:00
orklah
5cf6fb3574
Merge pull request #8468 from kkmuffme/class-alias-should-not-be-case-insensitive
...
classlike_alias incorrect casing not handled correctly
2022-09-08 23:03:17 +02:00
orklah
eba63a3821
Merge pull request #8367 from kkmuffme/revert-nullable-curl_multi_getcontent
...
partial revert nullable type for curl_multi_getcontent
2022-09-08 22:58:29 +02:00
kkmuffme
6e4c1823d6
partial revert nullable type for curl_multi_getcontent
...
Fix https://github.com/vimeo/psalm/issues/8351
Partially reverts f28ac73777
2022-09-08 21:46:15 +02:00
kkmuffme
4c6abccfb2
fix tests
2022-09-08 21:33:06 +02:00
Paul Fedorow
8908638219
Fix imageinterlace
function signature
2022-08-12 11:22:45 +02:00
Bruce Weirdan
58e87fa5e0
Applied ArraySpreadInsteadOfArrayMergeRector (take 2)
2022-07-29 18:17:21 -04:00
Corey Taylor
f28ac73777
Fix nullable return types for CallMap functions
2022-07-13 22:44:38 -05:00
Corey Taylor
31bee0c845
Fix codestyle erors in InternalCallMapHandlerTest
2022-07-06 03:33:34 -05:00
orklah
e28cd128db
Merge pull request #8217 from othercorey/fix-callmap-funcs
...
Fix several CallMap function signatures
2022-07-06 07:16:13 +02:00
Corey Taylor
b1e3094bae
Allow testing expected CallMap return types and ignore functions that currently fail
2022-07-05 17:32:34 -05:00
Corey Taylor
e0ebfe19a2
Fix class functions CallMap signatures
2022-07-05 15:36:09 -05:00
Corey Taylor
2469b6222d
Fix extract() CallMap signature
2022-07-05 15:36:09 -05:00
Corey Taylor
c71dcd581e
Fix fputcsv() CallMap signature
2022-07-05 15:36:09 -05:00
Corey Taylor
d0dcd543e4
Fix count() CallMap signature
2022-07-05 15:36:06 -05:00
orklah
9b4c8cb53f
Merge pull request #8151 from othercorey/fix-array-sigs
...
Fix array_* function signatures
2022-06-24 18:43:00 +02:00
orklah
cd54574616
Merge pull request #8152 from othercorey/fix-filter-var
...
Fix filter_var and filter_var_array signatures
2022-06-24 18:42:31 +02:00
Corey Taylor
3297e35d9a
Fix datefmt_* function signatures
2022-06-23 22:55:29 -05:00
Corey Taylor
e1e858512d
Fix filter_var and filter_var_array signatures
2022-06-23 21:50:41 -05:00
Corey Taylor
417bf87df0
Fix array_* function signatures
2022-06-23 20:32:29 -05:00
Corey Taylor
b053253513
Fix signatures of ldap_* functions
2022-06-23 04:21:56 -05:00
Sam
de8187d138
Update tests/Internal/Codebase/InternalCallMapHandlerTest.php
2022-06-22 19:04:28 +02:00
Sam Mousa
c393a20471
fix static analysis comments
2022-06-22 15:37:51 +02:00
Sam Mousa
ac091902c1
php version specific ignores
2022-06-22 15:32:35 +02:00
Sam Mousa
08aea9c8ca
remove debug code
2022-06-22 15:08:50 +02:00
Sam Mousa
f8e548e811
fix code style remove debug code
2022-06-22 15:05:24 +02:00
Sam Mousa
d13a428cb5
update ignores, cleanup test file
2022-06-22 14:57:40 +02:00
Sam Mousa
d2467cfb7e
sort ignore list add more functions to it
2022-06-22 13:28:17 +02:00
Sam Mousa
37549ee03c
add test for ignore list cleanup
2022-06-22 12:59:47 +02:00
Sam Mousa
f6be3efa42
fix: added more type annotations
2022-06-15 15:05:06 +02:00
Sam Mousa
cc58fd9401
fix: add more typehints
2022-06-15 14:46:50 +02:00
Sam Mousa
df750709cc
fix: ignore last remaining failing function
2022-06-15 13:29:22 +02:00
Sam Mousa
b46f556662
chore: fix cs
2022-06-15 13:28:09 +02:00
Sam Mousa
0e7ea855d0
fix: ignore functions that fail on windows
2022-06-15 13:23:32 +02:00
Sam Mousa
c3a97e0258
fix: add typehints
2022-06-15 13:16:24 +02:00
Sam Mousa
0484ee1560
chore: remove unused property
2022-06-15 13:13:24 +02:00
Sam Mousa
e826110417
fix: ignore all faulty callmap entries and revert callmap changes
2022-06-15 12:09:47 +02:00
Sam Mousa
ded566e79a
fix: callmap improvements and updated ignore list
2022-06-15 10:56:15 +02:00
Sam Mousa
c638006f5b
fix: add memcache family of function to ignore list
2022-06-15 09:27:40 +02:00
Sam Mousa
7bc5721d4c
fix: php8.1 syntax in tests
2022-06-15 09:11:14 +02:00
Sam Mousa
c1c3b20016
fix: more callmap fixes
2022-06-14 16:58:49 +02:00
Sam Mousa
e78c0a5e11
chore: remove undefined skip function
2022-06-14 15:43:13 +02:00
Sam Mousa
1b5a01dd77
wip: lots of fixes to the callmap
2022-06-14 15:16:13 +02:00
Sam Mousa
507e792d91
added more type validity checks to reduce possible false positives
2022-06-13 15:29:21 +02:00
Sam Mousa
c7e39e76fc
tests: add test that validates the callmap in the current runtime
2022-06-13 15:10:23 +02:00
AndrolGenhald
7558ef5e85
Fix @covers annotation.
2022-01-11 10:03:00 -06:00
Stefan Vetsch
3893abff72
Use directory separator to make test more portable
2021-12-24 15:55:24 +01:00
Stefan Vetsch
c3752b4a2b
Fix psalm issues
2021-12-24 10:59:39 +01:00
Stefan Vetsch
5331091f5e
Simplify argv handling, the first element is always the script name
2021-12-24 10:05:52 +01:00
Stefan Vetsch
ecc7400530
Add CliUtilsTest with test cases for old behaviour
2021-12-24 09:54:37 +01:00
rarila
97e6511fab
Set number of lines before and after namespace.
2021-12-15 04:58:32 +01:00
rarila
7df7c1f070
Format declare(strict_types=1)
2021-12-15 04:42:37 +01:00
rarila
39402c233d
Return type hints ( #7065 )
...
Co-authored-by: ralila <>
2021-12-05 19:51:26 +02:00
ralila
f833085a15
Fix fqn usage in php-doc
2021-12-04 03:37:19 +01:00
ralila
d5d277f579
Set further phpcs fqn options
2021-12-03 22:44:41 +01:00
ralila
30a65685a2
Import instead of using fqn classes
2021-12-03 21:40:18 +01:00
ralila
245920e53c
Import instead of using fqn
2021-12-03 20:11:20 +01:00
Maximilian Bösing
62b0a09741
qa: remove useless var
annotation and the psalm suppression
...
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2021-11-15 19:06:33 +01:00
Maximilian Bösing
665cea7fbf
bugfix: prevent psalm from yelling about docblock type contradiction
...
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2021-11-15 18:36:04 +01:00
Maximilian Bösing
a2bf87b1fc
qa: ensure psalm is able to understand already verified types
...
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2021-11-15 18:31:28 +01:00
Maximilian Bösing
68abcaab5c
feature: extract class constant by wildcard detection into dedicated resolver
...
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2021-11-15 18:27:19 +01:00
orklah
c74e81ca8f
fix build
2021-09-23 19:29:15 +02:00
Maximilian Bösing
d4559f5ba3
qa: add failing test regarding recursive alias resolving
...
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2021-08-18 16:18:44 +02:00
Maximilian Bösing
990723ce64
qa: rework unit test to use already available project_initializer
...
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2021-08-17 21:46:00 +02:00
Maximilian Bösing
7ab5d29e08
qa: add unit test to verify aliased interface is properly detected
...
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2021-08-17 18:40:18 +02:00
Bruce Weirdan
8c531fec4b
Tweaks
...
Changed the format of the historical callmap to be plain signature list,
as it isn't really a delta file and renamed the file to not be confused
with deltas.
Added a test to ensure entries in main callmap have history.
2021-08-08 18:43:42 +03:00
bjscharp
96056d329f
Add simple test to verify outout of getCallMap method
...
Convert deltafile format to new style proposed by weirdan
Modify CallMapTest to use new format
Modify InternalCallMapHandler to use new format
Move assertions to base testcase
2021-08-08 10:39:54 +02:00
bjscharp
d1d9e3763c
Removed unused test dependencies
2021-08-06 07:45:17 +02:00
bjscharp
a01b92de8a
Split duplicate add/remove check off into seperate tests to deal with several extra error paths
2021-08-06 07:33:37 +02:00
bjscharp
f39c462138
Add missing bcadd function to 8.0 delta file.
...
To prevent similar errors, add baseline file with signatures pre-7.1, to help verify delta files are correct.
Modify test to use this to detect missing 'old' entries
2021-08-05 23:21:41 +02:00
bjscharp
ac5ea252ff
Added test to detect problems and inconsistencies in CallMap files
...
- Fixed inconsistencies in callmap delta files (mainly 8.0)
- Added several missing changes in the bc_* functions
- Added several missing changes in the mb_* functions
- Added several missing changes in the xml_parser_* functions
- Fixed several issues with sodium_ functions
- Removed all but one of the date_* functions. All were marked as having lost the option to return false, despite this only being true for date_format
2021-08-05 19:07:31 +02: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
248a07fd35
Ship FakeFileProvider even with dist dev releases
...
Refs psalm/psalm.dev#60
2021-07-02 00:26:20 +03:00
Matt Brown
23b7ff86b7
Mark interface methods as unused even when inherited
2021-06-12 16:13:29 -04:00
Matthew Brown
6d09418a23
Detect unused return values ( #5917 )
...
* Detect unused return values
* Allow static-returning instance methods (presumed to be fluent)
* Make $is_used the default for Codebase::methodExists
2021-06-10 14:18:15 -04:00
Bruce Weirdan
6abce3525a
Enforce use
sort ( #5900 )
2021-06-07 22:55:21 -04:00
Matt Brown
6a61298074
Fix #5810 - detect properties that are never read
2021-05-21 09:25:57 -04:00
Matt Brown
03665b9646
Revert "Correct Psalm’s concept of string emptiness"
...
This reverts commit 331ce8ead4
.
It was too hasty
2021-02-03 01:09:58 -05:00
Matt Brown
331ce8ead4
Correct Psalm’s concept of string emptiness
...
It contrasted with PHP’s idea
2021-02-02 23:07:51 -05:00
Joe Hoyle
ba43e6d0f3
Remove file map cache when re-analyzing files ( #5084 )
...
* Remove file map cache when re-analyzing files
When the project is re-analyzed under the single thread condition (not using a process pool), the filemaps are not cleared before re-analyzing files. This means that file maps only get appended to. If you delete the contents of a file via the LSP, the file map will still be populated with all the old values for example.
In doing this I had to write a few more tests to check my assumptions too, so adding those additional tests.
* Rename test
* Formatting
* Formatting again!
2021-01-22 16:05:28 -05:00
orklah
09fb141e49
Document lowercase-string when possible ( #4904 )
...
* document lowercase-string
* fix missing strtolower
2020-12-29 11:42:12 +00:00