Skip to content

Commit

Permalink
improve some more phpdocs
Browse files Browse the repository at this point in the history
dom_import_simplexml -> fix types

-> https://3v4l.org/67Al2
  • Loading branch information
voku authored and isfedorov committed Dec 14, 2020
1 parent b60f4da commit ad901bf
Show file tree
Hide file tree
Showing 74 changed files with 365 additions and 346 deletions.
20 changes: 10 additions & 10 deletions Core/Core_c.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ final private function __clone() { }
* @param null|Throwable $previous [optional] The previous throwable used for the exception chaining.
*/
#[Pure]
public function __construct($message = "", $code = 0, Throwable $previous = null) { }
public function __construct($message = "", $code = 0, ?Throwable $previous = null) { }

/**
* Gets the Exception message
Expand Down Expand Up @@ -371,7 +371,7 @@ class Error implements Throwable {
* @param int $code [optional] The Error code.
* @param null|Throwable $previous [optional] The previous throwable used for the exception chaining.
*/
public function __construct($message = "", $code = 0, Throwable $previous = null)
public function __construct($message = "", $code = 0, ?Throwable $previous = null)
{
}

Expand All @@ -381,7 +381,7 @@ public function __construct($message = "", $code = 0, Throwable $previous = null
* @return string
* @since 7.0
*/
final public function getMessage()
public final function getMessage()
{
}

Expand All @@ -396,7 +396,7 @@ final public function getMessage()
* </p>
* @since 7.0
*/
final public function getCode(){}
public final function getCode(){}


/**
Expand All @@ -405,7 +405,7 @@ final public function getCode(){}
* @return string Returns the name of the file from which the object was thrown.
* @since 7.0
*/
final public function getFile(){}
public final function getFile(){}


/**
Expand All @@ -414,7 +414,7 @@ final public function getFile(){}
* @return int Returns the line number where the thrown object was instantiated.
* @since 7.0
*/
final public function getLine(){}
public final function getLine(){}


/**
Expand All @@ -426,23 +426,23 @@ final public function getLine(){}
* </p>
* @since 7.0
*/
final public function getTrace(){}
public final function getTrace(){}

/**
* Gets the stack trace as a string
* @link https://php.net/manual/en/throwable.gettraceasstring.php
* @return string Returns the stack trace as a string.
* @since 7.0
*/
final public function getTraceAsString(){}
public final function getTraceAsString(){}

/**
* Returns the previous Throwable
* @link https://php.net/manual/en/throwable.getprevious.php
* @return Throwable Returns the previous {@see Throwable} if available, or <b>NULL</b> otherwise.
* @since 7.0
*/
final public function getPrevious(){}
public final function getPrevious(){}
/**
* Gets a string representation of the thrown object
* @link https://php.net/manual/en/throwable.tostring.php
Expand All @@ -457,7 +457,7 @@ public function __toString(){}
* @return void
* @link https://php.net/manual/en/error.clone.php
*/
final private function __clone(){}
private final function __clone(){}

public function __wakeup(){}
}
Expand Down
25 changes: 13 additions & 12 deletions Ev/Ev.php
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,7 @@ final class EvPeriodic extends EvWatcher
*/
public $interval;


/**
* Constructs EvPeriodic watcher object.
*
Expand All @@ -813,7 +814,7 @@ final class EvPeriodic extends EvWatcher
* @param int $priority
*/
public function __construct(
$offset, $interval, callable $reschedule_cb = null, callable $callback, $data = null, $priority = 0
$offset, $interval, ?callable $reschedule_cb = null, callable $callback, $data = null, $priority = 0
) {}

/**
Expand Down Expand Up @@ -854,7 +855,7 @@ public function at() {}
* @return EvPeriodic
*/
final public static function createStopped(
$offset, $interval, callable $reschedule_cb = null, callable $callback, $data = null, $priority = 0
$offset, $interval, ?callable $reschedule_cb = null, callable $callback, $data = null, $priority = 0
) {}

/**
Expand Down Expand Up @@ -1321,7 +1322,7 @@ public function backend() {}
* @param int $priority
* @return EvCheck
*/
final public function check(callable $callback, $data = null, $priority = 0) {}
public final function check(callable $callback, $data = null, $priority = 0) {}

/**
* Creates EvChild object associated with the current event loop instance;
Expand All @@ -1333,7 +1334,7 @@ final public function check(callable $callback, $data = null, $priority = 0) {}
* @param int $priority
* @return EvChild
*/
final public function child($pid, $trace, callable $callback, $data = null, $priority = 0) {}
public final function child($pid, $trace, callable $callback, $data = null, $priority = 0) {}

/**
* Creates EvEmbed object associated with the current event loop instance.
Expand All @@ -1344,7 +1345,7 @@ final public function child($pid, $trace, callable $callback, $data = null, $pri
* @param int $priority
* @return EvEmbed
*/
final public function embed(EvLoop $other, callable $callback, $data = null, $priority = 0) {}
public final function embed(EvLoop $other, callable $callback, $data = null, $priority = 0) {}

/**
* Creates EvFork object associated with the current event loop instance.
Expand All @@ -1354,7 +1355,7 @@ final public function embed(EvLoop $other, callable $callback, $data = null, $pr
* @param int $priority
* @return EvFork
*/
final public function fork(callable $callback, $data = null, $priority = 0) {}
public final function fork(callable $callback, $data = null, $priority = 0) {}

/**
* Creates EvIdle object associated with the current event loop instance.
Expand All @@ -1364,7 +1365,7 @@ final public function fork(callable $callback, $data = null, $priority = 0) {}
* @param int $priority
* @return EvIdle
*/
final public function idle(callable $callback, $data = null, $priority = 0) {}
public final function idle(callable $callback, $data = null, $priority = 0) {}

/**
* Invoke all pending watchers while resetting their pending state.
Expand Down Expand Up @@ -1424,7 +1425,7 @@ public function nowUpdate() {}
* @param mixed $data
* @param int $priority
*/
final public function periodic($offset, $interval, callable $callback, $data = null, $priority = 0) {}
public final function periodic($offset, $interval, callable $callback, $data = null, $priority = 0) {}

/**
* Creates EvPrepare object associated with the current event loop instance.
Expand All @@ -1433,7 +1434,7 @@ final public function periodic($offset, $interval, callable $callback, $data = n
* @param mixed $data
* @param int $priority
*/
final public function prepare(callable $callback, $data = null, $priority = 0) {}
public final function prepare(callable $callback, $data = null, $priority = 0) {}

/**
* Resume previously suspended default event loop.
Expand Down Expand Up @@ -1463,7 +1464,7 @@ public function run($flags = Ev::FLAG_AUTO) {}
* @param int $priority
* @return EvSignal
*/
final public function signal($signal, callable $callback, $data = null, $priority = 0)
public final function signal($signal, callable $callback, $data = null, $priority = 0)
{
}

Expand All @@ -1477,7 +1478,7 @@ final public function signal($signal, callable $callback, $data = null, $priorit
* @param int $priority
* @return EvStat
*/
final public function stat($path, $interval, callable $callback, $data = null, $priority = 0) {}
public final function stat($path, $interval, callable $callback, $data = null, $priority = 0) {}

/**
* Stops the event loop.
Expand All @@ -1503,7 +1504,7 @@ public function suspend() {}
* @param int $priority
* @return EvTimer
*/
final public function timer($after, $repeat, callable $callback, $data = null, $priority = 0) {}
public final function timer($after, $repeat, callable $callback, $data = null, $priority = 0) {}

/**
* Performs internal consistency checks (for debugging).
Expand Down
9 changes: 5 additions & 4 deletions PDO/PDO.php
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ public function __construct ($dsn, $username = null, $password = null, $options
* Emulated prepared statements does not communicate with the database server
* so <b>PDO::prepare</b> does not check the statement.
*/
public function prepare ($query, array $options = []) {}
public function prepare ($query, array $options = array()) {}

/**
* (PHP 5 &gt;= 5.1.0, PHP 7, PECL pdo &gt;= 0.1.0)<br/>
Expand Down Expand Up @@ -1003,7 +1003,7 @@ public function exec ($statement) {}
* on failure.
* @see PDOStatement::setFetchMode For a full description of the second and following parameters.
*/
public function query ($statement, $mode = PDO::ATTR_DEFAULT_FETCH_MODE, $arg3 = null, array $ctorargs = []) {}
public function query ($statement, $mode = PDO::ATTR_DEFAULT_FETCH_MODE, $arg3 = null, array $ctorargs = array()) {}

#[PhpStormStubsElementAvailable('8.0')]
/**
Expand Down Expand Up @@ -1437,7 +1437,7 @@ public function fetchAll ($mode = PDO::FETCH_BOTH, ...$args) {}
* @return mixed an instance of the required class with property names that
* correspond to the column names or <b>FALSE</b> on failure.
*/
public function fetchObject ($class = "stdClass", array $ctorArgs = []) {}
public function fetchObject ($class = "stdClass", array $ctorArgs = array()) {}

/**
* (PHP 5 &gt;= 5.1.0, PHP 7, PECL pdo &gt;= 0.1.0)<br/>
Expand Down Expand Up @@ -1586,7 +1586,7 @@ public function getColumnMeta ($column) {}
* @param array $params [optional] <p> Constructor arguments. </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
public function setFetchMode ($mode, $className = null, array $params = []) {}
public function setFetchMode ($mode, $className = null, array $params = array()) {}

#[PhpStormStubsElementAvailable('8.0')]
/**
Expand Down Expand Up @@ -1634,6 +1634,7 @@ final public function __sleep () {}

/**
* @since 8.0
* @return Traversable
*/
public function getIterator(){}
}
Expand Down
10 changes: 9 additions & 1 deletion Phar/Phar.php
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ final public static function unlinkArchive ($filename) {}
* </p>
* @return void No value is returned.
*/
final public static function webPhar ($alias = null, $index = "index.php", $fileNotFoundScript = null, array $mimeTypes = null, callable $rewrite = null) {}
final public static function webPhar ($alias = null, $index = "index.php", $fileNotFoundScript = null, ?array $mimeTypes = null, ?callable $rewrite = null) {}

/**
* Returns whether current entry is a directory and not '.' or '..'
Expand Down Expand Up @@ -907,8 +907,16 @@ class PharData extends Phar {
*/
public function __construct ($filename, $flags = null, $alias = null, $format = Phar::TAR) {}

/**
* @param string $localName
* @return bool
*/
public function offsetExists ($localName) {}

/**
* @param string $localName
* @return string
*/
public function offsetGet ($localName) {}

/**
Expand Down
6 changes: 3 additions & 3 deletions SPL/SPL.php
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,7 @@ class RegexIterator extends FilterIterator {
* Create a new RegexIterator
* @link https://php.net/manual/en/regexiterator.construct.php
* @param Iterator $iterator The iterator to apply this regex filter to.
* @param string $pattern [optional] The regular expression to match.
* @param string $pattern The regular expression to match.
* @param int $mode [optional] Operation mode, see RegexIterator::setMode() for a list of modes.
* @param int $flags [optional] Special flags, see RegexIterator::setFlags() for a list of available flags.
* @param int $pregFlags [optional] The regular expression flags. These flags depend on the operation mode parameter
Expand Down Expand Up @@ -1439,7 +1439,7 @@ class ArrayObject implements IteratorAggregate, ArrayAccess, Serializable, Count
* @param string $iteratorClass Specify the class that will be used for iteration of the ArrayObject object. ArrayIterator is the default class used.
*
*/
public function __construct($array = [], $flags = 0, $iteratorClass = "ArrayIterator") { }
public function __construct($array = array(), $flags = 0, $iteratorClass = "ArrayIterator") { }

/**
* Returns whether the requested index exists
Expand Down Expand Up @@ -1705,7 +1705,7 @@ class ArrayIterator implements SeekableIterator, ArrayAccess, Serializable, Coun
* @param int $flags Flags to control the behaviour of the ArrayObject object.
* @see ArrayObject::setFlags()
*/
public function __construct($array = [], $flags = 0) { }
public function __construct($array = array(), $flags = 0) { }

/**
* Check if offset exists
Expand Down
5 changes: 4 additions & 1 deletion SPL/SPL_c1.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ public function setInfoClass ($class = null) {}
*/
public function __toString () {}

final public function _bad_state_ex (){}
public final function _bad_state_ex (){}

public function __wakeup()
{
Expand Down Expand Up @@ -1738,6 +1738,9 @@ public function __wakeup()
{
}

/**
* @return Traversable
*/
public function getIterator() {}
}

Expand Down
22 changes: 11 additions & 11 deletions SQLite/SQLite.php
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ function sqlite_close ($dbhandle) {}
* Data inside the query should be properly escaped.
* </p>
* @param resource|string $dbhandle The SQLite Database resource; returned from sqlite_open() when used procedurally. This parameter is not required when using the object-oriented method.
* @param int $result_type [optional] &sqlite.result-type;<p>The optional <i>result_type</i>
* @param int $result_type [optional] <p>The optional <i>result_type</i>
* parameter accepts a constant and determines how the returned array will be
* indexed. Using <b>SQLITE_ASSOC</b> will return only associative
* indices (named fields) while <b>SQLITE_NUM</b> will return
Expand Down Expand Up @@ -698,14 +698,14 @@ function sqlite_exec ($dbhandle, $query, &$error_msg = null) {}
* when used procedurally. This parameter is not required
* when using the object-oriented method.
* </p>
* @param int $result_type [optional] &sqlite.result-type; <p>The optional <i>result_type</i>
* @param int $result_type [optional] <p>The optional <i>result_type</i>
* parameter accepts a constant and determines how the returned array will be
* indexed. Using <b>SQLITE_ASSOC</b> will return only associative
* indices (named fields) while <b>SQLITE_NUM</b> will return
* only numerical indices (ordinal field numbers). <b>SQLITE_BOTH</b>
* will return both associative and numerical indices.
* <b>SQLITE_BOTH</b> is the default for this function.</p>
* @param bool $decode_binary [optional] &sqlite.decode-bin; <p>When the <i>decode_binary</i>
* @param bool $decode_binary [optional] <p>When the <i>decode_binary</i>
* parameter is set to <b>TRUE</b> (the default), PHP will decode the binary encoding
* it applied to the data if it was encoded using the
* {@link sqlite_escape_string()}. You should normally leave this
Expand Down Expand Up @@ -737,8 +737,8 @@ function sqlite_single_query ($db, $query, $first_row_only = null, $decode_binar
* Fetches the next row from a result set as an array
* @link https://php.net/manual/en/function.sqlite-fetch-array.php
* @param resource $result <p>The SQLite result resource. This parameter is not required when using the object-oriented method.</p>
* @param int $result_type [optional] &sqlite.result-type;
* @param bool $decode_binary [optional] &sqlite.decode-bin;
* @param int $result_type [optional]
* @param bool $decode_binary [optional]
* @return array|false <p>an array of the next row from a result set; false if the
* next position is beyond the final row.</p>
*/
Expand All @@ -748,12 +748,12 @@ function sqlite_fetch_array ($result, $result_type = SQLITE_BOTH, $decode_binary
* Fetches the next row from a result set as an object
* @link https://php.net/manual/en/function.sqlite-fetch-object.php
* @param resource $result
* @param null|string $class_name [optional]
* @param string $class_name [optional]
* @param null|array $ctor_params [optional]
* @param null|bool $decode_binary [optional]
* @param bool $decode_binary [optional]
* @return object
*/
function sqlite_fetch_object ($result, $class_name = null, array $ctor_params = null, $decode_binary = null) {}
function sqlite_fetch_object ($result, $class_name = null, ?array $ctor_params = null, $decode_binary = null) {}

/**
* (PHP 5, PECL sqlite &gt;= 1.0.1)<br/>
Expand Down Expand Up @@ -789,8 +789,8 @@ function sqlite_fetch_string ($result, $decode_binary) {}
* (PHP 5, PECL sqlite &gt;= 1.0.0)<br/>
* Fetches all rows from a result set as an array of arrays
* @link https://php.net/manual/en/function.sqlite-fetch-all.php
* @param int $result_type [optional] &sqlite.result-type;
* @param bool $decode_binary [optional] &sqlite.decode-bin;
* @param int $result_type [optional]
* @param bool $decode_binary [optional]
* @return array <p>an array of the remaining rows in a result set. If called right
* after
* {@see sqlite_query}, it returns all rows. If called
Expand Down Expand Up @@ -1079,7 +1079,7 @@ function sqlite_error_string ($error_code) {}
* <p>
* Data inside the query should be properly escaped.
* </p>
* @param int $result_type [optional] &sqlite.result-type;
* @param int $result_type [optional]
* @param string &$error_msg [optional] <p>
* The specified variable will be filled if an error occurs. This is
* specially important because SQL syntax errors can't be fetched using
Expand Down
Loading

0 comments on commit ad901bf

Please sign in to comment.