diff --git a/src/Adapter/AdapterServiceFactory.php b/src/Adapter/AdapterServiceFactory.php index b57e7538ab..326e1184ca 100644 --- a/src/Adapter/AdapterServiceFactory.php +++ b/src/Adapter/AdapterServiceFactory.php @@ -10,6 +10,8 @@ namespace Zend\Db\Adapter; use Interop\Container\ContainerInterface; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\ServiceLocatorInterface; @@ -22,6 +24,8 @@ class AdapterServiceFactory implements FactoryInterface * @param string $requestedName * @param array $options * @return Adapter + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function __invoke(ContainerInterface $container, $requestedName, array $options = null) { diff --git a/src/Adapter/StatementContainerInterface.php b/src/Adapter/StatementContainerInterface.php index 30bb80ac36..c7e17dfe3b 100644 --- a/src/Adapter/StatementContainerInterface.php +++ b/src/Adapter/StatementContainerInterface.php @@ -14,15 +14,15 @@ interface StatementContainerInterface /** * Set sql * - * @param $sql - * @return mixed + * @param string $sql + * @return self */ public function setSql($sql); /** * Get sql * - * @return mixed + * @return string */ public function getSql(); @@ -30,14 +30,14 @@ public function getSql(); * Set parameter container * * @param ParameterContainer $parameterContainer - * @return mixed + * @return self */ public function setParameterContainer(ParameterContainer $parameterContainer); /** * Get parameter container * - * @return mixed + * @return ParameterContainer */ public function getParameterContainer(); } diff --git a/src/ResultSet/AbstractResultSet.php b/src/ResultSet/AbstractResultSet.php index 6bf2252bde..a6b55df844 100644 --- a/src/ResultSet/AbstractResultSet.php +++ b/src/ResultSet/AbstractResultSet.php @@ -110,6 +110,9 @@ public function buffer() return $this; } + /** + * @return bool + */ public function isBuffered() { if ($this->buffer === -1 || is_array($this->buffer)) { diff --git a/src/TableGateway/AbstractTableGateway.php b/src/TableGateway/AbstractTableGateway.php index 014c08eaa2..ca54948717 100644 --- a/src/TableGateway/AbstractTableGateway.php +++ b/src/TableGateway/AbstractTableGateway.php @@ -83,7 +83,6 @@ public function isInitialized() * Initialize * * @throws Exception\RuntimeException - * @return null */ public function initialize() { @@ -158,7 +157,7 @@ public function getFeatureSet() /** * Get select result prototype * - * @return ResultSet + * @return ResultSetInterface */ public function getResultSetPrototype() { @@ -177,7 +176,7 @@ public function getSql() * Select * * @param Where|\Closure|string|array $where - * @return ResultSet + * @return ResultSetInterface */ public function select($where = null) { @@ -211,7 +210,7 @@ public function selectWith(Select $select) /** * @param Select $select - * @return ResultSet + * @return ResultSetInterface * @throws Exception\RuntimeException */ protected function executeSelect(Select $select) @@ -350,7 +349,7 @@ public function update($set, $where = null, array $joins = null) } /** - * @param \Zend\Db\Sql\Update $update + * @param Update $update * @return int */ public function updateWith(Update $update) diff --git a/src/TableGateway/TableGatewayInterface.php b/src/TableGateway/TableGatewayInterface.php index 58c7759c3f..177e888343 100644 --- a/src/TableGateway/TableGatewayInterface.php +++ b/src/TableGateway/TableGatewayInterface.php @@ -9,11 +9,48 @@ namespace Zend\Db\TableGateway; +use Zend\Db\ResultSet\ResultSetInterface; +use Zend\Db\Sql\Where; + interface TableGatewayInterface { + /** + * Return the table name + * + * @return string + */ public function getTable(); + + /** + * Select values by conditions + * + * @param Where|\Closure|string|array|null $where + * @return ResultSetInterface + */ public function select($where = null); + + /** + * Insert values given by array + * + * @param array $set + * @return int number of affected rows + */ public function insert($set); + + /** + * Update values by condition + * + * @param array $set + * @param string|array|\Closure|null $where + * @return int number of affected rows + */ public function update($set, $where = null); + + /** + * Delete values by condition + * + * @param Where|\Closure|string|array $where + * @return int number of affected rows + */ public function delete($where); }