Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix PHPDoc blocks #2169

Merged
merged 3 commits into from

5 participants

Maks3w Don't Add Me To Your Organization a.k.a The Travis Bot Matthew Weier O'Phinney Ben Scholzen Marc Bennewitz
Maks3w
Collaborator

No description provided.

Don't Add Me To Your Organization a.k.a The Travis Bot

This pull request passes (merged df5170b8 into fb9eef8).

Marc Bennewitz marc-mabe commented on the diff
library/Zend/Db/Adapter/Driver/Sqlsrv/Connection.php
@@ -301,6 +301,7 @@ public function prepare($sql)
/**
* Get last generated id
*
+ * @param string $name

string|null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Marc Bennewitz marc-mabe commented on the diff
library/Zend/Db/Adapter/Driver/Sqlsrv/Statement.php
@@ -167,7 +167,7 @@ public function isPrepared()
* Execute
*
* @param array|ParameterContainer $parameters

null|array|ParameterContainer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Marc Bennewitz marc-mabe commented on the diff
library/Zend/Db/Metadata/Object/ConstraintObject.php
@@ -102,7 +102,7 @@ class ConstraintObject
* Constructor
*
* @param string $name
- * @param string $table
+ * @param string $tableName
* @param string $schemaName

same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Marc Bennewitz marc-mabe commented on the diff
library/Zend/Db/Metadata/Source/AbstractSource.php
@@ -67,6 +67,7 @@ public function getSchemas()
* Get table names
*
* @param string $schema
+ * @param bool $includeViews

same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Marc Bennewitz marc-mabe commented on the diff
library/Zend/Db/Metadata/Source/AbstractSource.php
@@ -95,6 +96,7 @@ public function getTableNames($schema = null, $includeViews = false)
* Get tables
*
* @param string $schema
+ * @param bool $includeViews

same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Marc Bennewitz marc-mabe commented on the diff
library/Zend/Db/ResultSet/ResultSet.php
@@ -47,7 +47,8 @@ class ResultSet extends AbstractResultSet
/**
* Constructor
*
- * @param null|ArrayObject $arrayObjectPrototype
+ * @param string $returnType
+ * @param null|ArrayObject $arrayObjectPrototype

I think ArrayObject could be a type-hint ?

Maks3w Collaborator
Maks3w added a note

if you see setArrayObjectPrototype there is the possibility of pass a non ArrayObject as argument

Matthew Weier O'Phinney Owner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
library/Zend/Db/RowGateway/AbstractRowGateway.php
@@ -108,8 +107,9 @@ public function populateOriginalData(array $originalData)
/**
* Populate Data
*
- * @param array $currentData
- * @return RowGateway
+ * @param array $rowData
+ * @param bool $isOriginal

bool|null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Maks3w
Collaborator

Thank you @marc-mabe for your review but there are tons of PHPDoc types candidates to have null as type (The return type of some getters are affected for this too)

Probably we can do some PRs with a mass fix for this.

Don't Add Me To Your Organization a.k.a The Travis Bot

This pull request passes (merged 13da152c into 022113e).

Don't Add Me To Your Organization a.k.a The Travis Bot

This pull request fails (merged aa5a4e2a into 022113e).

Don't Add Me To Your Organization a.k.a The Travis Bot

This pull request fails (merged 3704eca0 into 5dd58b8).

Don't Add Me To Your Organization a.k.a The Travis Bot

This pull request fails (merged 168b6d5 into 5dd58b8).

Maks3w Maks3w closed this
Maks3w Maks3w reopened this
Don't Add Me To Your Organization a.k.a The Travis Bot

This pull request passes (merged 168b6d5 into 5dd58b8).

Matthew Weier O'Phinney weierophinney commented on the diff
library/Zend/Db/Adapter/Driver/Mysqli/Mysqli.php
((5 lines not shown))
*/
- public function __construct($connection, Statement $statementPrototype = null, Result $resultPrototype = null, $options = array())
+ public function __construct($connection, Statement $statementPrototype = null, Result $resultPrototype = null, array $options = array())
Matthew Weier O'Phinney Owner

This is a signature change, and should be removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Matthew Weier O'Phinney weierophinney commented on the diff
library/Zend/Db/Adapter/Driver/Sqlsrv/Result.php
@@ -115,7 +116,7 @@ protected function load($row = SQLSRV_SCROLL_NEXT)
$this->currentData = sqlsrv_fetch_array($this->resource, SQLSRV_FETCH_ASSOC, $row);
$this->currentComplete = true;
$this->position++;
- return ($this->currentData);
+ return $this->currentData;
Matthew Weier O'Phinney Owner

This changes the value returned from a boolean to a value. Please revert.

Maks3w Collaborator
Maks3w added a note
function test() {
    return 1;
}
function test2() {
    return (1);
}

function test3() {
    return (bool) 1;
}

var_dump(test());
var_dump(test2());
var_dump(test3());

int(1)
int(1)
bool(true)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Ben Scholzen DASPRiD commented on the diff
library/Zend/Db/Adapter/Driver/Sqlsrv/Result.php
@@ -107,7 +108,7 @@ public function next()
/**
* Load
*
- * @param string $row
+ * @param int $row
Ben Scholzen Collaborator
DASPRiD added a note

I'd say this should be "integer", as we use full type names everywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Matthew Weier O'Phinney weierophinney merged commit 168b6d5 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 17, 2012
  1. Maks3w

    [Db] Remove obsolete class

    Maks3w authored
Commits on Aug 18, 2012
  1. Maks3w

    [Db] Fix Docblocks

    Maks3w authored
Commits on Aug 19, 2012
  1. Maks3w

    [View] Fix docblock

    Maks3w authored
This page is out of date. Refresh to see the latest.
Showing with 122 additions and 270 deletions.
  1. +2 −2 library/Zend/Db/Adapter/Adapter.php
  2. +4 −1 library/Zend/Db/Adapter/Driver/DriverInterface.php
  3. +1 −1  library/Zend/Db/Adapter/Driver/Feature/AbstractFeature.php
  4. +6 −3 library/Zend/Db/Adapter/Driver/Mysqli/Mysqli.php
  5. +0 −2  library/Zend/Db/Adapter/Driver/Mysqli/Statement.php
  6. +2 −1  library/Zend/Db/Adapter/Driver/Pdo/Connection.php
  7. +6 −4 library/Zend/Db/Adapter/Driver/Pdo/Pdo.php
  8. +2 −0  library/Zend/Db/Adapter/Driver/Pdo/Result.php
  9. +0 −2  library/Zend/Db/Adapter/Driver/Pdo/Statement.php
  10. +3 −2 library/Zend/Db/Adapter/Driver/Pgsql/Connection.php
  11. +6 −3 library/Zend/Db/Adapter/Driver/Pgsql/Pgsql.php
  12. +1 −1  library/Zend/Db/Adapter/Driver/Pgsql/Statement.php
  13. +1 −0  library/Zend/Db/Adapter/Driver/Sqlsrv/Connection.php
  14. +3 −2 library/Zend/Db/Adapter/Driver/Sqlsrv/Result.php
  15. +6 −4 library/Zend/Db/Adapter/Driver/Sqlsrv/Sqlsrv.php
  16. +1 −1  library/Zend/Db/Adapter/Driver/Sqlsrv/Statement.php
  17. +0 −153 library/Zend/Db/Metadata/Display/TextUi.php
  18. +2 −7 library/Zend/Db/Metadata/Metadata.php
  19. +10 −9 library/Zend/Db/Metadata/Object/ColumnObject.php
  20. +2 −2 library/Zend/Db/Metadata/Object/ConstraintObject.php
  21. +2 −0  library/Zend/Db/Metadata/Source/AbstractSource.php
  22. +2 −1  library/Zend/Db/ResultSet/ResultSet.php
  23. +4 −3 library/Zend/Db/RowGateway/AbstractRowGateway.php
  24. +0 −2  library/Zend/Db/Sql/Delete.php
  25. +0 −2  library/Zend/Db/Sql/Insert.php
  26. +2 −2 library/Zend/Db/Sql/Predicate/Between.php
  27. +1 −1  library/Zend/Db/Sql/Predicate/Expression.php
  28. +10 −10 library/Zend/Db/Sql/Predicate/Operator.php
  29. +28 −28 library/Zend/Db/Sql/Predicate/Predicate.php
  30. +2 −2 library/Zend/Db/Sql/PreparableSqlInterface.php
  31. +1 −1  library/Zend/Db/Sql/Select.php
  32. +0 −2  library/Zend/Db/Sql/Update.php
  33. +2 −1  library/Zend/Db/TableGateway/AbstractTableGateway.php
  34. +1 −1  library/Zend/Db/TableGateway/Feature/EventFeature.php
  35. +3 −3 library/Zend/Db/TableGateway/Feature/EventFeature/TableGatewayEvent.php
  36. +1 −1  library/Zend/Db/TableGateway/Feature/MetadataFeature.php
  37. +2 −2 library/Zend/Db/TableGateway/TableGateway.php
  38. +3 −8 library/Zend/View/Helper/Navigation.php
4 library/Zend/Db/Adapter/Adapter.php
View
@@ -68,7 +68,7 @@ class Adapter
/**
* @param Driver\DriverInterface|array $driver
* @param Platform\PlatformInterface $platform
- * @param ResultSet\ResultSet $queryResultPrototype
+ * @param ResultSet\ResultSetInterface $queryResultPrototype
*/
public function __construct($driver, Platform\PlatformInterface $platform = null, ResultSet\ResultSetInterface $queryResultPrototype = null)
{
@@ -94,7 +94,7 @@ public function __construct($driver, Platform\PlatformInterface $platform = null
/**
* getDriver()
*
- * @throws Exception
+ * @throws Exception\RuntimeException
* @return Driver\DriverInterface
*/
public function getDriver()
5 library/Zend/Db/Adapter/Driver/DriverInterface.php
View
@@ -39,11 +39,13 @@ public function checkEnvironment();
public function getConnection();
/**
+ * @param string|resource $sqlOrResource
* @return StatementInterface
*/
public function createStatement($sqlOrResource = null);
/**
+ * @param resource $resource
* @return ResultInterface
*/
public function createResult($resource);
@@ -54,7 +56,8 @@ public function createResult($resource);
public function getPrepareType();
/**
- * @param $name
+ * @param string $name
+ * @param mixed $type
* @return string
*/
public function formatParameterName($name, $type = null);
2  library/Zend/Db/Adapter/Driver/Feature/AbstractFeature.php
View
@@ -26,7 +26,7 @@
protected $driver = null;
/**
- * @param DriverInterface $pdoDriver
+ * @param DriverInterface $driver
*/
public function setDriver(DriverInterface $driver)
{
9 library/Zend/Db/Adapter/Driver/Mysqli/Mysqli.php
View
@@ -47,8 +47,9 @@ class Mysqli implements DriverInterface
* @param array|Connection|\mysqli $connection
* @param null|Statement $statementPrototype
* @param null|Result $resultPrototype
+ * @param array $options
*/
- public function __construct($connection, Statement $statementPrototype = null, Result $resultPrototype = null, $options = array())
+ public function __construct($connection, Statement $statementPrototype = null, Result $resultPrototype = null, array $options = array())
Matthew Weier O'Phinney Owner

This is a signature change, and should be removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
{
if (!$connection instanceof Connection) {
$connection = new Connection($connection);
@@ -145,7 +146,7 @@ public function getConnection()
}
/**
- * @param string $sql
+ * @param string $sqlOrResource
* @return Statement
*/
public function createStatement($sqlOrResource = null)
@@ -165,6 +166,7 @@ public function createStatement($sqlOrResource = null)
}
/**
+ * @param resource $resource
* @return Result
*/
public function createResult($resource, $isBuffered = null)
@@ -183,7 +185,8 @@ public function getPrepareType()
}
/**
- * @param $name
+ * @param string $name
+ * @param mixed $type
* @return string
*/
public function formatParameterName($name, $type = null)
2  library/Zend/Db/Adapter/Driver/Mysqli/Statement.php
View
@@ -236,8 +236,6 @@ public function execute($parameters = null)
/**
* Bind parameters from container
- *
- * @param ParameterContainer $pContainer
*/
protected function bindParametersFromContainer()
{
3  library/Zend/Db/Adapter/Driver/Pdo/Connection.php
View
@@ -353,7 +353,8 @@ public function prepare($sql)
/**
* Get last generated id
*
- * @return integer
+ * @param string $name
+ * @return integer|null|false
*/
public function getLastGeneratedValue($name = null)
{
10 library/Zend/Db/Adapter/Driver/Pdo/Pdo.php
View
@@ -10,6 +10,7 @@
namespace Zend\Db\Adapter\Driver\Pdo;
+use PDOStatement;
use Zend\Db\Adapter\Driver\DriverInterface;
use Zend\Db\Adapter\Driver\Feature\AbstractFeature;
use Zend\Db\Adapter\Driver\Feature\DriverFeatureInterface;
@@ -51,6 +52,7 @@ class Pdo implements DriverInterface, DriverFeatureInterface
* @param array|Connection|\PDO $connection
* @param null|Statement $statementPrototype
* @param null|Result $resultPrototype
+ * @param string $features
*/
public function __construct($connection, Statement $statementPrototype = null, Result $resultPrototype = null, $features = self::FEATURES_DEFAULT)
{
@@ -107,8 +109,8 @@ public function registerResultPrototype(Result $resultPrototype)
}
/**
- * @param string|AbstractFeature $nameOrFeature
- * @param mixed $value
+ * @param string $name
+ * @param AbstractFeature $feature
* @return Pdo
*/
public function addFeature($name, $feature)
@@ -193,7 +195,7 @@ public function getConnection()
}
/**
- * @param string $sql
+ * @param string|PDOStatement $sqlOrResource
* @return Statement
*/
public function createStatement($sqlOrResource = null)
@@ -201,7 +203,7 @@ public function createStatement($sqlOrResource = null)
$statement = clone $this->statementPrototype;
if (is_string($sqlOrResource)) {
$statement->setSql($sqlOrResource);
- } elseif ($sqlOrResource instanceof \PDOStatement) {
+ } elseif ($sqlOrResource instanceof PDOStatement) {
$statement->setResource($sqlOrResource);
}
$statement->initialize($this->connection->getResource());
2  library/Zend/Db/Adapter/Driver/Pdo/Result.php
View
@@ -75,6 +75,8 @@ class Result implements Iterator, ResultInterface
* Initialize
*
* @param PDOStatement $resource
+ * @param $generatedValue
+ * @param int $rowCount
* @return Result
*/
public function initialize(PDOStatement $resource, $generatedValue, $rowCount = null)
2  library/Zend/Db/Adapter/Driver/Pdo/Statement.php
View
@@ -224,8 +224,6 @@ public function execute($parameters = null)
/**
* Bind parameters from container
- *
- * @param ParameterContainer $container
*/
protected function bindParametersFromContainer()
{
5 library/Zend/Db/Adapter/Driver/Pgsql/Connection.php
View
@@ -10,6 +10,7 @@
namespace Zend\Db\Adapter\Driver\Pgsql;
+use mysqli;
use Zend\Db\Adapter\Driver\ConnectionInterface;
use Zend\Db\Adapter\Exception;
@@ -47,13 +48,13 @@ class Connection implements ConnectionInterface
/**
* Constructor
*
- * @param mysqli $connectionInfo
+ * @param mysqli|array|null $connectionInfo
*/
public function __construct($connectionInfo = null)
{
if (is_array($connectionInfo)) {
$this->setConnectionParameters($connectionInfo);
- } elseif ($connectionInfo instanceof \mysqli) {
+ } elseif ($connectionInfo instanceof mysqli) {
$this->setResource($connectionInfo);
}
}
9 library/Zend/Db/Adapter/Driver/Pgsql/Pgsql.php
View
@@ -46,6 +46,7 @@ class Pgsql implements DriverInterface
* @param array|Connection|resource $connection
* @param null|Statement $statementPrototype
* @param null|Result $resultPrototype
+ * @param array $options
*/
public function __construct($connection, Statement $statementPrototype = null, Result $resultPrototype = null, $options = null)
{
@@ -122,7 +123,8 @@ public function getConnection()
}
/**
- * @return StatementInterface
+ * @param string|null $sqlOrResource
+ * @return Statement
*/
public function createStatement($sqlOrResource = null)
{
@@ -147,7 +149,7 @@ public function createStatement($sqlOrResource = null)
}
/**
- * @return ResultInterface
+ * @return Result
*/
public function createResult($resource)
{
@@ -165,7 +167,8 @@ public function getPrepareType()
}
/**
- * @param $name
+ * @param string $name
+ * @param mixed $type
* @return string
*/
public function formatParameterName($name, $type = null)
2  library/Zend/Db/Adapter/Driver/Pgsql/Statement.php
View
@@ -153,7 +153,7 @@ public function isPrepared()
/**
* @param null $parameters
- * @return ResultInterface
+ * @return Result
*/
public function execute($parameters = null)
{
1  library/Zend/Db/Adapter/Driver/Sqlsrv/Connection.php
View
@@ -301,6 +301,7 @@ public function prepare($sql)
/**
* Get last generated id
*
+ * @param string $name

string|null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
* @return mixed
*/
public function getLastGeneratedValue($name = null)
5 library/Zend/Db/Adapter/Driver/Sqlsrv/Result.php
View
@@ -51,6 +51,7 @@ class Result implements \Iterator, ResultInterface
* Initialize
*
* @param resource $resource
+ * @param mixed $generatedValue
* @return Result
*/
public function initialize($resource, $generatedValue = null)
@@ -107,7 +108,7 @@ public function next()
/**
* Load
*
- * @param string $row
+ * @param int $row
Ben Scholzen Collaborator
DASPRiD added a note

I'd say this should be "integer", as we use full type names everywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
* @return mixed
*/
protected function load($row = SQLSRV_SCROLL_NEXT)
@@ -115,7 +116,7 @@ protected function load($row = SQLSRV_SCROLL_NEXT)
$this->currentData = sqlsrv_fetch_array($this->resource, SQLSRV_FETCH_ASSOC, $row);
$this->currentComplete = true;
$this->position++;
- return ($this->currentData);
+ return $this->currentData;
Matthew Weier O'Phinney Owner

This changes the value returned from a boolean to a value. Please revert.

Maks3w Collaborator
Maks3w added a note
function test() {
    return 1;
}
function test2() {
    return (1);
}

function test3() {
    return (bool) 1;
}

var_dump(test());
var_dump(test2());
var_dump(test3());

int(1)
int(1)
bool(true)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
}
/**
10 library/Zend/Db/Adapter/Driver/Sqlsrv/Sqlsrv.php
View
@@ -10,6 +10,7 @@
namespace Zend\Db\Adapter\Driver\Sqlsrv;
+use PDOStatement;
use Zend\Db\Adapter\Driver\DriverInterface;
use Zend\Db\Adapter\Exception;
@@ -120,7 +121,7 @@ public function getConnection()
}
/**
- * @param string $sql
+ * @param string|PDOStatement $sqlOrResource
* @return Statement
*/
public function createStatement($sqlOrResource = null)
@@ -128,7 +129,7 @@ public function createStatement($sqlOrResource = null)
$statement = clone $this->statementPrototype;
if (is_string($sqlOrResource)) {
$statement->setSql($sqlOrResource);
- } elseif ($sqlOrResource instanceof \PDOStatement) {
+ } elseif ($sqlOrResource instanceof PDOStatement) {
$statement->setResource($sqlOrResource);
}
$statement->initialize($this->connection->getResource());
@@ -136,7 +137,7 @@ public function createStatement($sqlOrResource = null)
}
/**
- * @param resource $result
+ * @param resource $resource
* @return Result
*/
public function createResult($resource)
@@ -155,7 +156,8 @@ public function getPrepareType()
}
/**
- * @param $name
+ * @param string $name
+ * @param mixed $type
* @return string
*/
public function formatParameterName($name, $type = null)
2  library/Zend/Db/Adapter/Driver/Sqlsrv/Statement.php
View
@@ -167,7 +167,7 @@ public function isPrepared()
* Execute
*
* @param array|ParameterContainer $parameters

null|array|ParameterContainer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
- * @return type
+ * @return Result
*/
public function execute($parameters = null)
{
153 library/Zend/Db/Metadata/Display/TextUi.php
View
@@ -1,153 +0,0 @@
-<?php
-/**
- * Zend Framework (http://framework.zend.com/)
- *
- * @link http://github.com/zendframework/zf2 for the canonical source repository
- * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- * @package Zend_Db
- */
-
-namespace Zend\Db\Metadata\Display;
-
-/**
- * @category Zend
- * @package Zend_Db
- * @subpackage Metadata
- */
-class TextUi
-{
-
- /**
- *
- * @var
- */
- protected $camelCaseFilter = null;
-
- /**
- * Render
- *
- * @param \Zend\Db\Metadata\Metadata $metadata
- * @return string
- */
- public function render(\Zend\Db\Metadata\Metadata $metadata)
- {
- $output = '';
- $output .= $this->renderTables($metadata->getTables());
- return $output;
- }
-
- /**
- * Render tables
- *
- * @param array $tables
- * @return string
- */
- public function renderTables(array $tables)
- {
- $output = '';
- foreach ($tables as $table) {
- $output .= $this->renderTable($table);
- }
- return $output;
- }
-
- /**
- * Render table
- *
- * @param \Zend\Db\Metadata\Table $table
- * @return string
- */
- public function renderTable(\Zend\Db\Metadata\Table $table)
- {
- $output = '';
- $output .= 'The \'' . $table->getName() . "' Table\n";
- $output .= $this->renderColumns($table->getColumnCollection()) . "\n";
- $output .= $this->renderConstraints($table->getConstraintCollection()) . "\n\n";
- return $output;
- }
-
- /**
- * Render columns
- *
- * @param \Zend\Db\Metadata\ColumnCollection $columnCollection
- * @return string
- */
- public function renderColumns(\Zend\Db\Metadata\ColumnCollection $columnCollection)
- {
- $columnAttributes = array(
- array('name', 'Name', 12),
- array('ordinalPosition', "Ordinal\nPosition", 10),
- array('columnDefault', "Column\nDefault", 8),
- array('isNullable', "Is\nNullable", 9),
- array('dataType', "Data\nType", 8),
- array('characterMaximumLength', "Chr. Max\nLength", 10),
- array('characterOctetLength', "Chr. Octet\nLength", 11),
- array('numericPrecision', "Num\nPrecision", 10),
- array('numericScale', "Num\nScale", 6),
- array('characterSetName', "Charset\nName", 8),
- array('collationName', "Collation\nName", 12),
- );
-
- $rows = $rowWidths = array();
- // make header
- foreach ($columnAttributes as $cAttrIndex => $cAttrData) {
- list($cAttrName, $cAttrDisplayName, $cAttrDefaultLength) = $cAttrData;
- $row[$cAttrIndex] = $cAttrDisplayName;
- $rowWidths[$cAttrIndex] = $cAttrDefaultLength; // default width
- }
-
- $rows[] = $row;
-
- foreach ($columnCollection as $columnMetadata) {
- $row = array();
- foreach ($columnAttributes as $cAttrIndex => $cAttrData) {
- list($cAttrName, $cAttrDisplayName, $cAttrDefaultLength) = $cAttrData;
- $value = $columnMetadata->{'get' . $cAttrName}();
- if (strlen($value) > $rowWidths[$cAttrIndex]) {
- $rowWidths[$cAttrIndex] = strlen($value);
- }
- $row[$cAttrIndex] = (string) $value;
- }
- $rows[] = $row;
- }
-
- $table = new \Zend\Text\Table\Table(array(
- 'columnWidths' => $rowWidths,
- 'decorator' => 'ascii'
- ));
- foreach ($rows as $row) {
- $table->appendRow($row);
- }
-
- return 'Columns' . PHP_EOL . $table->render();
- }
-
- /**
- * Render constraints
- *
- * @param \Zend\Db\Metadata\ConstraintCollection $constraints
- * @return string
- */
- public function renderConstraints(\Zend\Db\Metadata\ConstraintCollection $constraints)
- {
- $rows = array();
- foreach ($constraints as $constraint) {
- $row = array();
- $row[] = $constraint->getName();
- $row[] = $constraint->getType();
- $rows[] = $row;
- }
-
- $table = new \Zend\Text\Table\Table(array(
- 'columnWidths' => array(25, 25),
- 'decorator' => 'ascii'
- ));
- foreach ($rows as $row) {
- $table->appendRow($row);
- }
-
- return 'Constraints: ' . PHP_EOL . $table->render();
- }
-
-}
9 library/Zend/Db/Metadata/Metadata.php
View
@@ -71,6 +71,7 @@ protected function createSourceFromAdapter(Adapter $adapter)
* Get base tables and views
*
* @param string $schema
+ * @param bool $includeViews
* @return Object\TableObject[]
*/
public function getTables($schema = null, $includeViews = false)
@@ -93,7 +94,6 @@ public function getViews($schema = null)
* Get triggers
*
* @param string $schema
- * @param string $database
* @return array
*/
public function getTriggers($schema = null)
@@ -106,7 +106,6 @@ public function getTriggers($schema = null)
*
* @param string $table
* @param string $schema
- * @param string $database
* @return array
*/
public function getConstraints($table, $schema = null)
@@ -119,7 +118,6 @@ public function getConstraints($table, $schema = null)
*
* @param string $table
* @param string $schema
- * @param string $database
* @return array
*/
public function getColumns($table, $schema = null)
@@ -133,7 +131,6 @@ public function getColumns($table, $schema = null)
* @param string $constraint
* @param string $table
* @param string $schema
- * @param string $database
* @return array
*/
public function getConstraintKeys($constraint, $table, $schema = null)
@@ -147,7 +144,6 @@ public function getConstraintKeys($constraint, $table, $schema = null)
* @param string $constraintName
* @param string $table
* @param string $schema
- * @param string $database
* @return Object\ConstraintObject
*/
public function getConstraint($constraintName, $table, $schema = null)
@@ -167,7 +163,7 @@ public function getSchemas()
* Get table names
*
* @param string $schema
- * @param string $database
+ * @param bool $includeViews
* @return array
*/
public function getTableNames($schema = null, $includeViews = false)
@@ -180,7 +176,6 @@ public function getTableNames($schema = null, $includeViews = false)
*
* @param string $tableName
* @param string $schema
- * @param string $database
* @return Object\TableObject
*/
public function getTable($tableName, $schema = null)
19 library/Zend/Db/Metadata/Object/ColumnObject.php
View
@@ -182,7 +182,7 @@ public function getOrdinalPosition()
/**
* @param int $ordinalPosition to set
- * @return Column
+ * @return ColumnObject
*/
public function setOrdinalPosition($ordinalPosition)
{
@@ -191,7 +191,7 @@ public function setOrdinalPosition($ordinalPosition)
}
/**
- * @return the $columnDefault
+ * @return null|string the $columnDefault
*/
public function getColumnDefault()
{
@@ -235,7 +235,7 @@ public function isNullable()
}
/**
- * @return the $dataType
+ * @return null|string the $dataType
*/
public function getDataType()
{
@@ -253,7 +253,7 @@ public function setDataType($dataType)
}
/**
- * @return the $characterMaximumLength
+ * @return int|null the $characterMaximumLength
*/
public function getCharacterMaximumLength()
{
@@ -271,7 +271,7 @@ public function setCharacterMaximumLength($characterMaximumLength)
}
/**
- * @return the $characterOctetLength
+ * @return int|null the $characterOctetLength
*/
public function getCharacterOctetLength()
{
@@ -351,7 +351,7 @@ public function isNumericUnsigned()
}
/**
- * @return the $errata
+ * @return array the $errata
*/
public function getErratas()
{
@@ -359,7 +359,8 @@ public function getErratas()
}
/**
- * @return the $errata
+ * @param array $erratas
+ * @return ColumnObject
*/
public function setErratas(array $erratas)
{
@@ -371,7 +372,7 @@ public function setErratas(array $erratas)
/**
* @param string $errataName
- * @return ColumnMetadata
+ * @return mixed
*/
public function getErrata($errataName)
{
@@ -384,7 +385,7 @@ public function getErrata($errataName)
/**
* @param string $errataName
* @param mixed $errataValue
- * @return ColumnMetadata
+ * @return ColumnObject
*/
public function setErrata($errataName, $errataValue)
{
4 library/Zend/Db/Metadata/Object/ConstraintObject.php
View
@@ -102,7 +102,7 @@ class ConstraintObject
* Constructor
*
* @param string $name
- * @param string $table
+ * @param string $tableName
* @param string $schemaName

same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
*/
public function __construct($name, $tableName, $schemaName = null)
@@ -177,7 +177,7 @@ public function setTableName($tableName)
/**
* Set type
*
- * @param type $constraintType
+ * @param string $type
*/
public function setType($type)
{
2  library/Zend/Db/Metadata/Source/AbstractSource.php
View
@@ -67,6 +67,7 @@ public function getSchemas()
* Get table names
*
* @param string $schema
+ * @param bool $includeViews

same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
* @return string[]
*/
public function getTableNames($schema = null, $includeViews = false)
@@ -95,6 +96,7 @@ public function getTableNames($schema = null, $includeViews = false)
* Get tables
*
* @param string $schema
+ * @param bool $includeViews

same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
* @return Object\TableObject[]
*/
public function getTables($schema = null, $includeViews = false)
3  library/Zend/Db/ResultSet/ResultSet.php
View
@@ -47,7 +47,8 @@ class ResultSet extends AbstractResultSet
/**
* Constructor
*
- * @param null|ArrayObject $arrayObjectPrototype
+ * @param string $returnType
+ * @param null|ArrayObject $arrayObjectPrototype

I think ArrayObject could be a type-hint ?

Maks3w Collaborator
Maks3w added a note

if you see setArrayObjectPrototype there is the possibility of pass a non ArrayObject as argument

Matthew Weier O'Phinney Owner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
*/
public function __construct($returnType = self::TYPE_ARRAYOBJECT, $arrayObjectPrototype = null)
{
7 library/Zend/Db/RowGateway/AbstractRowGateway.php
View
@@ -97,8 +97,9 @@ public function initialize()
/**
* Populate Data
*
- * @param array $currentData
- * @return RowGateway
+ * @param array $rowData
+ * @param bool $rowExistsInDatabase
+ * @return AbstractRowGateway
*/
public function populate(array $rowData, $rowExistsInDatabase = false)
{
@@ -253,7 +254,7 @@ public function offsetSet($offset, $value)
* Offset unset
*
* @param string $offset
- * @return RowGateway
+ * @return AbstractRowGateway
*/
public function offsetUnset($offset)
{
2  library/Zend/Db/Sql/Delete.php
View
@@ -64,7 +64,6 @@ class Delete extends AbstractSql implements SqlInterface, PreparableSqlInterface
* Constructor
*
* @param null|string $table
- * @param null|string $schema
*/
public function __construct($table = null)
{
@@ -78,7 +77,6 @@ public function __construct($table = null)
* Create from statement
*
* @param string $table
- * @param null|string $schema
* @return Delete
*/
public function from($table)
2  library/Zend/Db/Sql/Insert.php
View
@@ -55,7 +55,6 @@ class Insert extends AbstractSql implements SqlInterface, PreparableSqlInterface
* Constructor
*
* @param null|string $table
- * @param null|string $schema
*/
public function __construct($table = null)
{
@@ -68,7 +67,6 @@ public function __construct($table = null)
* Crete INTO clause
*
* @param string $table
- * @param null|string $databaseOrSchema
* @return Insert
*/
public function into($table)
4 library/Zend/Db/Sql/Predicate/Between.php
View
@@ -26,8 +26,8 @@ class Between implements PredicateInterface
* Constructor
*
* @param string $identifier
- * @param string $minValue
- * @param string $maxValue
+ * @param int|float|string $minValue
+ * @param int|float|string $maxValue
*/
public function __construct($identifier = null, $minValue = null, $maxValue = null)
{
2  library/Zend/Db/Sql/Predicate/Expression.php
View
@@ -24,7 +24,7 @@ class Expression extends BaseExpression implements PredicateInterface
* Constructor
*
* @param string $expression
- * @param mixed $valueParameter
+ * @param int|float|bool|string|array $valueParameter
*/
public function __construct($expression = null, $valueParameter = null /*[, $valueParameter, ... ]*/)
{
20 library/Zend/Db/Sql/Predicate/Operator.php
View
@@ -49,11 +49,11 @@ class Operator implements PredicateInterface
/**
* Constructor
*
- * @param mixed $left
+ * @param int|float|bool|string $left
* @param string $operator
- * @param mixed $right
- * @param TYPE_IDENTIFIER|TYPE_VALUE $leftType
- * @param TYPE_IDENTIFIER|TYPE_VALUE $rightType
+ * @param int|float|bool|string $right
+ * @param string $leftType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_IDENTIFIER {@see allowedTypes}
+ * @param string $rightType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_VALUE {@see allowedTypes}
*/
public function __construct($left = null, $operator = self::OPERATOR_EQUAL_TO, $right = null, $leftType = self::TYPE_IDENTIFIER, $rightType = self::TYPE_VALUE)
{
@@ -81,7 +81,7 @@ public function __construct($left = null, $operator = self::OPERATOR_EQUAL_TO, $
/**
* Set left side of operator
*
- * @param scalar $left
+ * @param int|float|bool|string $left
* @return Operator
*/
public function setLeft($left)
@@ -93,7 +93,7 @@ public function setLeft($left)
/**
* Get left side of operator
*
- * @return scalar
+ * @return int|float|bool|string
*/
public function getLeft()
{
@@ -103,7 +103,7 @@ public function getLeft()
/**
* Set parameter type for left side of operator
*
- * @param TYPE_IDENTIFIER|TYPE_VALUE $type
+ * @param string $type TYPE_IDENTIFIER or TYPE_VALUE {@see allowedTypes}
* @return Operator
*/
public function setLeftType($type)
@@ -155,7 +155,7 @@ public function getOperator()
/**
* Set right side of operator
*
- * @param scalar $value
+ * @param int|float|bool|string $value
* @return Operator
*/
public function setRight($value)
@@ -167,7 +167,7 @@ public function setRight($value)
/**
* Get right side of operator
*
- * @return scalar
+ * @return int|float|bool|string
*/
public function getRight()
{
@@ -177,7 +177,7 @@ public function getRight()
/**
* Set parameter type for right side of operator
*
- * @param TYPE_IDENTIFIER|TYPE_VALUE $type
+ * @param string $type TYPE_IDENTIFIER or TYPE_VALUE {@see allowedTypes}
* @return Operator
*/
public function setRightType($type)
56 library/Zend/Db/Sql/Predicate/Predicate.php
View
@@ -29,7 +29,7 @@ class Predicate extends PredicateSet
/**
* Begin nesting predicates
*
- * @return PredicateSet
+ * @return Predicate
*/
public function nest()
{
@@ -72,10 +72,10 @@ public function unnest()
*
* Utilizes Operator predicate
*
- * @param scalar $left
- * @param scalar $right
- * @param TYPE_IDENTIFIER|TYPE_VALUE $leftType
- * @param TYPE_IDENTIFIER|TYPE_VALUE $rightType
+ * @param int|float|bool|string $left
+ * @param int|float|bool|string $right
+ * @param string $leftType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_IDENTIFIER {@see allowedTypes}
+ * @param string $rightType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_VALUE {@see allowedTypes}
* @return Predicate
*/
public function equalTo($left, $right, $leftType = self::TYPE_IDENTIFIER, $rightType = self::TYPE_VALUE)
@@ -94,10 +94,10 @@ public function equalTo($left, $right, $leftType = self::TYPE_IDENTIFIER, $right
*
* Utilizes Operator predicate
*
- * @param scalar $left
- * @param scalar $right
- * @param TYPE_IDENTIFIER|TYPE_VALUE $leftType
- * @param TYPE_IDENTIFIER|TYPE_VALUE $rightType
+ * @param int|float|bool|string $left
+ * @param int|float|bool|string $right
+ * @param string $leftType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_IDENTIFIER {@see allowedTypes}
+ * @param string $rightType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_VALUE {@see allowedTypes}
* @return Predicate
*/
public function notEqualTo($left, $right, $leftType = self::TYPE_IDENTIFIER, $rightType = self::TYPE_VALUE)
@@ -116,10 +116,10 @@ public function notEqualTo($left, $right, $leftType = self::TYPE_IDENTIFIER, $ri
*
* Utilizes Operator predicate
*
- * @param scalar $left
- * @param scalar $right
- * @param TYPE_IDENTIFIER|TYPE_VALUE $leftType
- * @param TYPE_IDENTIFIER|TYPE_VALUE $rightType
+ * @param int|float|bool|string $left
+ * @param int|float|bool|string $right
+ * @param string $leftType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_IDENTIFIER {@see allowedTypes}
+ * @param string $rightType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_VALUE {@see allowedTypes}
* @return Predicate
*/
public function lessThan($left, $right, $leftType = self::TYPE_IDENTIFIER, $rightType = self::TYPE_VALUE)
@@ -138,10 +138,10 @@ public function lessThan($left, $right, $leftType = self::TYPE_IDENTIFIER, $righ
*
* Utilizes Operator predicate
*
- * @param scalar $left
- * @param scalar $right
- * @param TYPE_IDENTIFIER|TYPE_VALUE $leftType
- * @param TYPE_IDENTIFIER|TYPE_VALUE $rightType
+ * @param int|float|bool|string $left
+ * @param int|float|bool|string $right
+ * @param string $leftType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_IDENTIFIER {@see allowedTypes}
+ * @param string $rightType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_VALUE {@see allowedTypes}
* @return Predicate
*/
public function greaterThan($left, $right, $leftType = self::TYPE_IDENTIFIER, $rightType = self::TYPE_VALUE)
@@ -160,10 +160,10 @@ public function greaterThan($left, $right, $leftType = self::TYPE_IDENTIFIER, $r
*
* Utilizes Operator predicate
*
- * @param scalar $left
- * @param scalar $right
- * @param TYPE_IDENTIFIER|TYPE_VALUE $leftType
- * @param TYPE_IDENTIFIER|TYPE_VALUE $rightType
+ * @param int|float|bool|string $left
+ * @param int|float|bool|string $right
+ * @param string $leftType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_IDENTIFIER {@see allowedTypes}
+ * @param string $rightType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_VALUE {@see allowedTypes}
* @return Predicate
*/
public function lessThanOrEqualTo($left, $right, $leftType = self::TYPE_IDENTIFIER, $rightType = self::TYPE_VALUE)
@@ -182,10 +182,10 @@ public function lessThanOrEqualTo($left, $right, $leftType = self::TYPE_IDENTIFI
*
* Utilizes Operator predicate
*
- * @param scalar $left
- * @param scalar $right
- * @param TYPE_IDENTIFIER|TYPE_VALUE $leftType
- * @param TYPE_IDENTIFIER|TYPE_VALUE $rightType
+ * @param int|float|bool|string $left
+ * @param int|float|bool|string $right
+ * @param string $leftType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_IDENTIFIER {@see allowedTypes}
+ * @param string $rightType TYPE_IDENTIFIER or TYPE_VALUE by default TYPE_VALUE {@see allowedTypes}
* @return Predicate
*/
public function greaterThanOrEqualTo($left, $right, $leftType = self::TYPE_IDENTIFIER, $rightType = self::TYPE_VALUE)
@@ -225,7 +225,7 @@ public function like($identifier, $like)
* Utilizes Like predicate
*
* @param string $literal
- * @param scalar|array $parameter
+ * @param int|float|bool|string|array $parameter
* @return Predicate
*/
public function literal($literal, $parameter)
@@ -303,8 +303,8 @@ public function in($identifier, $valueSet = null)
* Utilizes Between predicate
*
* @param string $identifier
- * @param scalar $minValue
- * @param scalar $maxValue
+ * @param int|float|string $minValue
+ * @param int|float|string $maxValue
* @return Predicate
*/
public function between($identifier, $minValue, $maxValue)
4 library/Zend/Db/Sql/PreparableSqlInterface.php
View
@@ -22,9 +22,9 @@
{
/**
- * @abstract
* @param Adapter $adapter
- * @return StatementContainerInterface
+ * @param StatementContainerInterface
+ * @return void
*/
public function prepareStatement(Adapter $adapter, StatementContainerInterface $statementContainer);
}
2  library/Zend/Db/Sql/Select.php
View
@@ -154,7 +154,6 @@ public function __construct($table = null)
* Create from clause
*
* @param string|array|TableIdentifier $table
- * @param null|string $schema
* @return Select
*/
public function from($table)
@@ -190,6 +189,7 @@ public function from($table)
* value can be string or Expression objects
*
* @param array $columns
+ * @param bool $prefixColumnsWithTable
* @return Select
*/
public function columns(array $columns, $prefixColumnsWithTable = true)
2  library/Zend/Db/Sql/Update.php
View
@@ -64,7 +64,6 @@ class Update extends AbstractSql implements SqlInterface, PreparableSqlInterface
* Constructor
*
* @param null|string $table
- * @param null|string $schema
*/
public function __construct($table = null)
{
@@ -78,7 +77,6 @@ public function __construct($table = null)
* Specify table for statement
*
* @param string $table
- * @param null|string $schema
* @return Update
*/
public function table($table)
3  library/Zend/Db/TableGateway/AbstractTableGateway.php
View
@@ -447,7 +447,8 @@ public function __get($property)
}
/**
- * @param $property
+ * @param string $property
+ * @param mixed $value
* @return mixed
* @throws Exception\InvalidArgumentException
*/
2  library/Zend/Db/TableGateway/Feature/EventFeature.php
View
@@ -12,7 +12,7 @@
use Zend\Db\Adapter\Driver\ResultInterface;
use Zend\Db\Adapter\Driver\StatementInterface;
-use Zend\Db\ResultSet\ResultSet;
+use Zend\Db\ResultSet\ResultSetInterface;
use Zend\Db\Sql\Delete;
use Zend\Db\Sql\Insert;
use Zend\Db\Sql\Select;
6 library/Zend/Db/TableGateway/Feature/EventFeature/TableGatewayEvent.php
View
@@ -33,7 +33,7 @@ class TableGatewayEvent implements EventInterface
protected $name = null;
/**
- * @var array
+ * @var array|\ArrayAccess
*/
protected $params = array();
@@ -60,7 +60,7 @@ public function getTarget()
/**
* Get parameters passed to the event
*
- * @return array|ArrayAccess
+ * @return array|\ArrayAccess
*/
public function getParams()
{
@@ -132,7 +132,7 @@ public function setParam($name, $value)
*/
public function stopPropagation($flag = true)
{
- return false;
+ return;
}
/**
2  library/Zend/Db/TableGateway/Feature/MetadataFeature.php
View
@@ -30,7 +30,7 @@ class MetadataFeature extends AbstractFeature
/**
* Constructor
*
- * @param Adapter $slaveAdapter
+ * @param MetadataInterface $metadata
*/
public function __construct(MetadataInterface $metadata = null)
{
4 library/Zend/Db/TableGateway/TableGateway.php
View
@@ -30,8 +30,8 @@ class TableGateway extends AbstractTableGateway
* @param string $table
* @param Adapter $adapter
* @param Feature\AbstractFeature|Feature\FeatureSet|Feature\AbstractFeature[] $features
- * @param ResultSetInterface $selectResultPrototype
- * @param Sql $selectResultPrototype
+ * @param ResultSetInterface $resultSetPrototype
+ * @param Sql $sql
*/
public function __construct($table, Adapter $adapter, $features = null, ResultSetInterface $resultSetPrototype = null, Sql $sql = null)
{
11 library/Zend/View/Helper/Navigation.php
View
@@ -171,10 +171,8 @@ public function getPluginManager()
* thrown if something goes
* wrong. Default is true.
* @return \Zend\View\Helper\Navigation\HelperInterface helper instance
- * @throws \Zend\Loader\PluginLoader\Exception if $strict is true and
+ * @throws Exception\RuntimeException if $strict is true and
* helper cannot be found
- * @throws Exception\InvalidArgumentException if $strict is true and
- * helper does not implement the specified interface
*/
public function findHelper($proxy, $strict = true)
{
@@ -334,11 +332,8 @@ public function getInjectTranslator()
* render. Default is to
* render the container
* registered in the helper.
- * @return string helper output
- * @throws \Zend\Loader\PluginLoader\Exception if helper cannot be found
- * @throws \Zend\View\Exception\ExceptionInterface if helper doesn't implement
- * the interface specified in
- * {@link findHelper()}
+ * @return string helper output
+ * @throws Exception\RuntimeException if helper cannot be found
*/
public function render($container = null)
{
Something went wrong with that request. Please try again.