-
Notifications
You must be signed in to change notification settings - Fork 426
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix return type of parent calls for SplHeap
- Loading branch information
Showing
8 changed files
with
119 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- memcache/memcache.php 2023-09-04 17:18:27.000000000 +0200 | ||
+++ memcache/memcache.php 2023-09-08 14:29:48.807174822 +0200 | ||
@@ -217,7 +217,7 @@ | ||
* The lowest byte of the int is reserved for pecl/memcache internal usage (e.g. to indicate | ||
* compression and serialization status). | ||
* </p> | ||
- * @return string|array|false <p> | ||
+ * @return mixed <p> | ||
* Returns the string associated with the <b>key</b> or | ||
* an array of found key-value pairs when <b>key</b> is an {@link https://php.net/manual/en/language.types.array.php array}. | ||
* Returns <b>FALSE</b> on failure, <b>key</b> is not found or |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- SPL/SPL_c1.php 2023-09-04 17:18:27.000000000 +0200 | ||
+++ SPL/SPL_c1.php 2023-09-11 17:01:25.336451975 +0200 | ||
@@ -1372,7 +1372,7 @@ | ||
/** | ||
* Extracts a node from top of the heap and sift up. | ||
* @link https://php.net/manual/en/splheap.extract.php | ||
- * @return mixed The value of the extracted node. | ||
+ * @return TValue The value of the extracted node. | ||
*/ | ||
#[TentativeType] | ||
public function extract(): mixed {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Bug9867; | ||
|
||
use function PHPStan\Testing\assertType; | ||
|
||
/** @extends \SplMinHeap<\DateTime> */ | ||
class MyMinHeap extends \SplMinHeap | ||
{ | ||
public function test(): void | ||
{ | ||
assertType('DateTime', parent::current()); | ||
assertType('DateTime', parent::extract()); | ||
assertType('DateTime', parent::top()); | ||
} | ||
|
||
public function insert(mixed $value): bool | ||
{ | ||
assertType('DateTime', $value); | ||
|
||
return parent::insert($value); | ||
} | ||
|
||
protected function compare(mixed $value1, mixed $value2) | ||
{ | ||
assertType('DateTime', $value1); | ||
assertType('DateTime', $value2); | ||
|
||
return parent::compare($value1, $value2); | ||
} | ||
} | ||
|
||
/** @extends \SplMaxHeap<\DateTime> */ | ||
class MyMaxHeap extends \SplMaxHeap | ||
{ | ||
public function test(): void | ||
{ | ||
assertType('DateTime', parent::current()); | ||
assertType('DateTime', parent::extract()); | ||
assertType('DateTime', parent::top()); | ||
} | ||
|
||
public function insert(mixed $value): bool | ||
{ | ||
assertType('DateTime', $value); | ||
|
||
return parent::insert($value); | ||
} | ||
|
||
protected function compare(mixed $value1, mixed $value2) | ||
{ | ||
assertType('DateTime', $value1); | ||
assertType('DateTime', $value2); | ||
|
||
return parent::compare($value1, $value2); | ||
} | ||
} | ||
|
||
/** @extends \SplHeap<\DateTime> */ | ||
abstract class MyHeap extends \SplHeap | ||
{ | ||
public function test(): void | ||
{ | ||
assertType('DateTime', parent::current()); | ||
assertType('DateTime', parent::extract()); | ||
assertType('DateTime', parent::top()); | ||
} | ||
|
||
public function insert(mixed $value): bool | ||
{ | ||
assertType('DateTime', $value); | ||
|
||
return parent::insert($value); | ||
} | ||
} |