Javier Spagnoletti
ab13ddf286
[ibm_db2] Improve return type inference for db2_autocommit()
2023-02-24 19:53:42 -03:00
kkmuffme
78c3d6b436
fix lstat bug cache directory race condition
2023-02-09 09:27:51 +01:00
Alies Lapatsin
9d54de6a51
Use a new method to display warning
2023-01-24 06:50:09 +01:00
Alies Lapatsin
0cc770c947
Use a new method to display warning
2023-01-24 06:48:03 +01:00
Alies Lapatsin
b667db20e6
Merge branch 'master' into unify-deprecation-messages
2023-01-24 06:41:43 +01:00
Bruce Weirdan
2af7f51394
Suppress warnings when --no-output
is specified
2023-01-22 20:40:21 -04:00
Alies Lapatsin
a1a2ecc957
Merge branch 'master' into unify-deprecation-messages
2023-01-18 21:14:02 +01:00
Alies Lapatsin
2f385a9057
Unify deprecation messages
2023-01-18 20:54:49 +01:00
Alies Lapatsin
d5e5dc0683
Fully support Psalm 5 behaviour
...
asked by orklah, see
https://github.com/vimeo/psalm/pull/9112#issuecomment-1383239821
2023-01-18 19:06:51 +01:00
Alies Lapatsin
7e157cfe9d
Allow to specify a custom shepherd endpoint (instead of domain)
2023-01-18 19:06:32 +01:00
Jack Worman
56f6dfecc8
Report unused baseline entries
2023-01-17 22:02:21 -05:00
Alies Lapatsin
fc72214bfc
Automatically load stubs for random ext on PHP 8.2
2023-01-12 12:52:45 +01:00
Alies Lapatsin
69b6409feb
Fix coding-style issues
2023-01-10 19:24:33 +01:00
Alies Lapatsin
2626827876
Merge branch 'master' into cleaunup-unsupported-extentions-message
2023-01-09 17:39:56 +04:00
Alies Lapatsin
8b23919241
Extend a list of php ext, supported by CallMap files
2023-01-09 14:31:17 +01:00
Alies Lapatsin
ce8dcdfee7
Do not list core and bundled extensions as unsupported
2023-01-05 18:42:38 +04:00
kkmuffme
1a0c0fe5c5
relative path as absolute paths autoloader legacy issue
2023-01-03 15:35:57 +01:00
kkmuffme
76f90e62f2
code style
2023-01-03 15:21:15 +01:00
kkmuffme
8fe00cf609
fix autoloader not working with absolute path
2023-01-03 15:13:38 +01:00
orklah
dbcfe62c52
Merge pull request #8987 from jack-worman/Always_check_unused_methods_and_properties
...
Add @psalm-api annotation
2022-12-28 15:20:48 +01:00
Jack Worman
1bb9eb4cfc
forbidden function bug and better get_defined_functions() signature
2022-12-24 12:34:40 -06:00
Jack Worman
703a1e1698
@psalm-api
2022-12-23 16:13:46 -06:00
Jack Worman
1c19260cdd
Require trailing commas
2022-12-18 13:20:31 -06:00
Jack Worman
a52f35e5e1
Even more property typehints
2022-12-16 13:24:21 -06:00
orklah
f4d70384ee
Merge pull request #8885 from lptn/php-ext-with-deprecation
...
Deprecation message on loading php-ext stubs without explicitly declaring them as dependency or in a config
2022-12-15 21:17:38 +01:00
Jack Worman
69658e8315
SlevomatCodingStandard.Commenting.DocCommentSpacing
2022-12-14 13:34:41 -06:00
Jack Worman
36fa162d6d
Use php-cs-fixer to clean up docblocks
2022-12-13 20:46:43 -06:00
orklah
794ca9362a
Merge pull request #8887 from jack-worman/Use_rector_to_add_property_typehints
...
Use rector to add property typehints
2022-12-13 19:58:43 +01:00
Alies Lapatsin
1115cfb980
Merge branch 'master' into php-ext-with-deprecation
...
# Conflicts:
# src/Psalm/Config.php
2022-12-12 23:49:01 +01:00
Jack Worman
dd0d8300b1
Use rector to add property typehints
2022-12-11 17:25:23 -06:00
Alies Lapatsin
c8b6b0b504
Remove unused @psalm-suppress
2022-12-11 15:10:43 +01:00
Alies Lapatsin
a8046a8682
Simplify array type declaration
2022-12-11 15:01:34 +01:00
Alies Lapatsin
729eb59169
Remove an excessive array shape annotation
2022-12-11 14:55:42 +01:00
Alies Lapatsin
5e95d13157
Make Psalm about stub file for random (core) extension
2022-12-11 14:45:20 +01:00
Alies Lapatsin
74f65cba71
Make Psalm about stub file for redis extension
2022-12-11 14:39:29 +01:00
Alies Lapatsin
62c998b8cf
Load ext stubs using extension_loaded but display a deprecation note
2022-12-11 14:39:29 +01:00
Alies Lapatsin
0fd4c520de
Load ext stubs using extension_loaded but diaplay a deprecation note
2022-12-11 14:01:20 +01:00
Alies Lapatsin
16ab9f786b
Unify a way how to load stubs for extentions
2022-12-10 17:02:47 +01:00
Marco Pivetta
68d88c546b
Load PHP-version-specific stubs based on analysis PHP version, and only when visiting stub files
...
While `visitPreloadedStubFiles` seemed to work at first, it led to overriding symbols declared by
PHP itself too eagerly.
By only loading PHP-version-specific stubs in `visitStubFiles`, we ensure that the reflection-declared
symbols take priority, and that our stubs overlay on top of that, without actually replacing the
symbol entirely, but rather merging with its definition.
This fixes current test failures too, and works with the code examples
from https://github.com/vimeo/psalm/pull/8722#issuecomment-1339711882
2022-12-08 18:22:51 +01:00
Marco Pivetta
042305107e
Always load preloaded stub files when the analysis version is compatible
...
Before this change, preloaded stubs would only be loaded when running on a PHP version lower than
the one that is in the stubs.
With this change, the analysis PHP version (defined via config, input parameter, or inferred from
the runtime) becomes authoritative.
Since the PHP-version-specific stubs are not just polyfills, but actually type refinements on top
of the PHP core symbols at hand, this change always loads them, so that it is possible to get more
precise type inference downstream.
This will likely lead to downstream breakages, because the stubs do indeed provide better type
resolution, but indeed formalizes the idea that these stubs will provide better value for finding
problems in analyzed code.
2022-12-07 15:48:59 +01:00
Marco Pivetta
322cff6f43
Declaring more precise types and purity boundaries on ext-reflection
symbols in .phpstub
files
...
Also:
* added PHP 8.2 stubs
* refined types to make impossible scenarios more clear (like `ReflectionIntersectionType#allowsNull()`)
This is a first attempt at refining these types: the structure of these stubs is quite confusing to me,
so I don't know if this approach is correct, and if the stubs are merged together, or if entire symbols
need to be completely re-declared for each PHP version.
2022-12-06 11:08:30 +01:00
Bruce Weirdan
6b3dd56850
Defer cache directory creation until it's needed
...
Honestly, this is a bit of a hack, as we let `Config` to generate the
cache directory name and then reset it to null from the cli entrypoint.
Yet it's easier than passing a no-cache flag through so many layers of
static calls.
`$this->cache_directory_initialized` flag is used to make sure we
attempt to create the directory only once.
Fixes vimeo/psalm#4267
2022-11-29 04:16:59 -04:00
Bruce Weirdan
c417af7d44
CS fix
2022-11-25 03:35:47 -04:00
Bruce Weirdan
6c77daf1f4
Upgrade mockery plugin
...
and other assorted fixes for PHP 8.2
2022-11-25 03:33:10 -04:00
kkmuffme
4b20fd3e62
safe delete cache directory files
...
since we safeFileGetContents, it makes sense to also acquire lock before deleting, to avoid reading partial data
2022-11-15 19:54:43 +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
Alies Lapatsin
d9a08ec047
Add stubs for ext-random (PHP 8.2)
2022-11-02 15:59:56 +03:00
Thomas Gerbet
62e92fb0cf
Add stubs for ext-ffi
...
See #8612
2022-10-25 19:59:44 +02:00
748a74bb2c
Merge remote-tracking branch 'origin/4.x' into HEAD
2022-10-16 13:41:27 +02:00