Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
danog committed Oct 17, 2022
1 parent 1abade3 commit 15f5c59
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 15 deletions.
4 changes: 3 additions & 1 deletion dictionaries/CallMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -1793,11 +1793,13 @@
'DateTime::setTimestamp' => ['static', 'unixtimestamp'=>'int'],
'DateTime::setTimezone' => ['static', 'timezone'=>'DateTimeZone'],
'DateTime::sub' => ['static', 'interval'=>'DateInterval'],
'DateTimeImmutable::__construct' => ['void', 'time='=>'string'],
'DateTimeImmutable::__construct\'1' => ['void', 'time'=>'?string', 'timezone'=>'?DateTimeZone'],
'DateTimeImmutable::__set_state' => ['static', 'array'=>'array'],
'DateTimeImmutable::__wakeup' => ['void'],
'DateTimeImmutable::add' => ['static', 'interval'=>'DateInterval'],
'DateTimeImmutable::createFromFormat' => ['static|false', 'format'=>'string', 'time'=>'string', 'timezone='=>'?DateTimeZone'],
'DateTimeImmutable::createFromInterface' => ['self', 'object' => 'DateTimeInterface'],
'DateTimeImmutable::createFromInterface' => ['static', 'object' => 'DateTimeInterface'],
'DateTimeImmutable::createFromMutable' => ['static', 'datetime'=>'DateTime'],
'DateTimeImmutable::diff' => ['DateInterval', 'datetime2'=>'DateTimeInterface', 'absolute='=>'bool'],
'DateTimeImmutable::format' => ['string', 'format'=>'string'],
Expand Down
4 changes: 4 additions & 0 deletions dictionaries/CallMap_80_delta.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
'old' => ['int|false'],
'new' => ['int'],
],
'DateTimeImmutable::format' => [
'old' => ['string|false', 'format'=>'string'],
'new' => ['string', 'format'=>'string'],
],
'DateTimeImmutable::getTimestamp' => [
'old' => ['int|false'],
'new' => ['int'],
Expand Down
20 changes: 20 additions & 0 deletions dictionaries/CallMap_historical.php
Original file line number Diff line number Diff line change
Expand Up @@ -1055,6 +1055,26 @@
'DateTime::setTimestamp' => ['static', 'unixtimestamp'=>'int'],
'DateTime::setTimezone' => ['static', 'timezone'=>'DateTimeZone'],
'DateTime::sub' => ['static', 'interval'=>'DateInterval'],
'DateTimeImmutable::__construct' => ['void', 'time='=>'string'],
'DateTimeImmutable::__construct\'1' => ['void', 'time'=>'?string', 'timezone'=>'?DateTimeZone'],
'DateTimeImmutable::__set_state' => ['static', 'array'=>'array'],
'DateTimeImmutable::__wakeup' => ['void'],
'DateTimeImmutable::add' => ['static', 'interval'=>'DateInterval'],
'DateTimeImmutable::createFromFormat' => ['static|false', 'format'=>'string', 'time'=>'string', 'timezone='=>'?DateTimeZone'],
'DateTimeImmutable::createFromMutable' => ['static', 'datetime'=>'DateTime'],
'DateTimeImmutable::diff' => ['DateInterval', 'datetime2'=>'DateTimeInterface', 'absolute='=>'bool'],
'DateTimeImmutable::format' => ['string|false', 'format'=>'string'],
'DateTimeImmutable::getLastErrors' => ['array{warning_count:int,warnings:array<int,string>,error_count:int,errors:array<int,string>}'],
'DateTimeImmutable::getOffset' => ['int'],
'DateTimeImmutable::getTimestamp' => ['int|false'],
'DateTimeImmutable::getTimezone' => ['DateTimeZone|false'],
'DateTimeImmutable::modify' => ['static', 'modify'=>'string'],
'DateTimeImmutable::setDate' => ['static|false', 'year'=>'int', 'month'=>'int', 'day'=>'int'],
'DateTimeImmutable::setISODate' => ['static|false', 'year'=>'int', 'week'=>'int', 'day='=>'int'],
'DateTimeImmutable::setTime' => ['static|false', 'hour'=>'int', 'minute'=>'int', 'second='=>'int', 'microseconds='=>'int'],
'DateTimeImmutable::setTimestamp' => ['static|false', 'unixtimestamp'=>'int'],
'DateTimeImmutable::setTimezone' => ['static|false', 'timezone'=>'DateTimeZone'],
'DateTimeImmutable::sub' => ['static|false', 'interval'=>'DateInterval'],
'DateTimeImmutable::__set_state' => ['static', 'array'=>'array'],
'DateTimeImmutable::__wakeup' => ['void'],
'DateTimeImmutable::getLastErrors' => ['array{warning_count:int,warnings:array<int,string>,error_count:int,errors:array<int,string>}|false'],
Expand Down
14 changes: 7 additions & 7 deletions tests/FunctionCallTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1493,14 +1493,14 @@ function test() : void {
$y2 = date("Y", 10000);
$F2 = date("F", 10000);
/** @psalm-suppress MixedArgument */
$F3 = date("F", $GLOBALS["F3"]);',
$F3 = date("F", $_GET["F3"]);',
'assertions' => [
'$y' => 'numeric-string',
'$m' => 'numeric-string',
'$F' => 'string',
'$y2' => 'numeric-string',
'$F2' => 'string',
'$F3' => 'false|string',
'$y===' => 'numeric-string',
'$m===' => 'numeric-string',
'$F===' => 'string',
'$y2===' => 'numeric-string',
'$F2===' => 'string',
'$F3===' => 'false|string',
]
],
'sscanfReturnTypeWithTwoParameters' => [
Expand Down
7 changes: 0 additions & 7 deletions tests/TaintTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -460,13 +460,6 @@ public static function slugify(string $url) : string {
echo $a[0]["b"];',
],
'intUntainted' => [
'code' => '<?php
$input = $_GET[\'input\'];
if (is_int($input)) {
echo "$input";
}',
],
'dontTaintSpecializedInstanceProperty' => [
'code' => '<?php
/** @psalm-taint-specialize */
Expand Down

0 comments on commit 15f5c59

Please sign in to comment.