Skip to content

Commit

Permalink
Fix stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Sep 5, 2024
1 parent 0ea1d4b commit 42709fc
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
12 changes: 6 additions & 6 deletions stubs/core.stub
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function parse_str(string $string, array &$result): void {}
function mb_parse_str(string $string, array &$result): bool {}

/** @param-out float $percent */
function similar_text(string $string1, string $string2, float &$percent = null) : int {}
function similar_text(string $string1, string $string2, ?float &$percent = null) : int {}

/**
* @param mixed $output
Expand Down Expand Up @@ -258,7 +258,7 @@ function preg_filter($pattern, $replacement, $subject, int $limit = -1, &$count
* @param-out int $count
* @return list<string>|string
*/
function str_replace($search, $replace, $subject, int &$count = null) {}
function str_replace($search, $replace, $subject, ?int &$count = null) {}

/**
* @param array<mixed>|string $search
Expand All @@ -267,7 +267,7 @@ function str_replace($search, $replace, $subject, int &$count = null) {}
* @param-out int $count
* @return list<string>|string
*/
function str_ireplace($search, $replace, $subject, int &$count = null) {}
function str_ireplace($search, $replace, $subject, ?int &$count = null) {}

/**
* @template TRead of null|array<array-key, resource>
Expand All @@ -294,16 +294,16 @@ function flock($stream, int $operation, mixed &$would_block = null): bool {}
* @param-out string $error_message
* @return resource|false
*/
function fsockopen(string $hostname, int $port = -1, int &$error_code = null, string &$error_message = null, ?float $timeout = null) {}
function fsockopen(string $hostname, int $port = -1, ?int &$error_code = null, ?string &$error_message = null, ?float $timeout = null) {}

/**
* @param-out string $filename
* @param-out int $line
*/
function headers_sent(string &$filename = null, int &$line = null): bool {}
function headers_sent(?string &$filename = null, ?int &$line = null): bool {}

/**
* @param-out callable-string $callable_name
* @return ($value is callable ? true : false)
*/
function is_callable(mixed $value, bool $syntax_only = false, string &$callable_name = null): bool {}
function is_callable(mixed $value, bool $syntax_only = false, ?string &$callable_name = null): bool {}
30 changes: 15 additions & 15 deletions stubs/ext-ds.stub
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ final class Deque implements Sequence
* @param (callable(TValue): bool)|null $callback
* @return Deque<TValue>
*/
public function filter(callable $callback = null): Deque
public function filter(?callable $callback = null): Deque
{
}

Expand Down Expand Up @@ -190,7 +190,7 @@ final class Map implements Collection, ArrayAccess
* @param (callable(TKey, TValue): bool)|null $callback
* @return Map<TKey, TValue>
*/
public function filter(callable $callback = null): Map
public function filter(?callable $callback = null): Map
{
}

Expand Down Expand Up @@ -284,31 +284,31 @@ final class Map implements Collection, ArrayAccess
* @param (callable(TValue, TValue): int)|null $comparator
* @return void
*/
public function sort(callable $comparator = null)
public function sort(?callable $comparator = null)
{
}

/**
* @param (callable(TValue, TValue): int)|null $comparator
* @return Map<TKey, TValue>
*/
public function sorted(callable $comparator = null): Map
public function sorted(?callable $comparator = null): Map
{
}

/**
* @param (callable(TKey, TKey): int)|null $comparator
* @return void
*/
public function ksort(callable $comparator = null)
public function ksort(?callable $comparator = null)
{
}

/**
* @param (callable(TKey, TKey): int)|null $comparator
* @return Map<TKey, TValue>
*/
public function ksorted(callable $comparator = null): Map
public function ksorted(?callable $comparator = null): Map
{
}

Expand Down Expand Up @@ -401,7 +401,7 @@ interface Sequence extends Collection, ArrayAccess
* @param (callable(TValue): bool)|null $callback
* @return Sequence<TValue>
*/
public function filter(callable $callback = null);
public function filter(?callable $callback = null);

/**
* @param TValue $value
Expand Down Expand Up @@ -432,7 +432,7 @@ interface Sequence extends Collection, ArrayAccess
* @param string $glue
* @return string
*/
public function join(string $glue = null): string;
public function join(?string $glue = null): string;

/**
* @return TValue
Expand Down Expand Up @@ -509,13 +509,13 @@ interface Sequence extends Collection, ArrayAccess
* @param (callable(TValue, TValue): int)|null $comparator
* @return void
*/
public function sort(callable $comparator = null);
public function sort(?callable $comparator = null);

/**
* @param (callable(TValue, TValue): int)|null $comparator
* @return Sequence<TValue>
*/
public function sorted(callable $comparator = null);
public function sorted(?callable $comparator = null);

/**
* @param TValue ...$values
Expand Down Expand Up @@ -563,15 +563,15 @@ final class Vector implements Sequence
* @param (callable(TValue, TValue): int)|null $comparator
* @return Vector<TValue>
*/
public function sorted(callable $comparator = null): Vector
public function sorted(?callable $comparator = null): Vector
{
}

/**
* @param (callable(TValue): bool)|null $callback
* @return Vector<TValue>
*/
public function filter(callable $callback = null): Vector
public function filter(?callable $callback = null): Vector
{
}

Expand Down Expand Up @@ -642,7 +642,7 @@ final class Set implements Collection, ArrayAccess
* @param (callable(TValue): bool)|null $callback
* @return Set<TValue>
*/
public function filter(callable $callback = null): Set
public function filter(?callable $callback = null): Set
{
}

Expand Down Expand Up @@ -731,15 +731,15 @@ final class Set implements Collection, ArrayAccess
/**
* @param (callable(TValue, TValue): int)|null $comparator
*/
public function sort(callable $comparator = null): void
public function sort(?callable $comparator = null): void
{
}

/**
* @param (callable(TValue, TValue): int)|null $comparator
* @return Set<TValue>
*/
public function sorted(callable $comparator = null): Set
public function sorted(?callable $comparator = null): Set
{
}

Expand Down
2 changes: 1 addition & 1 deletion stubs/ibm_db2.stub
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
*
* @return ($value is null ? \DB2_AUTOCOMMIT_OFF|\DB2_AUTOCOMMIT_ON : bool)
*/
function db2_autocommit($connection, int $value = null) {}
function db2_autocommit($connection, ?int $value = null) {}

0 comments on commit 42709fc

Please sign in to comment.