Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/Adapter/AdapterServiceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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)
{
Expand Down
5 changes: 4 additions & 1 deletion src/ResultSet/AbstractResultSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ abstract class AbstractResultSet implements Iterator, ResultSetInterface
protected $count = null;

/**
* @var Iterator|IteratorAggregate|ResultInterface
* @var Iterator|IteratorAggregate|ResultInterface|ArrayIterator
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ArrayIterator is not really needed - the interfaces cover that

Copy link
Author

@fadoe fadoe Aug 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, but it is not in my file at https://github.com/fadoe/zend-db/blob/feature/docblock/src/ResultSet/AbstractResultSet.php#L36
Do you know why it is here?

*/
protected $dataSource = null;

Expand Down Expand Up @@ -110,6 +110,9 @@ public function buffer()
return $this;
}

/**
* @return bool
*/
public function isBuffered()
{
if ($this->buffer === -1 || is_array($this->buffer)) {
Expand Down
9 changes: 4 additions & 5 deletions src/TableGateway/AbstractTableGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ public function isInitialized()
* Initialize
*
* @throws Exception\RuntimeException
* @return null
*/
public function initialize()
{
Expand Down Expand Up @@ -158,7 +157,7 @@ public function getFeatureSet()
/**
* Get select result prototype
*
* @return ResultSet
* @return ResultSetInterface
*/
public function getResultSetPrototype()
{
Expand All @@ -177,7 +176,7 @@ public function getSql()
* Select
*
* @param Where|\Closure|string|array $where
* @return ResultSet
* @return ResultSetInterface
*/
public function select($where = null)
{
Expand Down Expand Up @@ -211,7 +210,7 @@ public function selectWith(Select $select)

/**
* @param Select $select
* @return ResultSet
* @return ResultSetInterface
* @throws Exception\RuntimeException
*/
protected function executeSelect(Select $select)
Expand Down Expand Up @@ -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)
Expand Down
36 changes: 36 additions & 0 deletions src/TableGateway/TableGatewayInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,47 @@

namespace Zend\Db\TableGateway;

use Zend\Db\ResultSet\ResultSetInterface;
use Zend\Db\Sql\Where;

interface TableGatewayInterface
{
/**
* @return string
*/
public function getTable();

/**
* Select
*
* @param Where|\Closure|string|array $where
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can it still be null?

* @return ResultSetInterface
*/
public function select($where = null);

/**
* Insert
*
* @param array $set
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a description here

* @return int
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a description here (number of affected rows)

*/
public function insert($set);

/**
* Update
*
* @param array $set
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a description here

* @param string|array|\Closure $where
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can it still be null?

*
* @return int
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

description

*/
public function update($set, $where = null);

/**
* Delete
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, these one-word descriptions are not useful. Drop them overall unless there is something to clarify further

*
* @param Where|\Closure|string|array $where
* @return int
*/
public function delete($where);
}