Skip to content

Commit

Permalink
Release data type requirements
Browse files Browse the repository at this point in the history
task: #28
  • Loading branch information
dschoenbauer committed Sep 11, 2018
1 parent 08cee3f commit 6d9ca4a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Sql/Command/Select.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Select extends AbstractCommand

private $table;
private $fields = ['*'];
private $data = [];
private $data = null;
private $fetchStyle = \PDO::FETCH_ASSOC;
private $fetchFlat = false;
private $defaultValue = [];
Expand Down Expand Up @@ -159,11 +159,11 @@ public function getSql()

/**
* acts as a cache to house ran queries
* @param array $data data to be stored
* @param mixed $data data to be stored
* @return Select for method chaining
* @since v1.0.0
*/
public function setData(array $data)
public function setData($data)
{
$this->data = $data;
return $this;
Expand Down
4 changes: 3 additions & 1 deletion tests/src/Sql/Command/SelectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@ public function testDefaultValueConstructor()

public function testData()
{
$this->assertEquals([], $this->_object->getData());
$this->assertEquals(null, $this->_object->getData());
$this->assertEquals(['id', 'name'], $this->_object->setData(['id', 'name'])->getData());
$this->assertEquals(false, $this->_object->setData(false)->getData());
$this->assertEquals('test', $this->_object->setData('test')->getData());
}

public function testSql()
Expand Down

0 comments on commit 6d9ca4a

Please sign in to comment.