Skip to content

Commit

Permalink
changes for PHP 8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Egorskov committed Dec 8, 2024
1 parent 5f5ddb6 commit de1ccf5
Show file tree
Hide file tree
Showing 18 changed files with 16 additions and 16 deletions.
Binary file added .DS_Store
Binary file not shown.
Binary file added src/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion src/Functional/CompareObjectHashOn.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* @return callable
* @no-named-arguments
*/
function compare_object_hash_on(callable $comparison, callable $keyFunction = null)
function compare_object_hash_on(callable $comparison, ?callable $keyFunction = null)
{
$keyFunction = $keyFunction ? compose($keyFunction, 'spl_object_hash') : 'spl_object_hash';

Expand Down
2 changes: 1 addition & 1 deletion src/Functional/CompareOn.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* @return callable
* @no-named-arguments
*/
function compare_on(callable $comparison, callable $reducer = null)
function compare_on(callable $comparison, ?callable $reducer = null)
{
if ($reducer === null) {
return static function ($left, $right) use ($comparison) {
Expand Down
2 changes: 1 addition & 1 deletion src/Functional/Every.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @return bool
* @no-named-arguments
*/
function every($collection, callable $callback = null)
function every($collection, ?callable $callback = null)
{
InvalidArgumentException::assertCollection($collection, __FUNCTION__, 1);

Expand Down
2 changes: 1 addition & 1 deletion src/Functional/First.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* @return mixed
* @no-named-arguments
*/
function first($collection, callable $callback = null)
function first($collection, ?callable $callback = null)
{
InvalidArgumentException::assertCollection($collection, __FUNCTION__, 1);

Expand Down
2 changes: 1 addition & 1 deletion src/Functional/Head.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @return mixed
* @no-named-arguments
*/
function head($collection, callable $callback = null)
function head($collection, ?callable $callback = null)
{
InvalidArgumentException::assertCollection($collection, __FUNCTION__, 1);

Expand Down
2 changes: 1 addition & 1 deletion src/Functional/Last.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @return mixed
* @no-named-arguments
*/
function last($collection, callable $callback = null)
function last($collection, ?callable $callback = null)
{
InvalidArgumentException::assertCollection($collection, __FUNCTION__, 1);

Expand Down
2 changes: 1 addition & 1 deletion src/Functional/Memoize.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @return mixed
* @no-named-arguments
*/
function memoize(callable $callback = null, $arguments = [], $key = null)
function memoize(?callable $callback = null, $arguments = [], $key = null)
{
static $storage = [];
if ($callback === null) {
Expand Down
2 changes: 1 addition & 1 deletion src/Functional/None.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @return bool
* @no-named-arguments
*/
function none($collection, callable $callback = null)
function none($collection, ?callable $callback = null)
{
InvalidArgumentException::assertCollection($collection, __FUNCTION__, 1);

Expand Down
2 changes: 1 addition & 1 deletion src/Functional/Pick.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* @return mixed
* @no-named-arguments
*/
function pick($collection, $index, $default = null, callable $callback = null)
function pick($collection, $index, $default = null, ?callable $callback = null)
{
InvalidArgumentException::assertArrayAccess($collection, __FUNCTION__, 1);

Expand Down
2 changes: 1 addition & 1 deletion src/Functional/Poll.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* @return boolean
* @no-named-arguments
*/
function poll(callable $callback, $timeout, Traversable $delaySequence = null)
function poll(?callable $callback, $timeout, ?Traversable $delaySequence = null)
{
InvalidArgumentException::assertIntegerGreaterThanOrEqual($timeout, 0, __FUNCTION__, 2);

Expand Down
2 changes: 1 addition & 1 deletion src/Functional/Reject.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @return array
* @no-named-arguments
*/
function reject($collection, callable $callback = null)
function reject($collection, ?callable $callback = null)
{
InvalidArgumentException::assertCollection($collection, __FUNCTION__, 1);

Expand Down
2 changes: 1 addition & 1 deletion src/Functional/Retry.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* @return mixed Return value of the function
* @no-named-arguments
*/
function retry(callable $callback, $retries, Traversable $delaySequence = null)
function retry(?callable $callback, $retries, ?Traversable $delaySequence = null)
{
InvalidArgumentException::assertIntegerGreaterThanOrEqual($retries, 1, __FUNCTION__, 2);

Expand Down
2 changes: 1 addition & 1 deletion src/Functional/Select.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @return array
* @no-named-arguments
*/
function select($collection, callable $callback = null)
function select($collection, ?callable $callback = null)
{
InvalidArgumentException::assertCollection($collection, __FUNCTION__, 1);

Expand Down
2 changes: 1 addition & 1 deletion src/Functional/Some.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @return bool
* @no-named-arguments
*/
function some($collection, callable $callback = null)
function some($collection, ?callable $callback = null)
{
InvalidArgumentException::assertCollection($collection, __FUNCTION__, 1);

Expand Down
2 changes: 1 addition & 1 deletion src/Functional/Tail.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @return array
* @no-named-arguments
*/
function tail($collection, callable $callback = null)
function tail($collection, ?callable $callback = null)
{
InvalidArgumentException::assertCollection($collection, __FUNCTION__, 1);

Expand Down
2 changes: 1 addition & 1 deletion src/Functional/Unique.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @return array
* @no-named-arguments
*/
function unique($collection, callable $callback = null, $strict = true)
function unique($collection, ?callable $callback = null, $strict = true)
{
InvalidArgumentException::assertCollection($collection, __FUNCTION__, 1);

Expand Down

0 comments on commit de1ccf5

Please sign in to comment.