Skip to content

Commit

Permalink
Merge pull request #225 from techi602/zf1-future-phpstan-docblock-fixes
Browse files Browse the repository at this point in the history
Zf1 future phpstan docblock fixes
  • Loading branch information
Shardj authored Jun 1, 2022
2 parents ece10e3 + 538eedf commit 5d63531
Show file tree
Hide file tree
Showing 17 changed files with 60 additions and 55 deletions.
2 changes: 1 addition & 1 deletion library/Zend/Cache/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ public function test($id)
* @param mixed $data Data to put in cache (can be another type than string if automatic_serialization is on)
* @param string $id Cache id (if not set, the last cache id will be used)
* @param array $tags Cache tags
* @param int $specificLifetime If != false, set a specific lifetime for this cache record (null => infinite lifetime)
* @param int|false|null $specificLifetime If != false, set a specific lifetime for this cache record (null => infinite lifetime)
* @param int $priority integer between 0 (very low priority) and 10 (maximum priority) used by some particular backends
* @throws Zend_Cache_Exception
* @return boolean True if no problem
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Controller/Router/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,14 @@ public function getVersion()
* Instantiates route based on passed Zend_Config structure
*
* @param Zend_Config $config Configuration object
* @return Zend_Controller_Router_Route
* @return static
*/
public static function getInstance(Zend_Config $config)
{
$reqs = ($config->reqs instanceof Zend_Config) ? $config->reqs->toArray() : [];
$defs = ($config->defaults instanceof Zend_Config) ? $config->defaults->toArray() : [];

return new self($config->route, $defs, $reqs);
return new static($config->route, $defs, $reqs);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Controller/Router/Route/Chain.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ class Zend_Controller_Router_Route_Chain extends Zend_Controller_Router_Route_Ab
* Instantiates route based on passed Zend_Config structure
*
* @param Zend_Config $config Configuration object
* @return Zend_Controller_Router_Route_Chain
* @return static
*/
public static function getInstance(Zend_Config $config)
{
$defs = ($config->defaults instanceof Zend_Config) ? $config->defaults->toArray() : [];

return new self($config->route, $defs);
return new static($config->route, $defs);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Controller/Router/Route/Hostname.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@ public function getRequest()
* Instantiates route based on passed Zend_Config structure
*
* @param Zend_Config $config Configuration object
* @return Zend_Controller_Router_Route_Hostname
* @return static
*/
public static function getInstance(Zend_Config $config)
{
$reqs = ($config->reqs instanceof Zend_Config) ? $config->reqs->toArray() : [];
$defs = ($config->defaults instanceof Zend_Config) ? $config->defaults->toArray() : [];
$scheme = (isset($config->scheme)) ? $config->scheme : null;

return new self($config->route, $defs, $reqs, $scheme);
return new static($config->route, $defs, $reqs, $scheme);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Controller/Router/Route/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function getVersion()
* Instantiates route based on passed Zend_Config structure
*
* @param Zend_Config $config
* @return Zend_Controller_Router_Route_Module
* @return static
*/
public static function getInstance(Zend_Config $config)
{
Expand All @@ -105,7 +105,7 @@ public static function getInstance(Zend_Config $config)
$dispatcher = $frontController->getDispatcher();
$request = $frontController->getRequest();

return new self($defs, $dispatcher, $request);
return new static($defs, $dispatcher, $request);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Controller/Router/Route/Regex.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@ class Zend_Controller_Router_Route_Regex extends Zend_Controller_Router_Route_Ab
* Instantiates route based on passed Zend_Config structure
*
* @param Zend_Config $config Configuration object
* @return Zend_Controller_Router_Route_Regex
* @return static
*/
public static function getInstance(Zend_Config $config)
{
$defs = ($config->defaults instanceof Zend_Config) ? $config->defaults->toArray() : [];
$map = ($config->map instanceof Zend_Config) ? $config->map->toArray() : [];
$reverse = (isset($config->reverse)) ? $config->reverse : null;

return new self($config->route, $defs, $map, $reverse);
return new static($config->route, $defs, $map, $reverse);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Controller/Router/Route/Static.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ public function getVersion()
* Instantiates route based on passed Zend_Config structure
*
* @param Zend_Config $config Configuration object
* @return Zend_Controller_Router_Route_Static
* @return static
*/
public static function getInstance(Zend_Config $config)
{
$defs = ($config->defaults instanceof Zend_Config) ? $config->defaults->toArray() : [];

return new self($config->route, $defs);
return new static($config->route, $defs);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Db/Adapter/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ public function fetchPairs($sql, $bind = [])
*
* @param string|Zend_Db_Select $sql An SQL SELECT statement.
* @param mixed $bind Data to bind into SELECT placeholders.
* @return string
* @return string|false|null
*/
public function fetchOne($sql, $bind = [])
{
Expand Down
50 changes: 25 additions & 25 deletions library/Zend/Db/Select.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public function getBind()
* Set bind variables
*
* @param mixed $bind
* @return Zend_Db_Select
* @return $this
*/
public function bind($bind)
{
Expand All @@ -222,7 +222,7 @@ public function bind($bind)
* Makes the query SELECT DISTINCT.
*
* @param bool $flag Whether or not the SELECT is DISTINCT (default true).
* @return Zend_Db_Select This Zend_Db_Select object.
* @return $this This Zend_Db_Select object.
*/
public function distinct($flag = true)
{
Expand Down Expand Up @@ -252,7 +252,7 @@ public function distinct($flag = true)
* relating correlation name to table name.
* @param array|string|Zend_Db_Expr $cols The columns to select from this table.
* @param string $schema The schema name to specify, if any.
* @return Zend_Db_Select This Zend_Db_Select object.
* @return $this This Zend_Db_Select object.
*/
public function from($name, $cols = '*', $schema = null)
{
Expand All @@ -267,7 +267,7 @@ public function from($name, $cols = '*', $schema = null)
*
* @param array|string|Zend_Db_Expr $cols The columns to select from this table.
* @param string $correlationName Correlation name of target table. OPTIONAL
* @return Zend_Db_Select This Zend_Db_Select object.
* @return $this This Zend_Db_Select object.
*/
public function columns($cols = '*', $correlationName = null)
{
Expand Down Expand Up @@ -304,7 +304,7 @@ public function columns($cols = '*', $correlationName = null)
* </code>
*
* @param array $select Array of select clauses for the union.
* @return Zend_Db_Select This Zend_Db_Select object.
* @return $this This Zend_Db_Select object.
*/
public function union($select = [], $type = self::SQL_UNION)
{
Expand Down Expand Up @@ -337,7 +337,7 @@ public function union($select = [], $type = self::SQL_UNION)
* @param string $cond Join on this condition.
* @param array|string $cols The columns to select from the joined table.
* @param string $schema The database name to specify, if any.
* @return Zend_Db_Select This Zend_Db_Select object.
* @return $this This Zend_Db_Select object.
*/
public function join($name, $cond, $cols = self::SQL_WILDCARD, $schema = null)
{
Expand All @@ -358,7 +358,7 @@ public function join($name, $cond, $cols = self::SQL_WILDCARD, $schema = null)
* @param string $cond Join on this condition.
* @param array|string $cols The columns to select from the joined table.
* @param string $schema The database name to specify, if any.
* @return Zend_Db_Select This Zend_Db_Select object.
* @return $this This Zend_Db_Select object.
*/
public function joinInner($name, $cond, $cols = self::SQL_WILDCARD, $schema = null)
{
Expand All @@ -379,7 +379,7 @@ public function joinInner($name, $cond, $cols = self::SQL_WILDCARD, $schema = nu
* @param string $cond Join on this condition.
* @param array|string $cols The columns to select from the joined table.
* @param string $schema The database name to specify, if any.
* @return Zend_Db_Select This Zend_Db_Select object.
* @return $this This Zend_Db_Select object.
*/
public function joinLeft($name, $cond, $cols = self::SQL_WILDCARD, $schema = null)
{
Expand All @@ -401,7 +401,7 @@ public function joinLeft($name, $cond, $cols = self::SQL_WILDCARD, $schema = nul
* @param string $cond Join on this condition.
* @param array|string $cols The columns to select from the joined table.
* @param string $schema The database name to specify, if any.
* @return Zend_Db_Select This Zend_Db_Select object.
* @return $this This Zend_Db_Select object.
*/
public function joinRight($name, $cond, $cols = self::SQL_WILDCARD, $schema = null)
{
Expand All @@ -423,7 +423,7 @@ public function joinRight($name, $cond, $cols = self::SQL_WILDCARD, $schema = nu
* @param string $cond Join on this condition.
* @param array|string $cols The columns to select from the joined table.
* @param string $schema The database name to specify, if any.
* @return Zend_Db_Select This Zend_Db_Select object.
* @return $this This Zend_Db_Select object.
*/
public function joinFull($name, $cond, $cols = self::SQL_WILDCARD, $schema = null)
{
Expand All @@ -440,7 +440,7 @@ public function joinFull($name, $cond, $cols = self::SQL_WILDCARD, $schema = nul
* @param array|string|Zend_Db_Expr $name The table name.
* @param array|string $cols The columns to select from the joined table.
* @param string $schema The database name to specify, if any.
* @return Zend_Db_Select This Zend_Db_Select object.
* @return $this This Zend_Db_Select object.
*/
public function joinCross($name, $cols = self::SQL_WILDCARD, $schema = null)
{
Expand All @@ -460,7 +460,7 @@ public function joinCross($name, $cols = self::SQL_WILDCARD, $schema = null)
* @param array|string|Zend_Db_Expr $name The table name.
* @param array|string $cols The columns to select from the joined table.
* @param string $schema The database name to specify, if any.
* @return Zend_Db_Select This Zend_Db_Select object.
* @return $this This Zend_Db_Select object.
*/
public function joinNatural($name, $cols = self::SQL_WILDCARD, $schema = null)
{
Expand Down Expand Up @@ -497,7 +497,7 @@ public function joinNatural($name, $cols = self::SQL_WILDCARD, $schema = null)
* @param string $cond The WHERE condition.
* @param mixed $value OPTIONAL The value to quote into the condition.
* @param int $type OPTIONAL The type of the given value
* @return Zend_Db_Select This Zend_Db_Select object.
* @return $this This Zend_Db_Select object.
*/
public function where($cond, $value = null, $type = null)
{
Expand All @@ -514,7 +514,7 @@ public function where($cond, $value = null, $type = null)
* @param string $cond The WHERE condition.
* @param mixed $value OPTIONAL The value to quote into the condition.
* @param int $type OPTIONAL The type of the given value
* @return Zend_Db_Select This Zend_Db_Select object.
* @return $this This Zend_Db_Select object.
*
* @see where()
*/
Expand All @@ -529,7 +529,7 @@ public function orWhere($cond, $value = null, $type = null)
* Adds grouping to the query.
*
* @param array|string $spec The column(s) to group by.
* @return Zend_Db_Select This Zend_Db_Select object.
* @return $this This Zend_Db_Select object.
*/
public function group($spec)
{
Expand Down Expand Up @@ -559,7 +559,7 @@ public function group($spec)
* @param string $cond The HAVING condition.
* @param mixed $value OPTIONAL The value to quote into the condition.
* @param int $type OPTIONAL The type of the given value
* @return Zend_Db_Select This Zend_Db_Select object.
* @return $this This Zend_Db_Select object.
*/
public function having($cond, $value = null, $type = null)
{
Expand All @@ -584,7 +584,7 @@ public function having($cond, $value = null, $type = null)
* @param string $cond The HAVING condition.
* @param mixed $value OPTIONAL The value to quote into the condition.
* @param int $type OPTIONAL The type of the given value
* @return Zend_Db_Select This Zend_Db_Select object.
* @return $this This Zend_Db_Select object.
*
* @see having()
*/
Expand All @@ -607,7 +607,7 @@ public function orHaving($cond, $value = null, $type = null)
* Adds a row order to the query.
*
* @param mixed $spec The column(s) and direction to order by.
* @return Zend_Db_Select This Zend_Db_Select object.
* @return $this This Zend_Db_Select object.
*/
public function order($spec)
{
Expand Down Expand Up @@ -649,7 +649,7 @@ public function order($spec)
*
* @param int $count OPTIONAL The number of rows to return.
* @param int $offset OPTIONAL Start returning after this many rows.
* @return Zend_Db_Select This Zend_Db_Select object.
* @return $this This Zend_Db_Select object.
*/
public function limit($count = null, $offset = null)
{
Expand All @@ -663,7 +663,7 @@ public function limit($count = null, $offset = null)
*
* @param int $page Limit results to this page number.
* @param int $rowCount Use this many rows per page.
* @return Zend_Db_Select This Zend_Db_Select object.
* @return $this This Zend_Db_Select object.
*/
public function limitPage($page, $rowCount)
{
Expand All @@ -680,7 +680,7 @@ public function limitPage($page, $rowCount)
* @param mixed $flag Whether or not the SELECT is FOR UPDATE (default true),
pass the flag FU_MODE_NOWAIT or FU_MODE_SKIP to make
the FOR UPDATE either NOWAIT or SKIP LOCKED
* @return Zend_Db_Select This Zend_Db_Select object.
* @return $this This Zend_Db_Select object.
*/
public function forUpdate($flag = true)
{
Expand Down Expand Up @@ -750,7 +750,7 @@ public function assemble()
* Clear parts of the Select object, or an individual part.
*
* @param string $part OPTIONAL
* @return Zend_Db_Select
* @return $this
*/
public function reset($part = null)
{
Expand Down Expand Up @@ -786,7 +786,7 @@ public function getAdapter()
* @param string $cond Join on this condition
* @param array|string $cols The columns to select from the joined table
* @param string $schema The database name to specify, if any.
* @return Zend_Db_Select This Zend_Db_Select object
* @return $this This Zend_Db_Select object
* @throws Zend_Db_Select_Exception
*/
protected function _join($type, $name, $cond, $cols, $schema = null)
Expand Down Expand Up @@ -906,7 +906,7 @@ protected function _join($type, $name, $cond, $cols, $schema = null)
* * joinRightUsing
* * joinLeftUsing
*
* @return Zend_Db_Select This Zend_Db_Select object.
* @return $this This Zend_Db_Select object.
*/
public function _joinUsing($type, $name, $cond, $cols = '*', $schema = null)
{
Expand Down Expand Up @@ -1346,7 +1346,7 @@ protected function _renderForupdate($sql)
*
* @param string $method
* @param array $args OPTIONAL Zend_Db_Table_Select query modifier
* @return Zend_Db_Select
* @return $this
* @throws Zend_Db_Select_Exception If an invalid method is called.
*/
public function __call($method, array $args)
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Db/Statement/Interface.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public function fetchAll($style = null, $col = null);
* Returns a single column from the next row of a result set.
*
* @param int $col OPTIONAL Position of the column to fetch.
* @return string
* @return string|false|null
* @throws Zend_Db_Statement_Exception
*/
public function fetchColumn($col = 0);
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Db/Table/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ abstract class Zend_Db_Table_Abstract
/**
* Default Zend_Db_Adapter_Abstract object.
*
* @var Zend_Db_Adapter_Abstract
* @var Zend_Db_Adapter_Abstract|null
*/
protected static $_defaultDb;

Expand Down Expand Up @@ -566,7 +566,7 @@ public static function setDefaultAdapter($db = null)
/**
* Gets the default Zend_Db_Adapter_Abstract for all Zend_Db_Table objects.
*
* @return Zend_Db_Adapter_Abstract or null
* @return Zend_Db_Adapter_Abstract|null
*/
public static function getDefaultAdapter()
{
Expand Down
6 changes: 3 additions & 3 deletions library/Zend/Db/Table/Select.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function getTable()
* Sets the primary table name and retrieves the table schema.
*
* @param Zend_Db_Table_Abstract $adapter
* @return Zend_Db_Select This Zend_Db_Select object.
* @return $this This Zend_Db_Select object.
*/
public function setTable(Zend_Db_Table_Abstract $table)
{
Expand All @@ -110,7 +110,7 @@ public function setTable(Zend_Db_Table_Abstract $table)
* 'hybrid' table rows to be created.
*
* @param Zend_Db_Table_Abstract $adapter
* @return Zend_Db_Select This Zend_Db_Select object.
* @return $this This Zend_Db_Select object.
*/
public function setIntegrityCheck($flag = true)
{
Expand Down Expand Up @@ -166,7 +166,7 @@ public function isReadOnly()
name.
* @param array|string|Zend_Db_Expr $cols The columns to select from this table.
* @param string $schema The schema name to specify, if any.
* @return Zend_Db_Table_Select This Zend_Db_Table_Select object.
* @return $this This Zend_Db_Table_Select object.
*/
public function from($name, $cols = self::SQL_WILDCARD, $schema = null)
{
Expand Down
Loading

0 comments on commit 5d63531

Please sign in to comment.