Skip to content

Commit

Permalink
Merge tag 'v2023.3' of github.com:jetbrains/phpstorm-stubs into fork
Browse files Browse the repository at this point in the history
PhpStorm 2023.3
  • Loading branch information
dktapps committed Apr 2, 2024
2 parents e557ff2 + 99d8bca commit d14147c
Show file tree
Hide file tree
Showing 93 changed files with 6,046 additions and 999 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
name: Run tests against php ${{matrix.php}}
steps:
- name: Checkout
Expand All @@ -20,7 +20,7 @@ jobs:
PHP_VERSION: ${{matrix.php}}

- name: Composer Install
run: docker-compose -f docker-compose.yml run -e PHP_VERSION=${{matrix.php}} test_runner composer update
run: docker-compose -f docker-compose.yml run -e PHP_VERSION=${{matrix.php}} test_runner composer install
env:
PHP_VERSION: ${{matrix.php}}

Expand Down Expand Up @@ -50,4 +50,4 @@ jobs:
run: docker-compose -f docker-compose.yml run test_runner vendor/bin/phpunit --testsuite Structure

- name: run cs fixer
run: docker-compose -f docker-compose.yml run test_runner composer cs
run: docker-compose -f docker-compose.yml run -e PHP_CS_FIXER_IGNORE_ENV=true test_runner composer cs
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ phpunit.xml

# Composer
vendor
composer.lock

.php_cs.cache
.phpunit.result.cache
Expand Down
10 changes: 10 additions & 0 deletions Core/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,16 @@ function str_ends_with(string $haystack, string $needle): bool {}
#[Pure]
function str_contains(string $haystack, string $needle): bool {}

/**
* @since 8.3
*/
function str_decrement(string $string): string {}

/**
* @since 8.3
*/
function str_increment(string $string): string {}

/**
* Return the current key and value pair from an array and advance the array cursor
* @link https://php.net/manual/en/function.each.php
Expand Down
15 changes: 12 additions & 3 deletions Core/Core_c.php
Original file line number Diff line number Diff line change
Expand Up @@ -606,8 +606,8 @@ public function __construct(
#[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
) {}

Expand Down Expand Up @@ -795,7 +795,7 @@ public function offsetUnset($object): void {}
/**
* Returns an iterator in the "[object => mixed]" format.
*
* @return Traversable<TKey, TValue>
* @return Iterator<TKey, TValue>
*/
public function getIterator(): Iterator {}

Expand Down Expand Up @@ -1124,3 +1124,12 @@ public function getValue(): mixed {}

public function __debugInfo(): array {}
}

/**
* @since 8.3
*/
#[Attribute(Attribute::TARGET_METHOD)]
final class Override
{
public function __construct() {}
}
9 changes: 5 additions & 4 deletions PDO/PDO.php
Original file line number Diff line number Diff line change
Expand Up @@ -1146,6 +1146,7 @@ public function query(
* If the PDO driver does not support this capability,
* <b>PDO::lastInsertId</b> triggers an
* IM001 SQLSTATE.
* @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true.
*/
#[TentativeType]
public function lastInsertId(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $name = null): string|false {}
Expand Down Expand Up @@ -1556,7 +1557,7 @@ public function execute(#[LanguageLevelTypeAware(['8.0' => 'array|null'], defaul
*/
#[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 {}
Expand Down Expand Up @@ -1596,7 +1597,7 @@ public function bindParam(
#[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 {}

Expand Down Expand Up @@ -1628,7 +1629,7 @@ public function bindColumn(
#[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 {}

Expand Down Expand Up @@ -1733,7 +1734,7 @@ public function fetchColumn(#[LanguageLevelTypeAware(['8.0' => 'int'], default:
*/
#[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 {}
Expand Down
24 changes: 12 additions & 12 deletions Phar/Phar.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Phar extends RecursiveDirectoryIterator implements RecursiveIterator, Seek
*/
public function __construct(
#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $filename,
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = FilesystemIterator::KEY_AS_PATHNAME|FilesystemIterator::CURRENT_AS_FILEINFO,
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = FilesystemIterator::SKIP_DOTS|FilesystemIterator::UNIX_PATHS,
#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $alias = null,
#[PhpStormStubsElementAvailable(from: '5.3', to: '5.6')] $fileformat = null
) {}
Expand Down Expand Up @@ -137,7 +137,7 @@ public function addFromString(
#[TentativeType]
public function buildFromDirectory(
#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $directory,
#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $pattern = null
#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $pattern = ''
): array {}

/**
Expand Down Expand Up @@ -257,8 +257,8 @@ public function decompress(#[LanguageLevelTypeAware(['8.0' => 'string|null'], de
*/
#[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 {}

Expand Down Expand Up @@ -293,8 +293,8 @@ public function convertToExecutable(
*/
#[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 {}

Expand Down Expand Up @@ -622,7 +622,7 @@ public function setSignatureAlgorithm(
*/
public function setStub(
$stub,
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $length = -1
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $length
) {}

/**
Expand Down Expand Up @@ -896,9 +896,9 @@ final public static function unlinkArchive(string $filename): bool {}
*/
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 {}

Expand Down Expand Up @@ -1003,9 +1003,9 @@ class PharData extends Phar
*/
public function __construct(
#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $filename,
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = FilesystemIterator::KEY_AS_PATHNAME|FilesystemIterator::CURRENT_AS_FILEINFO,
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = FilesystemIterator::SKIP_DOTS|FilesystemIterator::UNIX_PATHS,
#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $alias = null,
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $format = Phar::TAR
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $format = 0
) {}

/**
Expand Down Expand Up @@ -1240,7 +1240,7 @@ public function hasMetadata(): bool {}
* @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 &gt;= 5.3.0, PECL phar &gt;= 1.0.0)<br/>
Expand Down
Loading

0 comments on commit d14147c

Please sign in to comment.