New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge 4.x #8591
Merge 4.x #8591
Commits on May 21, 2022
Commits on May 22, 2022
Commits on May 23, 2022
Commits on Jun 21, 2022
Commits on Jul 10, 2022
-
-
Merge pull request vimeo#8240 from kkmuffme/fix-cache-race-condition-…
…multiple-psalm-instances use lock to fix race condition in cache
-
-
Merge pull request vimeo#8243 from kkmuffme/change-trigger-error-to-e…
…rror-log use error_log instead of trigger_error
-
Commits on Jul 11, 2022
-
-
Merge pull request vimeo#8214 from BenMorel/geos2
Fix GEOSGeometry stubs with default values
-
Merge pull request vimeo#8244 from jack-worman/CountReport
New "Count" Report Format
Commits on Jul 12, 2022
-
vimeo#8200 - improve inferring the "final"
static
type when calling…… static methods inside a different class differentiate between `static` defined in a class which CALLS a given static method, and `static` defined in the method which IS CALLED.
-
vimeo#8200 - generalize ExistingAtomicStaticCallAnalyzer::hasStaticIn…
…Type() for non-object cases
-
vimeo#8200 - flip logic of determining "source" of
static
type in E……xistingAtomicStaticCallAnalyzer::getMethodReturnType()
-
-
Merge pull request vimeo#7994 from aszenz/4.x
Adds support for fixing missing throws doc block
Commits on Jul 14, 2022
-
-
Merge pull request vimeo#8228 from othercorey/callmap-nullable
Fix nullable return types for CallMap functions
-
-
Merge pull request vimeo#8249 from someniatko/issue-8200
Improve inferring the "final" `static` type when calling static methods inside a different class
Commits on Jul 21, 2022
-
-
Merge pull request vimeo#8304 from kkmuffme/fix-triggerErrorExits-con…
…fig-not-working fix triggerErrorExits not working
Commits on Jul 22, 2022
-
-
Merge pull request vimeo#8308 from honca/4.x
Fixed ini_set types for arg value
Commits on Jul 25, 2022
-
-
-
Merge pull request vimeo#8312 from fluffycondor/dateperiod-stub
Add stub for DatePeriod
-
Merge pull request vimeo#8302 from kkmuffme/fix-cache-directory-race-…
…conditions fix race conditions causing notices if directory does not exist
Commits on Jul 29, 2022
-
vimeo#8330 - take into account that
static
type may have been unwra……pped in ExistingAtomicStaticCallAnalyzer#hasStaticInType()
-
Merge pull request vimeo#8335 from someniatko/issue-8330
vimeo#8330 - take into account that `static` type may have been unwrapped in `hasStaticInType()`
-
Merge pull request vimeo#8341 from someniatko/issue-7731
recognize `@psalm-allow-private-mutation` in PHP 8+ constructors
-
Merge pull request vimeo#8344 from mathroc/chore/update-ReflectionPro…
…perty-getValue-args-type ReflectionProperty::getValue $object is nullable since php 8.0
Commits on Jul 30, 2022
Commits on Jul 31, 2022
-
Merge pull request vimeo#8349 from VincentLanglet/formatCurrency
Fix formatCurrency return type
-
Added better stubs for
DateTimeImmutable
, highlighting how the cons……tructor is **NOT** immutable `DateTimeImmutable` is **almost** immutable: `DateTimeImmutable::__construct()` is in fact not a pure method, since `new DateTimeImmutable('now')` produces a different value at each instantiation (by design). This change makes sure that `DateTimeImmutable` loses its `@psalm-immutable` class-level marker, preventing downstream misuse of the constructor inside otherwise referentially transparent code. Note: only pure methods are stubbed here: all other methods declared by `DateTimeImmutable` (parent interface) are NOT present here, and are either inferred from runtime reflection, or `CallMap*.php` definitions. Methods are sorted in the order defined by reflection on PHP 8.1.8, at the time of writing this ( https://3v4l.org/3TGg8 ). Following simplistic snippet was used to infer the current signature: ```php <?php $c = new \ReflectionClass(\DateTimeImmutable::class); $methods = array_map(function ($m) { return $m->getName() . '(' . implode(',', array_map(function ($p) { return $p->getType() . ' $' . $p->getName() . ($p->isOptional() ? ' = ' . var_export($p->getDefaultValue(), true) : ''); }, $m->getParameters())) . ')' . ($m->getReturnType() ? (': ' . $m->getReturnType()) : ''); }, $c->getMethods()); $properties = array_map(function ($m) { return $m->getName(); }, $c->getProperties()); var_dump($methods, $properties); ```
-
Removed
@psalm-immutable
marked fromMyDate
extending `DateTimeIm……mutable` `DateTimeImmutable` is not really immutable, therefore this marker was wrong upfront
Commits on Aug 1, 2022
-
s/psalm-pure/psalm-mutation-free, since psalm-mutation-free is safer …
…to use Ref: https://github.com/vimeo/psalm/pull/8350/files/c205d652d1e9afd9510db59e72c3fd0a4a093b3d#r934032422 The idea is that `@psalm-pure` disallows `$this` usage in child classes, which is not wanted, while `@psalm-mutation-free` allows it. By using `@psalm-mutation-free`, we don't completely destroy inheritance use-cases based on internal (immutable) state.
Commits on Aug 3, 2022
-
-
Merge pull request vimeo#8364 from kkmuffme/add-but-to-differentiate-…
…errors-invalidargument add ", but" for InvalidArgument error message where a type is provided
Commits on Aug 4, 2022
-
vimeo#8363 - ensure we recognize inherited static methods for the fir…
…st-class callables
-
vimeo#8363 - support
static
as a type parameter in return types of ……the first-class callables
Commits on Aug 5, 2022
-
Removed
DateTimeImmutable::createFromFormat()
from the CallMap: ful……ly covered by stub
-
Removed
DateTimeImmutable::format()
from the CallMap: fully covered…… by stub Note: some conditional return type magic was required here. See: vimeo#8350 (comment)
-
Removed
DateTimeImmutable::getTimezone()
from the CallMap: fully co……vered by stub Note: also verified that a `DateTimeImmutable#getTimezone()` always returns a default timezone (initialized internally), and therefore restricted the type a bit.
-
Removed
DateTimeImmutable::getTimestamp()
from the CallMap: fully c……overed by stub This also simplifies the return type from `int|false` to always `int`, since a timestamp can always be produced. Ref: https://github.com/php/php-src/blob/eff9aed1592f59cddb12d36a55dec0ccc3bbbfd6/ext/date/php_date.stub.php#L496-L500
-
Removed
DateTimeImmutable::modify()
from the CallMap: fully covered…… by stub Also expanded the return type from `static` to `static|false`, since the operation can fail (with a warning too), such as in following example: https://3v4l.org/Xrjlc ```php <?php var_dump( (new DateTimeImmutable()) ->modify('potato') ); ``` Produces ``` Warning: DateTimeImmutable::modify(): Failed to parse time string (potato) at position 0 (p): The timezone could not be found in the database in /in/Xrjlc on line 6 bool(false) ``` Ref: https://github.com/php/php-src/blob/534127d3b22b193ffb9511c4447584f0d2bd4e24/ext/date/php_date.stub.php#L508-L509
-
Removed
DateTimeImmutable::add()
from the CallMap: fully covered by… -
Removed
DateTimeImmutable::setTimezone()
from the CallMap: fully co……vered by stub Also simplified the return type from `static|false` to `static`, since the method throws at all times, on failure. On PHP 7.x, it could only fail if an invalid type was passed in, which is not really valid anyway, from a type perspective. Ref (PHP 8.2.x): https://github.com/php/php-src/blob/534127d3b22b193ffb9511c4447584f0d2bd4e24/ext/date/php_date.c#L3291-L3307 Ref (PHP 8.2.x): https://github.com/php/php-src/blob/534127d3b22b193ffb9511c4447584f0d2bd4e24/ext/date/php_date.stub.php#L517-L518 Ref (PHP 7.0.33): https://github.com/php/php-src/blob/bf574c2b67a1f786e36cf679f41b758b973a82c4/ext/date/php_date.c#L3363-L3379
-
Removed
DateTimeImmutable::setTime()
from the CallMap: fully covere……d by stub Also simplified the return type from `static|false` to `static`, since the method throws at all times, on failure. On PHP 7.x, it could only fail if an invalid type was passed in, which is not really valid anyway, from a type perspective. Ref (PHP 8.1.x): https://github.com/php/php-src/blob/32d55f74229e7913db0d59ef874a401744479b6a/ext/date/php_date.c#L3212-L3228 Ref (PHP 7.0.33): https://github.com/php/php-src/blob/bf574c2b67a1f786e36cf679f41b758b973a82c4/ext/date/php_date.c#L3447-L3463
-
Removed
DateTimeImmutable::setDate()
from the CallMap: fully covere……d by stub Also simplified the return type from `static|false` to `static`, since the method throws at all times, on failure. On PHP 7.x, it could only fail if an invalid type was passed in, which is not really valid anyway, from a type perspective. Ref (PHP 8.1.x): https://github.com/php/php-src/blob/32d55f74229e7913db0d59ef874a401744479b6a/ext/date/php_date.c#L3258-L3274 Ref (PHP 7.0.33): https://github.com/php/php-src/blob/bf574c2b67a1f786e36cf679f41b758b973a82c4/ext/date/php_date.c#L3496-L3512
-
Removed
DateTimeImmutable::setISODate()
from the CallMap: fully cov……ered by stub Also simplified the return type from `static|false` to `static`, since the method throws at all times, on failure. On PHP 7.x, it could only fail if an invalid type was passed in, which is not really valid anyway, from a type perspective. Ref (PHP 8.1.x): https://github.com/php/php-src/blob/32d55f74229e7913db0d59ef874a401744479b6a/ext/date/php_date.c#L3308-L3324 Ref (PHP 7.0.33): https://github.com/php/php-src/blob/bf574c2b67a1f786e36cf679f41b758b973a82c4/ext/date/php_date.c#L3549-L3565
-
Removed
DateTimeImmutable::setTimestamp()
from the CallMap: fully c……overed by stub Also simplified the return type from `static|false` to `static`, since the method throws at all times, on failure. On PHP 7.x, it could only fail if an invalid type was passed in, which is not really valid anyway, from a type perspective. Ref (PHP 8.1.x): https://github.com/php/php-src/blob/32d55f74229e7913db0d59ef874a401744479b6a/ext/date/php_date.c#L3353-L3369 Ref (PHP 7.0.33): https://github.com/php/php-src/blob/bf574c2b67a1f786e36cf679f41b758b973a82c4/ext/date/php_date.c#L3596-L3612
-
Removed
DateTimeImmutable::createFromMutable()
from the CallMap: fu……lly covered by stub
-
Simplified
DateTimeImmutable::format()
: always returns astring
Also: * a non-empty format string will always lead to `non-empty-string` * it seems that you can throw **everything** at `DateTimeInterface#format()`, even null bytes, and it will always produce a `string`
-
Removed
DateTimeImmutable::createFromInterface()
from stubsWhile there is value in declaring `DateTimeImmutable::createFromInterface()` as mutation-free in a stub, this method was introduced in PHP 8.0, so we cannot really declare it in a stub. For now, we drop it, as the value of its stub declaration is much lower than the problems it introduces through its conditional existence.
Commits on Aug 7, 2022
-
Merge pull request vimeo#8350 from Ocramius/fix/datetime-constructor-…
…is-not-immutable Added better stubs for `DateTimeImmutable`, highlighting how the constructor is **NOT** immutable
Commits on Aug 8, 2022
-
Undefined classes in function dockblocks should not crash psalm. Test provided by @AndrolGenhald
-
Merge pull request vimeo#8376 from Daeroni/fix-8373
Use classlike_storage_provider only if it has the required data
Commits on Aug 11, 2022
-
-
Merge pull request vimeo#8400 from staabm/truthy
added truthy-string alias for non-falsy-string
-
Merge pull request vimeo#8372 from kkmuffme/safely-read-write-cache-data
always use lock when writing/reading cache data to/from file
Commits on Aug 12, 2022
-
-
-
Merge pull request vimeo#8403 from paulfedorow/imageinterlace-callmap…
…-fix-4.x Fix `imageinterlace` function signature
-
Merge pull request vimeo#8405 from vjik/get-modifiers-name
Clarification of `Reflection::getModifierNames()` result type
Commits on Aug 18, 2022
-
Merge pull request vimeo#8370 from someniatko/issue-8363
Ensure we recognize inherited static methods for the first-class callables
Commits on Aug 20, 2022
Commits on Aug 22, 2022
-
-
-
Merge pull request vimeo#8427 from staabm/attr
added SensitiveParameter, AllowDynamicProperties php 8.2 attributes
Commits on Aug 23, 2022
-
Allow any attribute for complex types in schema
Denis Kuznetsov committedAug 23, 2022 -
Allow *bin2hex and *bin2base64 functions to keep non-empty-string type
Those functions should not return a string when they receive a non-empty-string in input. The following example is expected to work: ```php <?php /** * @param non-empty-string $i */ function takesNonEmptyString(string $i): void { echo $i; } takesNonEmptyString(bin2hex("a")); takesNonEmptyString(base64_encode("a")); ```
-
Merge pull request vimeo#8431 from LeSuisse/bin2hex-base64-stub
Allow *bin2hex and *bin2base64 functions to keep non-empty-string type
Commits on Aug 24, 2022
-
-
Merge pull request vimeo#8435 from VincentLanglet/arrayReduce
Add support for callable in array_reduce
-
Merge pull request vimeo#8436 from TimWolla/attribute-target
Configure a correct attribute target in stubs/CoreGenericClasses.phpstub
Commits on Aug 25, 2022
Commits on Aug 26, 2022
Commits on Aug 28, 2022
-
Merge pull request vimeo#8428 from den-kuz/4.x
Allow any attribute for complex types in schema
Commits on Aug 31, 2022
-
Merge pull request vimeo#8444 from SCIF/bugfix-8439
trim(), ltrim(), rtrim() now keep lowercase string attribute
Commits on Sep 2, 2022
-
-
Signed-off-by: sashashura <93376818+sashashura@users.noreply.github.com>
Commits on Sep 5, 2022
-
Merge pull request vimeo#8451 from sashashura/patch-1
GitHub Workflows security hardening
-
Merge pull request vimeo#8450 from fluffycondor/ctype-functions-asser…
…tions Make ctype_digit and ctype_lower work as assertions
Commits on Sep 7, 2022
-
-
Merge pull request vimeo#8466 from fluffycondor/ctype-digit-asserts-n…
…ot-all-numeric-strings Fix ctype_digit assertion bug
Commits on Sep 8, 2022
-
report invalidCasing when using a class that is not user defined too …
…(e.g. new DateTime)
-
preg_replace with anchor will always only have 1 replacement, add lim…
…it for clarity and performance
-
-
Merge pull request vimeo#8465 from kkmuffme/invalid-class-casing-for-…
…native-and-stubbed-classes report invalidCasing when using a class that is not user defined too
-
Merge pull request vimeo#8469 from kkmuffme/strictify-anchored-preg-r…
…eplace preg_replace with anchor will always only have 1 replacement
-
Merge pull request vimeo#8432 from alcaeus/mongodb-stub-corrections
Update call maps for MongoDB extension
-
-
-
partial revert nullable type for curl_multi_getcontent
Fix vimeo#8351 Partially reverts vimeo@f28ac73
-
Merge pull request vimeo#8367 from kkmuffme/revert-nullable-curl_mult…
…i_getcontent partial revert nullable type for curl_multi_getcontent
-
Merge pull request vimeo#8468 from kkmuffme/class-alias-should-not-be…
…-case-insensitive classlike_alias incorrect casing not handled correctly
Commits on Sep 9, 2022
-
Merge pull request vimeo#8136 from sergkash7/patch-1
Update phpredis.phpstub
Commits on Sep 11, 2022
-
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
-
update leftover md5 in provider to commonly used hash
Revert "update leftover md5 in provider to commonly used hash" This reverts commit 66337ec. partially put back Update StatementsProvider.php
-
improve unlinking potential race condition
* fix rare race condition on file cache unlink * remove unnecessary reset() * improve code readability using variable
-
-
Merge pull request vimeo#8415 from kkmuffme/consistent-error-logging-…
…for-cache Consistent error logging for cache
Commits on Sep 13, 2022
-
-
-
-
-
date_get_last_errors()
,DateTime::getLastErrors()
may return falseUp to PHP 8.2, these functions return false if no previous date operations have been performed. In PHP 8.2, false is returned after a date operation that yields neither warnings nor errors: https://3v4l.org/HBq0q https://3v4l.org/3QsKY Signed-off-by: George Steel <george@net-glue.co.uk>
-
-
Commits on Sep 14, 2022
-
Merge pull request vimeo#8478 from gsteel/correct_date_get_last_error…
…s_return_type `date_get_last_errors()`, `DateTime::getLastErrors()` may return false
-
Merge pull request vimeo#8462 from VincentLanglet/dateTimeModify
Add dateTimeModify return type provider
Commits on Sep 15, 2022
Commits on Sep 17, 2022
Commits on Sep 18, 2022
-
Merge pull request vimeo#8489 from hirokinoue/fix-array_key_exists-fa…
…lse-positive Fix array_key_exists first argument false positive
-
Merge pull request vimeo#8493 from HypeMC/object-properties
Document the object with properties syntax
-
Merge pull request vimeo#8492 from HypeMC/consistent-docs-examples
Make template constraints examples in docs consistent
-
Merge pull request vimeo#8491 from HypeMC/array-column-fix
Fix array_column with object and column name null
-
-
-
-
Merge pull request vimeo#8490 from tvdijen/setAttributeNS
Add null-type to several DOM-functions
Commits on Sep 19, 2022
-
-
Merge pull request vimeo#8473 from kkmuffme/detailed-superglobal-types
make superglobals more specific
-
-
-
-
-
-
Merge pull request vimeo#8480 from d-claassen/psalter-throws-namespac…
…ed-exception Make Psalter add `@throws` annotation with properly namespaced exception
-
-
-
-
-
-
Cherry-pick: Try to provide literal int types when possible (fixes vi…
…meo#6966) (vimeo#7071) * Fixed vimeo#6966 * Only accept >= 0 values for mode argument in round() * Made round() only return float or literal float values and remove unneeded test * Registered RoundReturnTypeProvider * Updated cast analyzer to handle single string literal int values as literal ints * Fixed psalm errors * Fix invalid property accesses * Addressed comments * Added Tests * Marked RoundReturnTypeProvider as internal * Fixed CS
Commits on Sep 20, 2022
-
-
Merge pull request vimeo#8366 from kkmuffme/fix-invalid-casts-int-float
Fix invalid casts int and float
Commits on Sep 21, 2022
Commits on Sep 22, 2022
-
use cache for declared function when available before falling back to…
… stubs fixes return type issues reported for the wrong file
-
Merge pull request vimeo#8503 from kkmuffme/fix-phpdoc-errors-reporte…
…d-for-stubs-instead-of-files use cache for declared function when available before falling back to stubs
Commits on Sep 23, 2022
-
Merge pull request vimeo#8416 from kkmuffme/regression-4.25.0-count-r…
…esourcebundle fix crash in <PHP8 with ResourceBundle
Commits on Sep 24, 2022
-
add hideAllErrorsExceptPassedFiles config option
for files only (not directories, since that wouldn't make practical sense)
Commits on Sep 25, 2022
-
Merge pull request vimeo#8502 from kkmuffme/option-to-only-report-err…
…ors-for-passed-file add hideAllErrorsExceptPassedFiles config option
Commits on Oct 4, 2022
Commits on Oct 5, 2022
-
-
-
Merge pull request vimeo#8530 from hamburnyog/add-more-int-type-aliases
Add int type aliases based on existing codes
-
Commits on Oct 6, 2022
-
-
Merge pull request vimeo#8537 from ppdeblieck/stubfix
Fixed function signatures of imap_delete and imap_undelete
Commits on Oct 7, 2022
-
-
Merge pull request vimeo#8542 from gphargreaves/class-constant-named-…
…class Add check for class const with reserved word 'class'
Commits on Oct 9, 2022
-
-
-
-
-
-
-
add false return type to additional phpredis functions
address phpredis/phpredis#2120 (comment) - weedwacker method, as I don't have time to check it all one by one
-
-
technically all stringable types work phpredis/phpredis#1735 (comment) however they're all cast to string implicitly, which unevitably leads to unexpected results (see riskyCast,...)
-
-
Merge pull request vimeo#8553 from lptn/4.x
Update dictionaries for hash ext functions
Commits on Oct 10, 2022
-
-
-
-
-
-
Merge pull request vimeo#8561 from kkmuffme/more-specific-superglobal…
…s-feedback-update More specific superglobals feedback update
-
Merge pull request vimeo#8555 from kkmuffme/phpredis-methods-return-f…
…alse-on-failure Update Phpredis stubs to return false on failure
Commits on Oct 11, 2022
-
Merge pull request vimeo#8567 from nosnickid/fix-min-max-return-type
Fix MinMaxReturnTypeProvider when handling TDependentListKeys
Commits on Oct 13, 2022
-
Correct return type of DateTimeImmutable sub method stub
Greg Hargreaves committedOct 13, 2022 -
Remove link to php-src as was part of the documented reason for the r…
…eturn type false
Greg Hargreaves committedOct 13, 2022 -
Fix test for DateTimeImmutable sub method return type
Greg Hargreaves committedOct 13, 2022
Commits on Oct 14, 2022
-
Add additional checks for concat of non-empty strings to return non-f…
…alsy
Greg Hargreaves committedOct 14, 2022 -
Remove duplicated numeric type declaration
Greg Hargreaves committedOct 14, 2022
Commits on Oct 15, 2022
-
Merge pull request vimeo#8585 from gphargreaves/vimeo#8315/concat-non…
…-empty-strings Add additional checks for concat of non-empty strings to return non-falsy
-
Merge pull request vimeo#8583 from gphargreaves/vimeo#8484/fix-dateti…
…meimmutable-sub Correct return type of DateTimeImmutable sub method stub