[phpstorm-stubs] Fixed testMethodsDefaultParametersValue and added default values for parameters that missed it.
This commit is contained in:
parent
cd71853118
commit
f94b4fb19f
|
@ -606,8 +606,8 @@ class ErrorException extends Exception
|
|||
#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $message = "",
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $code = 0,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $severity = 1,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $filename = __FILE__,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $line = __LINE__,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $filename = null,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $line = null,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'Throwable|null'], default: 'Throwable')] $previous = null
|
||||
) {}
|
||||
|
||||
|
|
|
@ -1557,7 +1557,7 @@ class PDOStatement implements IteratorAggregate
|
|||
*/
|
||||
#[TentativeType]
|
||||
public function fetch(
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $mode = PDO::FETCH_BOTH,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $mode = PDO::FETCH_DEFAULT,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $cursorOrientation = PDO::FETCH_ORI_NEXT,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $cursorOffset = 0
|
||||
): mixed {}
|
||||
|
@ -1597,7 +1597,7 @@ class PDOStatement implements IteratorAggregate
|
|||
#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $param,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] &$var,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $type = PDO::PARAM_STR,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $maxLength = null,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $maxLength = 0,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $driverOptions = null
|
||||
): bool {}
|
||||
|
||||
|
@ -1629,7 +1629,7 @@ class PDOStatement implements IteratorAggregate
|
|||
#[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $column,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] &$var,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $type = PDO::PARAM_STR,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $maxLength = null,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $maxLength = 0,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $driverOptions = null
|
||||
): bool {}
|
||||
|
||||
|
@ -1734,7 +1734,7 @@ class PDOStatement implements IteratorAggregate
|
|||
*/
|
||||
#[TentativeType]
|
||||
public function fetchAll(
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $mode = PDO::FETCH_BOTH,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $mode = PDO::FETCH_DEFAULT,
|
||||
#[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $fetch_argument = null,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] ...$args
|
||||
): array {}
|
||||
|
|
|
@ -137,7 +137,7 @@ class Phar extends RecursiveDirectoryIterator implements RecursiveIterator, Seek
|
|||
#[TentativeType]
|
||||
public function buildFromDirectory(
|
||||
#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $directory,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $pattern = null
|
||||
#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $pattern = ''
|
||||
): array {}
|
||||
|
||||
/**
|
||||
|
@ -257,8 +257,8 @@ class Phar extends RecursiveDirectoryIterator implements RecursiveIterator, Seek
|
|||
*/
|
||||
#[TentativeType]
|
||||
public function convertToExecutable(
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $format = 9021976,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $compression = 9021976,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $format = null,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $compression = null,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $extension = null
|
||||
): ?Phar {}
|
||||
|
||||
|
@ -293,8 +293,8 @@ class Phar extends RecursiveDirectoryIterator implements RecursiveIterator, Seek
|
|||
*/
|
||||
#[TentativeType]
|
||||
public function convertToData(
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $format = 9021976,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $compression = 9021976,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $format = null,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $compression = null,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $extension = null
|
||||
): ?PharData {}
|
||||
|
||||
|
@ -622,7 +622,7 @@ class Phar extends RecursiveDirectoryIterator implements RecursiveIterator, Seek
|
|||
*/
|
||||
public function setStub(
|
||||
$stub,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $length = -1
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $length = null
|
||||
) {}
|
||||
|
||||
/**
|
||||
|
@ -896,9 +896,9 @@ class Phar extends RecursiveDirectoryIterator implements RecursiveIterator, Seek
|
|||
*/
|
||||
final public static function webPhar(
|
||||
?string $alias = null,
|
||||
?string $index = "index.php",
|
||||
?string $index = null,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: 'string')] $fileNotFoundScript = null,
|
||||
array $mimeTypes = null,
|
||||
array $mimeTypes = [],
|
||||
?callable $rewrite = null
|
||||
): void {}
|
||||
|
||||
|
@ -1005,7 +1005,7 @@ class PharData extends Phar
|
|||
#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $filename,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = FilesystemIterator::KEY_AS_PATHNAME|FilesystemIterator::CURRENT_AS_FILEINFO,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $alias = null,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $format = Phar::TAR
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $format = 0
|
||||
) {}
|
||||
|
||||
/**
|
||||
|
@ -1240,7 +1240,7 @@ class PharFileInfo extends SplFileInfo
|
|||
* @return bool <b>TRUE</b> if the file is compressed within the Phar archive, <b>FALSE</b> if not.
|
||||
*/
|
||||
#[TentativeType]
|
||||
public function isCompressed(#[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $compression = 9021976): bool {}
|
||||
public function isCompressed(#[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $compression = null): bool {}
|
||||
|
||||
/**
|
||||
* (PHP >= 5.3.0, PECL phar >= 1.0.0)<br/>
|
||||
|
|
|
@ -278,7 +278,7 @@ class ReflectionClass implements Reflector
|
|||
*/
|
||||
#[Pure]
|
||||
#[TentativeType]
|
||||
public function getReflectionConstants(#[PhpStormStubsElementAvailable(from: '8.0')] ?int $filter = ReflectionClassConstant::IS_PUBLIC|ReflectionClassConstant::IS_PROTECTED|ReflectionClassConstant::IS_PRIVATE): array {}
|
||||
public function getReflectionConstants(#[PhpStormStubsElementAvailable(from: '8.0')] ?int $filter = null): array {}
|
||||
|
||||
/**
|
||||
* Checks if constant is defined
|
||||
|
@ -300,7 +300,7 @@ class ReflectionClass implements Reflector
|
|||
*/
|
||||
#[Pure]
|
||||
#[TentativeType]
|
||||
public function getConstants(#[PhpStormStubsElementAvailable(from: '8.0')] ?int $filter = ReflectionClassConstant::IS_PUBLIC|ReflectionClassConstant::IS_PROTECTED|ReflectionClassConstant::IS_PRIVATE): array {}
|
||||
public function getConstants(#[PhpStormStubsElementAvailable(from: '8.0')] ?int $filter = null): array {}
|
||||
|
||||
/**
|
||||
* Gets defined constant
|
||||
|
|
|
@ -447,7 +447,7 @@ class IteratorIterator implements OuterIterator
|
|||
* @param Traversable $iterator
|
||||
* @param string|null $class [optional]
|
||||
*/
|
||||
public function __construct(Traversable $iterator, #[PhpStormStubsElementAvailable(from: '8.0')] ?string $class = '') {}
|
||||
public function __construct(Traversable $iterator, #[PhpStormStubsElementAvailable(from: '8.0')] ?string $class = null) {}
|
||||
|
||||
/**
|
||||
* Get the inner iterator
|
||||
|
@ -1336,7 +1336,7 @@ class RecursiveRegexIterator extends RegexIterator implements RecursiveIterator
|
|||
public function __construct(
|
||||
RecursiveIterator $iterator,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $pattern,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $mode = self::MATCH,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $mode = RegexIterator::MATCH,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = 0,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $pregFlags = 0
|
||||
) {}
|
||||
|
|
|
@ -59,7 +59,7 @@ class SplFileInfo implements Stringable
|
|||
* @since 5.2.2
|
||||
*/
|
||||
#[TentativeType]
|
||||
public function getBasename(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $suffix = null): string {}
|
||||
public function getBasename(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $suffix = ''): string {}
|
||||
|
||||
/**
|
||||
* Gets the path to the file
|
||||
|
@ -582,7 +582,7 @@ class GlobIterator extends FilesystemIterator implements Countable
|
|||
*/
|
||||
public function __construct(
|
||||
#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $pattern,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = FilesystemIterator::KEY_AS_PATHNAME|FilesystemIterator::CURRENT_AS_FILEINFO
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_FILEINFO
|
||||
) {}
|
||||
|
||||
/**
|
||||
|
@ -889,7 +889,7 @@ class SplFileObject extends SplFileInfo implements RecursiveIterator, SeekableIt
|
|||
#[TentativeType]
|
||||
public function fwrite(
|
||||
#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $data,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $length = null
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $length = 0
|
||||
): int|false {}
|
||||
|
||||
/**
|
||||
|
@ -2420,4 +2420,4 @@ class MultipleIterator implements Iterator
|
|||
*/
|
||||
#[TentativeType]
|
||||
public function __debugInfo(): array {}
|
||||
}
|
||||
}
|
|
@ -27,8 +27,8 @@ class CURLFile
|
|||
*/
|
||||
public function __construct(
|
||||
#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $filename,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $mime_type = '',
|
||||
#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $posted_filename = ''
|
||||
#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $mime_type = null,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $posted_filename = null
|
||||
) {}
|
||||
|
||||
/**
|
||||
|
|
|
@ -389,7 +389,7 @@ class DOMNode
|
|||
/**
|
||||
* @since 8.3
|
||||
*/
|
||||
public function getRootNode(?array $options = []): DOMNode {}
|
||||
public function getRootNode(?array $options = null): DOMNode {}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -876,7 +876,7 @@ class DOMDocument extends DOMNode implements DOMParentNode
|
|||
public function createProcessingInstruction(
|
||||
#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $target,
|
||||
#[PhpStormStubsElementAvailable(from: '5.3', to: '7.3')] $data,
|
||||
#[PhpStormStubsElementAvailable(from: '7.4')] #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $data = null
|
||||
#[PhpStormStubsElementAvailable(from: '7.4')] #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $data = ''
|
||||
) {}
|
||||
|
||||
/**
|
||||
|
@ -1061,7 +1061,7 @@ class DOMDocument extends DOMNode implements DOMParentNode
|
|||
#[LanguageLevelTypeAware(['8.3' => 'bool'], default: 'DOMDocument|bool')]
|
||||
public function load(
|
||||
#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $filename,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $options = null
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $options = 0
|
||||
) {}
|
||||
|
||||
/**
|
||||
|
@ -1095,7 +1095,7 @@ class DOMDocument extends DOMNode implements DOMParentNode
|
|||
#[LanguageLevelTypeAware(['8.3' => 'bool'], default: 'DOMDocument|bool')]
|
||||
public function loadXML(
|
||||
#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $source,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $options = null
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $options = 0
|
||||
) {}
|
||||
|
||||
/**
|
||||
|
@ -1113,7 +1113,7 @@ class DOMDocument extends DOMNode implements DOMParentNode
|
|||
#[TentativeType]
|
||||
public function saveXML(
|
||||
?DOMNode $node = null,
|
||||
#[PhpStormStubsElementAvailable(from: '7.0')] #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $options = null
|
||||
#[PhpStormStubsElementAvailable(from: '7.0')] #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $options = 0
|
||||
): string|false {}
|
||||
|
||||
/**
|
||||
|
@ -1146,7 +1146,7 @@ class DOMDocument extends DOMNode implements DOMParentNode
|
|||
* @return int|false the number of XIncludes in the document.
|
||||
*/
|
||||
#[TentativeType]
|
||||
public function xinclude(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $options = null): int|false {}
|
||||
public function xinclude(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $options = 0): int|false {}
|
||||
|
||||
/**
|
||||
* Load HTML from a string
|
||||
|
@ -2015,7 +2015,7 @@ class DOMElement extends DOMNode implements DOMParentNode, DOMChildNode
|
|||
public function __construct(
|
||||
#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $qualifiedName,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $value = null,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $namespace = null
|
||||
#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $namespace = ''
|
||||
) {}
|
||||
|
||||
/**
|
||||
|
@ -2026,7 +2026,7 @@ class DOMElement extends DOMNode implements DOMParentNode, DOMChildNode
|
|||
/**
|
||||
* @since 8.3
|
||||
*/
|
||||
public function toggleAttribute(string $qualifiedName, ?bool $force = false): bool {}
|
||||
public function toggleAttribute(string $qualifiedName, ?bool $force = null): bool {}
|
||||
|
||||
/**
|
||||
* @since 8.3
|
||||
|
@ -2085,7 +2085,7 @@ class DOMText extends DOMCharacterData
|
|||
* @link https://php.net/manual/en/domtext.construct.php
|
||||
* @param string $data [optional] The value of the text node. If not supplied an empty text node is created.
|
||||
*/
|
||||
public function __construct(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $data) {}
|
||||
public function __construct(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $data = '') {}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2100,7 +2100,7 @@ class DOMComment extends DOMCharacterData
|
|||
* @link https://php.net/manual/en/domcomment.construct.php
|
||||
* @param string $data [optional] The value of the comment
|
||||
*/
|
||||
public function __construct(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $data) {}
|
||||
public function __construct(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $data = '') {}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2351,7 +2351,7 @@ class DOMProcessingInstruction extends DOMNode
|
|||
*/
|
||||
public function __construct(
|
||||
#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $value
|
||||
#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $value = ''
|
||||
) {}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ class finfo
|
|||
* @param string $magic_database [optional]
|
||||
*/
|
||||
public function __construct(
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = 0,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $magic_database
|
||||
) {}
|
||||
|
||||
|
|
|
@ -321,7 +321,7 @@ class Collator
|
|||
#[TentativeType]
|
||||
public function sort(
|
||||
array &$array,
|
||||
#[LanguageAware(['8.0' => 'int'], default: '')] #[EV([Collator::SORT_REGULAR])] $flags = null
|
||||
#[LanguageAware(['8.0' => 'int'], default: '')] #[EV([Collator::SORT_REGULAR])] $flags = 0
|
||||
): bool {}
|
||||
|
||||
/**
|
||||
|
@ -352,7 +352,7 @@ class Collator
|
|||
#[TentativeType]
|
||||
public function asort(
|
||||
array &$array,
|
||||
#[LanguageAware(['8.0' => 'int'], default: '')] #[EV([Collator::SORT_REGULAR])] $flags = null
|
||||
#[LanguageAware(['8.0' => 'int'], default: '')] #[EV([Collator::SORT_REGULAR])] $flags = 0
|
||||
): bool {}
|
||||
|
||||
/**
|
||||
|
@ -987,7 +987,7 @@ class NumberFormatter
|
|||
#[TentativeType]
|
||||
public function format(
|
||||
#[LanguageAware(['8.0' => 'int|float'], default: '')] $num,
|
||||
#[LanguageAware(['8.0' => 'int'], default: '')] $type = null
|
||||
#[LanguageAware(['8.0' => 'int'], default: '')] $type = 0
|
||||
): string|false {}
|
||||
|
||||
/**
|
||||
|
@ -1189,7 +1189,7 @@ class NumberFormatter
|
|||
#[Pure]
|
||||
#[TentativeType]
|
||||
public function getLocale(
|
||||
#[LanguageAware(['8.0' => 'int'], default: '')] #[EV([Locale::VALID_LOCALE, Locale::ACTUAL_LOCALE])] $type = null
|
||||
#[LanguageAware(['8.0' => 'int'], default: '')] #[EV([Locale::VALID_LOCALE, Locale::ACTUAL_LOCALE])] $type = 0
|
||||
): string|false {}
|
||||
|
||||
/**
|
||||
|
@ -1911,7 +1911,7 @@ class IntlDateFormatter
|
|||
#[ElementAvailable(from: '8.1')] int $timeType = 0,
|
||||
$timezone = null,
|
||||
$calendar = null,
|
||||
#[LanguageAware(['8.0' => 'string|null'], default: '')] $pattern = ''
|
||||
#[LanguageAware(['8.0' => 'string|null'], default: '')] $pattern = null
|
||||
) {}
|
||||
|
||||
/**
|
||||
|
@ -1958,7 +1958,7 @@ class IntlDateFormatter
|
|||
#[ElementAvailable(from: '8.1')] int $timeType = 0,
|
||||
$timezone = null,
|
||||
#[LanguageAware(['8.0' => 'IntlCalendar|int|null'], default: '')] $calendar = null,
|
||||
#[LanguageAware(['8.0' => 'string|null'], default: '')] $pattern = ''
|
||||
#[LanguageAware(['8.0' => 'string|null'], default: '')] $pattern = null
|
||||
): ?IntlDateFormatter {}
|
||||
|
||||
/**
|
||||
|
@ -2127,7 +2127,7 @@ class IntlDateFormatter
|
|||
public function getLocale(
|
||||
#[ElementAvailable(from: '8.0')]
|
||||
#[LanguageAware(['8.0' => 'int'], default: '')]
|
||||
$type = null
|
||||
$type = 0
|
||||
): string|false {}
|
||||
|
||||
/**
|
||||
|
@ -2400,7 +2400,7 @@ class Transliterator
|
|||
#[TentativeType]
|
||||
public static function create(
|
||||
#[LanguageAware(['8.0' => 'string'], default: '')] $id,
|
||||
#[LanguageAware(['8.0' => 'int'], default: '')] #[EV([Transliterator::FORWARD, Transliterator::REVERSE])] $direction = null
|
||||
#[LanguageAware(['8.0' => 'int'], default: '')] #[EV([Transliterator::FORWARD, Transliterator::REVERSE])] $direction = 0
|
||||
): ?Transliterator {}
|
||||
|
||||
/**
|
||||
|
@ -2422,7 +2422,7 @@ class Transliterator
|
|||
#[TentativeType]
|
||||
public static function createFromRules(
|
||||
#[LanguageAware(['8.0' => 'string'], default: '')] $rules,
|
||||
#[LanguageAware(['8.0' => 'int'], default: '')] #[EV([Transliterator::FORWARD, Transliterator::REVERSE])] $direction = null
|
||||
#[LanguageAware(['8.0' => 'int'], default: '')] #[EV([Transliterator::FORWARD, Transliterator::REVERSE])] $direction = 0
|
||||
): ?Transliterator {}
|
||||
|
||||
/**
|
||||
|
@ -2469,7 +2469,7 @@ class Transliterator
|
|||
#[TentativeType]
|
||||
public function transliterate(
|
||||
#[LanguageAware(['8.0' => 'string'], default: '')] $string,
|
||||
#[LanguageAware(['8.0' => 'int'], default: '')] $start = null,
|
||||
#[LanguageAware(['8.0' => 'int'], default: '')] $start = 0,
|
||||
#[LanguageAware(['8.0' => 'int'], default: '')] $end = -1
|
||||
): string|false {}
|
||||
|
||||
|
@ -3560,7 +3560,7 @@ class IntlTimeZone
|
|||
public static function createTimeZoneIDEnumeration(
|
||||
#[LanguageAware(['8.0' => 'int'], default: '')] $type,
|
||||
#[LanguageAware(['8.0' => 'string|null'], default: '')] $region = null,
|
||||
#[LanguageAware(['8.0' => 'int|null'], default: '')] $rawOffset = 0
|
||||
#[LanguageAware(['8.0' => 'int|null'], default: '')] $rawOffset = null
|
||||
): IntlIterator|false {}
|
||||
|
||||
/**
|
||||
|
@ -7742,7 +7742,7 @@ class UConverter
|
|||
#[LanguageAware(['8.0' => 'string'], default: '')] $str,
|
||||
#[LanguageAware(['8.0' => 'string'], default: '')] $toEncoding,
|
||||
#[LanguageAware(['8.0' => 'string'], default: '')] $fromEncoding,
|
||||
?array $options = []
|
||||
?array $options = null
|
||||
): string|false {}
|
||||
}
|
||||
// End of intl v.1.1.0
|
||||
|
|
|
@ -683,7 +683,7 @@ class mysqli
|
|||
?string $database = null,
|
||||
?int $port = null,
|
||||
?string $socket = null,
|
||||
int $flags = null
|
||||
int $flags = 0
|
||||
): bool {}
|
||||
|
||||
/**
|
||||
|
@ -1291,7 +1291,7 @@ class mysqli_result implements IteratorAggregate
|
|||
* are no more rows in the result set, or false on failure.
|
||||
*/
|
||||
#[TentativeType]
|
||||
public function fetch_object(string $class = 'stdClass', array $constructor_args = null): object|false|null {}
|
||||
public function fetch_object(string $class = 'stdClass', array $constructor_args = []): object|false|null {}
|
||||
|
||||
/**
|
||||
* Fetch the next row of a result set as an enumerated array
|
||||
|
|
|
@ -267,7 +267,7 @@ class SoapClient
|
|||
*/
|
||||
public function __construct(
|
||||
#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $wsdl,
|
||||
array $options = null
|
||||
array $options = []
|
||||
) {}
|
||||
|
||||
/**
|
||||
|
@ -462,7 +462,7 @@ class SoapClient
|
|||
* @since 5.0.1
|
||||
*/
|
||||
#[TentativeType]
|
||||
public function __setLocation(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $location = ''): ?string {}
|
||||
public function __setLocation(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $location = null): ?string {}
|
||||
|
||||
/**
|
||||
* Sets SOAP headers for subsequent calls
|
||||
|
@ -551,9 +551,9 @@ class SoapVar
|
|||
#[LanguageLevelTypeAware(["8.0" => 'mixed'], default: '')] $data,
|
||||
#[LanguageLevelTypeAware(["7.1" => "int|null"], default: "int")] $encoding,
|
||||
#[LanguageLevelTypeAware(["8.0" => "string|null"], default: "string")] $typeName,
|
||||
#[LanguageLevelTypeAware(["8.0" => 'string|null'], default: '')] $typeNamespace = '',
|
||||
#[LanguageLevelTypeAware(["8.0" => 'string|null'], default: '')] $nodeName = '',
|
||||
#[LanguageLevelTypeAware(["8.0" => 'string|null'], default: '')] $nodeNamespace = ''
|
||||
#[LanguageLevelTypeAware(["8.0" => 'string|null'], default: '')] $typeNamespace = null,
|
||||
#[LanguageLevelTypeAware(["8.0" => 'string|null'], default: '')] $nodeName = null,
|
||||
#[LanguageLevelTypeAware(["8.0" => 'string|null'], default: '')] $nodeNamespace = null
|
||||
) {}
|
||||
|
||||
/**
|
||||
|
@ -631,7 +631,7 @@ class SoapServer
|
|||
*/
|
||||
public function __construct(
|
||||
#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $wsdl,
|
||||
array $options = null
|
||||
array $options = []
|
||||
) {}
|
||||
|
||||
/**
|
||||
|
@ -799,9 +799,9 @@ class SoapServer
|
|||
public function fault(
|
||||
#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $code,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $string,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $actor = null,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $actor = '',
|
||||
#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $details = null,
|
||||
#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name = null
|
||||
#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name = ''
|
||||
): void {}
|
||||
|
||||
/**
|
||||
|
|
|
@ -81,7 +81,7 @@ class SQLite3
|
|||
#[PhpStormStubsElementAvailable(from: '5.3', to: '5.6')] $flags,
|
||||
#[PhpStormStubsElementAvailable(from: '5.3', to: '5.6')] $encryptionKey,
|
||||
#[PhpStormStubsElementAvailable(from: '7.0')] #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = SQLITE3_OPEN_READWRITE|SQLITE3_OPEN_CREATE,
|
||||
#[PhpStormStubsElementAvailable(from: '7.0')] #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $encryptionKey = null
|
||||
#[PhpStormStubsElementAvailable(from: '7.0')] #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $encryptionKey = ''
|
||||
): void {}
|
||||
|
||||
/**
|
||||
|
@ -370,7 +370,7 @@ class SQLite3
|
|||
#[PhpStormStubsElementAvailable(from: '5.3', to: '5.6')] $flags,
|
||||
#[PhpStormStubsElementAvailable(from: '5.3', to: '5.6')] $encryptionKey,
|
||||
#[PhpStormStubsElementAvailable(from: '7.0')] #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = SQLITE3_OPEN_READWRITE|SQLITE3_OPEN_CREATE,
|
||||
#[PhpStormStubsElementAvailable(from: '7.0')] #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $encryptionKey = null
|
||||
#[PhpStormStubsElementAvailable(from: '7.0')] #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $encryptionKey = ''
|
||||
) {}
|
||||
|
||||
/**
|
||||
|
|
|
@ -68,6 +68,17 @@ abstract class AbstractBaseStubsTestCase extends TestCase
|
|||
/** @var PHPConst $rightConstant */
|
||||
$rightConstant = array_pop($constants);
|
||||
$value = $leftConstant->value|$rightConstant->value;
|
||||
} elseif ($defaultValue->left instanceof ClassConstFetch && $defaultValue->right instanceof ClassConstFetch){
|
||||
$leftClass = $defaultValue->left->class->toString();
|
||||
$rightClass = $defaultValue->right->class->toString();
|
||||
$leftClass = PhpStormStubsSingleton::getPhpStormStubs()->getClass($leftClass);
|
||||
$rightClass = PhpStormStubsSingleton::getPhpStormStubs()->getClass($rightClass);
|
||||
if ($leftClass === null || $rightClass === null) {
|
||||
throw new Exception("Class $leftClass->name or $rightClass->name not found in stubs");
|
||||
}
|
||||
$leftConstant = $leftClass->getConstant((string)$defaultValue->left->name);;
|
||||
$rightConstant = $rightClass->getConstant((string)$defaultValue->right->name);;
|
||||
$value = $leftConstant->value|$rightConstant->value;
|
||||
}
|
||||
} elseif ($defaultValue instanceof UnaryMinus && property_exists($defaultValue->expr, 'value')) {
|
||||
$value = '-' . $defaultValue->expr->value;
|
||||
|
|
|
@ -59,6 +59,7 @@ abstract class BasePHPClass extends BasePHPElement
|
|||
*/
|
||||
public function getConstant($constantName)
|
||||
{
|
||||
$arra = $this->constants;
|
||||
$constants = array_filter($this->constants, function (PHPConst $constant) use ($constantName) {
|
||||
return $constant->name === $constantName && $constant->duplicateOtherElement === false
|
||||
&& BasePHPElement::entitySuitsCurrentPhpVersion($constant);
|
||||
|
|
|
@ -129,7 +129,7 @@ class ReflectionParametersProvider
|
|||
foreach (EntitiesFilter::getFilteredFunctions($class) as $method) {
|
||||
foreach (EntitiesFilter::getFilteredParameters(
|
||||
$method,
|
||||
fn (PHPParameter $parameter) => !$parameter->isOptional || empty($parameter->defaultValue),
|
||||
fn (PHPParameter $parameter) => !$parameter->isOptional,
|
||||
StubProblemType::WRONG_PARAMETER_DEFAULT_VALUE
|
||||
) as $parameter) {
|
||||
yield "$class->name::$method->name($parameter->name)" => [$class, $method, $parameter];
|
||||
|
|
Loading…
Reference in New Issue