Skip to content

Commit

Permalink
[phpstorm-stubs] replace deprecated cs-fixer rule with a modern one
Browse files Browse the repository at this point in the history
  • Loading branch information
isfedorov committed Feb 23, 2022
1 parent f836f94 commit 0fe2c0c
Show file tree
Hide file tree
Showing 92 changed files with 1,467 additions and 264 deletions.
5 changes: 4 additions & 1 deletion .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,12 @@
'no_empty_phpdoc' => true,
'no_extra_blank_lines' => ['tokens' => [
'case', 'continue', 'curly_brace_block', 'default', 'extra', 'parenthesis_brace_block',
'square_brace_block', 'switch', 'throw', 'use', 'use_trait'
'square_brace_block', 'switch', 'throw', 'use'
]
],
'class_attributes_separation' => [
'elements' => ['const' => 'only_if_meta', 'method' => 'one', 'property' => 'only_if_meta', 'trait_import' => 'none']
],
'no_leading_namespace_whitespace' => true,
'no_multiline_whitespace_around_double_arrow' => true,
'no_short_bool_cast' => true,
Expand Down
7 changes: 7 additions & 0 deletions Core/Core_c.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,14 @@ class Exception implements Throwable
{
/** The error message */
protected $message;

/** The error code */
protected $code;

/** The filename where the error happened */
#[LanguageLevelTypeAware(['8.1' => 'string'], default: '')]
protected $file;

/** The line where the error happened */
#[LanguageLevelTypeAware(['8.1' => 'int'], default: '')]
protected $line;
Expand Down Expand Up @@ -403,11 +406,14 @@ class Error implements Throwable
{
/** The error message */
protected $message;

/** The error code */
protected $code;

/** The filename where the error happened */
#[LanguageLevelTypeAware(['8.1' => 'string'], default: '')]
protected $file;

/** The line where the error happened */
#[LanguageLevelTypeAware(['8.1' => 'int'], default: '')]
protected $line;
Expand Down Expand Up @@ -822,6 +828,7 @@ public function __toString(): string;
final class Attribute
{
public int $flags;

/**
* Marks that attribute declaration is allowed only in classes.
*/
Expand Down
3 changes: 0 additions & 3 deletions LuaSandbox/LuaSandbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,11 +391,8 @@ public function dump() {}
class LuaSandboxError extends Exception
{
public const RUN = 2;

public const SYNTAX = 3;

public const MEM = 4;

public const ERR = 5;
}

Expand Down
5 changes: 2 additions & 3 deletions PDO/PDO.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class PDOException extends RuntimeException
{
#[LanguageLevelTypeAware(['8.1' => 'array|null'], default: '')]
public $errorInfo;

protected $code;
}

Expand Down Expand Up @@ -685,7 +684,6 @@ class PDO
* @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-ignore-space
*/
public const MYSQL_ATTR_IGNORE_SPACE = 1006;

public const MYSQL_ATTR_SERVER_PUBLIC_KEY = 1012;

/**
Expand Down Expand Up @@ -765,6 +763,7 @@ class PDO

#[Deprecated("Use PDO::ATTR_EMULATE_PREPARES instead")]
public const PGSQL_ASSOC = 1;

/**
* @removed 7.1
*/
Expand All @@ -781,7 +780,6 @@ class PDO
public const PGSQL_TRANSACTION_INTRANS = 2;
public const PGSQL_TRANSACTION_INERROR = 3;
public const PGSQL_TRANSACTION_UNKNOWN = 4;

public const PGSQL_CONNECT_ASYNC = 4;
public const PGSQL_CONNECT_FORCE_NEW = 2;
public const PGSQL_CONNECTION_AUTH_OK = 5;
Expand Down Expand Up @@ -865,6 +863,7 @@ class PDO
* @since 7.4
*/
public const SQLITE_ATTR_READONLY_STATEMENT = 1001;

/**
* @since 7.4
*/
Expand Down
2 changes: 0 additions & 2 deletions SPL/SPL.php
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,6 @@ class RegexIterator extends FilterIterator
* Special flag: Match the entry key instead of the entry value.
*/
public const USE_KEY = 1;

public const INVERT_MATCH = 2;

#[LanguageLevelTypeAware(['8.1' => 'string|null'], default: '')]
Expand Down Expand Up @@ -1366,7 +1365,6 @@ class RecursiveTreeIterator extends RecursiveIteratorIterator
{
public const BYPASS_CURRENT = 4;
public const BYPASS_KEY = 8;

public const PREFIX_LEFT = 0;
public const PREFIX_MID_HAS_NEXT = 1;
public const PREFIX_MID_LAST = 2;
Expand Down
3 changes: 3 additions & 0 deletions SPL/SPL_c1.php
Original file line number Diff line number Diff line change
Expand Up @@ -603,14 +603,17 @@ class SplFileObject extends SplFileInfo implements RecursiveIterator, SeekableIt
* Drop newlines at the end of a line.
*/
public const DROP_NEW_LINE = 1;

/**
* Read on rewind/next.
*/
public const READ_AHEAD = 2;

/**
* Skip empty lines in the file. This requires the {@see READ_AHEAD} flag to work as expected.
*/
public const SKIP_EMPTY = 4;

/**
* Read lines as CSV rows.
*/
Expand Down
4 changes: 4 additions & 0 deletions SQLite/SQLite.php
Original file line number Diff line number Diff line change
Expand Up @@ -371,20 +371,23 @@ public function fieldName($field_index) {}
* option.</p>
*/
public function current($result_type = SQLITE_BOTH, $decode_binary = true) {}

/**
* Return the key of the current element
* @link https://php.net/manual/en/iterator.key.php
* @return mixed scalar on success, or null on failure.
* @since 5.0.0
*/
public function key() {}

/**
* Seek to the next row number
* @link https://php.net/manual/en/function.sqlite-next.php
* @return bool Returns <b>TRUE</b> on success, or <b>FALSE</b> if there are no more rows.
* @since 5.0.0
*/
public function next() {}

/**
* Checks if current position is valid
* @link https://php.net/manual/en/iterator.valid.php
Expand All @@ -395,6 +398,7 @@ public function next() {}
* @since 5.0.0
*/
public function valid() {}

/**
* Rewind the Iterator to the first element
* @link https://php.net/manual/en/iterator.rewind.php
Expand Down
Loading

0 comments on commit 0fe2c0c

Please sign in to comment.