Skip to content

Commit

Permalink
[phpstorm-stubs] fix cs-fixer errors
Browse files Browse the repository at this point in the history
  • Loading branch information
isfedorov committed Dec 15, 2023
1 parent 06af30f commit 92dda01
Show file tree
Hide file tree
Showing 10 changed files with 68 additions and 116 deletions.
3 changes: 1 addition & 2 deletions date/date.php
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,7 @@ function mktime(
?int $month = null,
?int $day = null,
?int $year = null,
#[Deprecated('Use the new timezone handling functions instead', since: '5.3')]
#[PhpStormStubsElementAvailable(from: '5.5', to: '5.6')] $is_dst = -1
#[Deprecated('Use the new timezone handling functions instead', since: '5.3')] #[PhpStormStubsElementAvailable(from: '5.5', to: '5.6')] int $is_dst = -1
): int|false {}

/**
Expand Down
72 changes: 18 additions & 54 deletions ftp/ftp.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,8 @@ function ftp_append(
#[LanguageLevelTypeAware(['8.1' => 'FTP\Connection'], default: 'resource')] $ftp,
string $remote_filename,
string $local_filename,
#[EV([FTP_ASCII, FTP_BINARY])]
#[PhpStormStubsElementAvailable(from: '5.3', to: '7.2')]
int $mode,
#[EV([FTP_ASCII, FTP_BINARY])]
#[PhpStormStubsElementAvailable(from: '7.3')]
int $mode = FTP_BINARY
#[EV([FTP_ASCII, FTP_BINARY])] #[PhpStormStubsElementAvailable(from: '5.3', to: '7.2')] int $mode,
#[EV([FTP_ASCII, FTP_BINARY])] #[PhpStormStubsElementAvailable(from: '7.3')] int $mode = FTP_BINARY
): bool {}

/**
Expand Down Expand Up @@ -306,12 +302,8 @@ function ftp_get(
#[LanguageLevelTypeAware(['8.1' => 'FTP\Connection'], default: 'resource')] $ftp,
string $local_filename,
string $remote_filename,
#[EV([FTP_ASCII, FTP_BINARY])]
#[PhpStormStubsElementAvailable(from: '5.3', to: '7.2')]
int $mode,
#[EV([FTP_ASCII, FTP_BINARY])]
#[PhpStormStubsElementAvailable(from: '7.3')]
int $mode = FTP_BINARY,
#[EV([FTP_ASCII, FTP_BINARY])] #[PhpStormStubsElementAvailable(from: '5.3', to: '7.2')] int $mode,
#[EV([FTP_ASCII, FTP_BINARY])] #[PhpStormStubsElementAvailable(from: '7.3')] int $mode = FTP_BINARY,
int $offset = 0
): bool {}

Expand Down Expand Up @@ -339,12 +331,8 @@ function ftp_fget(
#[LanguageLevelTypeAware(['8.1' => 'FTP\Connection'], default: 'resource')] $ftp,
$stream,
string $remote_filename,
#[EV([FTP_ASCII, FTP_BINARY])]
#[PhpStormStubsElementAvailable(from: '5.3', to: '7.2')]
int $mode,
#[EV([FTP_ASCII, FTP_BINARY])]
#[PhpStormStubsElementAvailable(from: '7.3')]
int $mode = FTP_BINARY,
#[EV([FTP_ASCII, FTP_BINARY])] #[PhpStormStubsElementAvailable(from: '5.3', to: '7.2')] int $mode,
#[EV([FTP_ASCII, FTP_BINARY])] #[PhpStormStubsElementAvailable(from: '7.3')] int $mode = FTP_BINARY,
int $offset = 0
): bool {}

Expand All @@ -370,12 +358,8 @@ function ftp_put(
#[LanguageLevelTypeAware(['8.1' => 'FTP\Connection'], default: 'resource')] $ftp,
string $remote_filename,
string $local_filename,
#[EV([FTP_ASCII, FTP_BINARY])]
#[PhpStormStubsElementAvailable(from: '5.3', to: '7.2')]
int $mode,
#[EV([FTP_ASCII, FTP_BINARY])]
#[PhpStormStubsElementAvailable(from: '7.3')]
int $mode = FTP_BINARY,
#[EV([FTP_ASCII, FTP_BINARY])] #[PhpStormStubsElementAvailable(from: '5.3', to: '7.2')] int $mode,
#[EV([FTP_ASCII, FTP_BINARY])] #[PhpStormStubsElementAvailable(from: '7.3')] int $mode = FTP_BINARY,
int $offset = 0
): bool {}

Expand All @@ -401,12 +385,8 @@ function ftp_fput(
#[LanguageLevelTypeAware(['8.1' => 'FTP\Connection'], default: 'resource')] $ftp,
string $remote_filename,
$stream,
#[EV([FTP_ASCII, FTP_BINARY])]
#[PhpStormStubsElementAvailable(from: '5.3', to: '7.2')]
int $mode,
#[EV([FTP_ASCII, FTP_BINARY])]
#[PhpStormStubsElementAvailable(from: '7.3')]
int $mode = FTP_BINARY,
#[EV([FTP_ASCII, FTP_BINARY])] #[PhpStormStubsElementAvailable(from: '5.3', to: '7.2')] int $mode,
#[EV([FTP_ASCII, FTP_BINARY])] #[PhpStormStubsElementAvailable(from: '7.3')] int $mode = FTP_BINARY,
int $offset = 0
): bool {}

Expand Down Expand Up @@ -584,12 +564,8 @@ function ftp_nb_fget(
#[LanguageLevelTypeAware(['8.1' => 'FTP\Connection'], default: 'resource')] $ftp,
$stream,
string $remote_filename,
#[EV([FTP_ASCII, FTP_BINARY])]
#[PhpStormStubsElementAvailable(from: '5.3', to: '7.2')]
int $mode,
#[EV([FTP_ASCII, FTP_BINARY])]
#[PhpStormStubsElementAvailable(from: '7.3')]
int $mode = FTP_BINARY,
#[EV([FTP_ASCII, FTP_BINARY])] #[PhpStormStubsElementAvailable(from: '5.3', to: '7.2')] int $mode,
#[EV([FTP_ASCII, FTP_BINARY])] #[PhpStormStubsElementAvailable(from: '7.3')] int $mode = FTP_BINARY,
int $offset = 0
): int {}

Expand Down Expand Up @@ -618,12 +594,8 @@ function ftp_nb_get(
#[LanguageLevelTypeAware(['8.1' => 'FTP\Connection'], default: 'resource')] $ftp,
string $local_filename,
string $remote_filename,
#[EV([FTP_ASCII, FTP_BINARY])]
#[PhpStormStubsElementAvailable(from: '5.3', to: '7.2')]
int $mode,
#[EV([FTP_ASCII, FTP_BINARY])]
#[PhpStormStubsElementAvailable(from: '7.3')]
int $mode = FTP_BINARY,
#[EV([FTP_ASCII, FTP_BINARY])] #[PhpStormStubsElementAvailable(from: '5.3', to: '7.2')] int $mode,
#[EV([FTP_ASCII, FTP_BINARY])] #[PhpStormStubsElementAvailable(from: '7.3')] int $mode = FTP_BINARY,
int $offset = 0
) {}

Expand Down Expand Up @@ -663,12 +635,8 @@ function ftp_nb_put(
#[LanguageLevelTypeAware(['8.1' => 'FTP\Connection'], default: 'resource')] $ftp,
string $remote_filename,
string $local_filename,
#[EV([FTP_ASCII, FTP_BINARY])]
#[PhpStormStubsElementAvailable(from: '5.3', to: '7.2')]
int $mode,
#[EV([FTP_ASCII, FTP_BINARY])]
#[PhpStormStubsElementAvailable(from: '7.3')]
int $mode = FTP_BINARY,
#[EV([FTP_ASCII, FTP_BINARY])] #[PhpStormStubsElementAvailable(from: '5.3', to: '7.2')] int $mode,
#[EV([FTP_ASCII, FTP_BINARY])] #[PhpStormStubsElementAvailable(from: '7.3')] int $mode = FTP_BINARY,
int $offset = 0
): int|false {}

Expand Down Expand Up @@ -696,12 +664,8 @@ function ftp_nb_fput(
#[LanguageLevelTypeAware(['8.1' => 'FTP\Connection'], default: 'resource')] $ftp,
string $remote_filename,
$stream,
#[EV([FTP_ASCII, FTP_BINARY])]
#[PhpStormStubsElementAvailable(from: '5.3', to: '7.2')]
int $mode,
#[EV([FTP_ASCII, FTP_BINARY])]
#[PhpStormStubsElementAvailable(from: '7.3')]
int $mode = FTP_BINARY,
#[EV([FTP_ASCII, FTP_BINARY])] #[PhpStormStubsElementAvailable(from: '5.3', to: '7.2')] int $mode,
#[EV([FTP_ASCII, FTP_BINARY])] #[PhpStormStubsElementAvailable(from: '7.3')] int $mode = FTP_BINARY,
int $offset = 0
): int {}

Expand Down
20 changes: 10 additions & 10 deletions http/http3.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public function count() {}
* @throws \http\Exception\RuntimeException
* @return \http\Client self.
*/
public function dequeue(http\Client\Request $request) {}
public function dequeue(Client\Request $request) {}

/**
* Implements SplSubject. Detach $observer, which has been previously attached.
Expand Down Expand Up @@ -214,7 +214,7 @@ public function enablePipelining(bool $enable = true) {}
* @throws \http\Exception\RuntimeException
* @return \http\Client self.
*/
public function enqueue(http\Client\Request $request, callable $cb = null) {}
public function enqueue(Client\Request $request, callable $cb = null) {}

/**
* Get a list of available configuration options and their default values.
Expand Down Expand Up @@ -288,7 +288,7 @@ public function getOptions() {}
* @return object|null object stdClass instance holding progress information.
* or NULL if $request is not enqueued.
*/
public function getProgressInfo(http\Client\Request $request) {}
public function getProgressInfo(Client\Request $request) {}

/**
* Retrieve the corresponding response of an already finished request, or the last received response if $request is not set.
Expand All @@ -302,7 +302,7 @@ public function getProgressInfo(http\Client\Request $request) {}
* @return \http\Client\Response|null \http\Client\Response the stored response for the request, or the last that was received.
* or NULL if no more response was available to pop, when no $request was given.
*/
public function getResponse(http\Client\Request $request = null) {}
public function getResponse(Client\Request $request = null) {}

/**
* Retrieve priorly set SSL options.
Expand All @@ -320,7 +320,7 @@ public function getSslOptions() {}
* @throws \http\Exception\UnexpectedValueException
* @return object stdClass instance holding transfer related information.
*/
public function getTransferInfo(http\Client\Request $request) {}
public function getTransferInfo(Client\Request $request) {}

/**
* Implements SplSubject. Notify attached observers about progress with $request.
Expand All @@ -331,7 +331,7 @@ public function getTransferInfo(http\Client\Request $request) {}
* @throws \http\Exception\UnexpectedValueException
* @return \http\Client self.
*/
public function notify(http\Client\Request $request = null, $progress = null) {}
public function notify(Client\Request $request = null, $progress = null) {}

/**
* Perform outstanding transfer actions.
Expand All @@ -353,7 +353,7 @@ public function once() {}
* @throws \http\Exception\RuntimeException
* @return \http\Client self.
*/
public function requeue(http\Client\Request $request, callable $cb = null) {}
public function requeue(Client\Request $request, callable $cb = null) {}

/**
* Reset the client to the initial state.
Expand Down Expand Up @@ -1106,7 +1106,7 @@ public function __toString() {}
* @param \http\Message\Body $body The message body to add.
* @return \http\Message self.
*/
public function addBody(http\Message\Body $body) {}
public function addBody(Message\Body $body) {}

/**
* Add an header, appending to already existing headers.
Expand Down Expand Up @@ -1294,7 +1294,7 @@ public function next() {}
* @throws \http\Exception\UnexpectedValueException
* @return \http\Message self.
*/
public function prepend(http\Message $message, bool $top = true) {}
public function prepend(Message $message, bool $top = true) {}

/**
* Reverse the message chain and return the former top-most message.
Expand Down Expand Up @@ -1330,7 +1330,7 @@ public function serialize() {}
* @throws \http\Exception\UnexpectedValueException
* @return \http\Message self.
*/
public function setBody(http\Message\Body $body) {}
public function setBody(Message\Body $body) {}

/**
* Set a single header.
Expand Down
12 changes: 3 additions & 9 deletions intl/intl.php
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,7 @@ public function getErrorCode(): int|false {}
#[Pure]
#[TentativeType]
public function getLocale(
#[LanguageAware(['8.0' => 'int'], default: '')]
#[EV([Locale::VALID_LOCALE, Locale::ACTUAL_LOCALE])]
$type
#[LanguageAware(['8.0' => 'int'], default: '')] #[EV([Locale::VALID_LOCALE, Locale::ACTUAL_LOCALE])] $type
): string|false {}

/**
Expand Down Expand Up @@ -2126,9 +2124,7 @@ public function getPattern(): string|false {}
#[Pure]
#[TentativeType]
public function getLocale(
#[ElementAvailable(from: '8.0')]
#[LanguageAware(['8.0' => 'int'], default: '')]
$type = 0
#[ElementAvailable(from: '8.0')] #[LanguageAware(['8.0' => 'int'], default: '')] $type = 0
): string|false {}

/**
Expand Down Expand Up @@ -7249,9 +7245,7 @@ public function getLocale(#[LanguageAware(['8.0' => 'int'], default: '')] $type)
#[Pure]
#[TentativeType]
public function getPartsIterator(
#[LanguageAware(['8.3' => 'string', '8.0' => 'int'], default: '')]
#[EV([IntlPartsIterator::KEY_SEQUENTIAL, IntlPartsIterator::KEY_LEFT, IntlPartsIterator::KEY_RIGHT])]
$type = IntlPartsIterator::KEY_SEQUENTIAL
#[LanguageAware(['8.3' => 'string', '8.0' => 'int'], default: '')] #[EV([IntlPartsIterator::KEY_SEQUENTIAL, IntlPartsIterator::KEY_LEFT, IntlPartsIterator::KEY_RIGHT])] $type = IntlPartsIterator::KEY_SEQUENTIAL
): IntlPartsIterator {}

/**
Expand Down
2 changes: 1 addition & 1 deletion ldap/ldap.php
Original file line number Diff line number Diff line change
Expand Up @@ -1425,7 +1425,7 @@ function ldap_count_references(
/**
* @since 8.3
*/
function ldap_exop_sync(LDAP\Connection $ldap, string $request_oid, ?string $request_data = null, ?array $controls = null, &$response_data = null, &$response_oid = null): LDAP\Result|bool {}
function ldap_exop_sync(LDAP\Connection $ldap, string $request_oid, ?string $request_data = null, ?array $controls = null, &$response_data = null, &$response_oid = null): Result|bool {}

define('LDAP_ESCAPE_FILTER', 1);
define('LDAP_ESCAPE_DN', 2);
Expand Down
18 changes: 9 additions & 9 deletions pq/pq.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class COPY
* @throws \pq\Exception\BadMethodCallException
* @throws \pq\Exception\RuntimeException
*/
public function __construct(pq\Connection $conn, string $expression, int $direction, string $options = null) {}
public function __construct(Connection $conn, string $expression, int $direction, string $options = null) {}

/**
* End the COPY operation to the server during pq\Result::COPY_IN state.
Expand Down Expand Up @@ -131,7 +131,7 @@ class Cancel
* @throws \pq\Exception\BadMethodCallException
* @throws \pq\Exception\RuntimeException
*/
public function __construct(pq\Connection $conn) {}
public function __construct(Connection $conn) {}

/**
* Perform the cancellation request.
Expand Down Expand Up @@ -741,7 +741,7 @@ public function resetAsync() {}
* @throws \pq\Exception\InvalidArgumentException
* @throws \pq\Exception\BadMethodCallException
*/
public function setConverter(pq\Converter $converter) {}
public function setConverter(Converter $converter) {}

/**
* Begin a transaction.
Expand Down Expand Up @@ -837,7 +837,7 @@ public function unlistenAsync(string $channel) {}
* @throws \pq\Exception\InvalidArgumentException
* @throws \pq\Exception\BadMethodCallException
*/
public function unsetConverter(pq\Converter $converter) {}
public function unsetConverter(Converter $converter) {}
}
/**
* Interface for type conversions.
Expand Down Expand Up @@ -933,7 +933,7 @@ class Cursor
* @throws \pq\Exception\BadMethodCallException
* @throws \pq\Exception\RuntimeException
*/
public function __construct(pq\Connection $connection, string $name, int $flags, string $query, bool $async) {}
public function __construct(Connection $connection, string $name, int $flags, string $query, bool $async) {}

/**
* Close an open cursor.
Expand Down Expand Up @@ -1170,7 +1170,7 @@ class LOB
* @throws \pq\Exception\BadMethodCallException
* @throws \pq\Exception\RuntimeException
*/
public function __construct(pq\Transaction $txn, int $oid = \pq\LOB::INVALID_OID, int $mode = \pq\LOB::RW) {}
public function __construct(Transaction $txn, int $oid = \pq\LOB::INVALID_OID, int $mode = \pq\LOB::RW) {}

/**
* Read a string of data from the current position of the *large object*.
Expand Down Expand Up @@ -1577,7 +1577,7 @@ class Statement
* @throws \pq\Exception\RuntimeException
* @throws \pq\Exception\DomainException
*/
public function __construct(pq\Connection $conn, string $name, string $query, array $types = null, bool $async = false) {}
public function __construct(Connection $conn, string $name, string $query, array $types = null, bool $async = false) {}

/**
* Bind a variable to an input parameter.
Expand Down Expand Up @@ -1744,7 +1744,7 @@ class Transaction
* @throws \pq\Exception\BadMethodCallException
* @throws \pq\Exception\RuntimeException
*/
public function __construct(pq\Connection $conn, bool $async = false, int $isolation = \pq\Transaction::READ_COMMITTED, bool $readonly = false, bool $deferrable = false) {}
public function __construct(Connection $conn, bool $async = false, int $isolation = \pq\Transaction::READ_COMMITTED, bool $readonly = false, bool $deferrable = false) {}

/**
* Commit the transaction or release the previous savepoint.
Expand Down Expand Up @@ -2706,7 +2706,7 @@ class Types implements \ArrayAccess
* @throws \pq\Exception\BadMethodCallException
* @throws \pq\Exception\RuntimeException
*/
public function __construct(pq\Connection $conn, array $namespaces = null) {}
public function __construct(Connection $conn, array $namespaces = null) {}

/**
* Refresh type information from `pg_type`.
Expand Down
12 changes: 4 additions & 8 deletions relay/Relay.php
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,7 @@ public function __construct(
int $port = 6379,
float $connect_timeout = 0.0,
float $command_timeout = 0.0,
#[\SensitiveParameter]
array $context = [],
#[\SensitiveParameter] array $context = [],
int $database = 0,
) {}

Expand All @@ -446,8 +445,7 @@ public function connect(
?string $persistent_id = null,
int $retry_interval = 0,
float $read_timeout = 0.0,
#[\SensitiveParameter]
array $context = [],
#[\SensitiveParameter] array $context = [],
int $database = 0
): bool {}

Expand All @@ -472,8 +470,7 @@ public function pconnect(
?string $persistent_id = null,
int $retry_interval = 0,
float $read_timeout = 0.0,
#[\SensitiveParameter]
array $context = [],
#[\SensitiveParameter] array $context = [],
int $database = 0
): bool {}

Expand Down Expand Up @@ -1019,8 +1016,7 @@ public function migrate(
int $timeout,
bool $copy = false,
bool $replace = false,
#[\SensitiveParameter]
mixed $credentials = null
#[\SensitiveParameter] mixed $credentials = null
): Relay|bool {}

/**
Expand Down
Loading

0 comments on commit 92dda01

Please sign in to comment.