Skip to content

Commit 658692e

Browse files
committed
Adjustments as per code review.
1 parent d9d4d6f commit 658692e

File tree

5 files changed

+27
-3
lines changed

5 files changed

+27
-3
lines changed

src/Propel/Common/Config/Loader/FileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ protected function checkSupports($ext, $resource)
125125
}
126126

127127
if (!is_array($ext)) {
128-
throw new \InvalidArgumentException('$ext must string or string[]');
128+
throw new \InvalidArgumentException('$ext must be string or string[]');
129129
}
130130

131131
$supported = false;

src/Propel/Generator/Model/Database.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,11 @@ public function addTables(array $tables)
492492
}
493493
}
494494

495+
/**
496+
* @param \Propel\Generator\Model\Table $table
497+
*
498+
* @return void
499+
*/
495500
public function removeTable(Table $table)
496501
{
497502
if ($this->hasTable($table->getName(), true)) {

src/Propel/Runtime/Parser/AbstractParser.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ abstract public function fromArray($array, $rootKey = 'data');
4444
*/
4545
abstract public function toArray($data, $rootKey = 'data');
4646

47+
/**
48+
* @param array $data
49+
* @param string|null $rootKey
50+
*
51+
* @return string
52+
*/
4753
public function listFromArray($data, $rootKey = 'data')
4854
{
4955
return $this->fromArray($data, $rootKey);

src/Propel/Runtime/Parser/CsvParser.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class CsvParser extends AbstractParser
3636
* Converts data from an associative array to CSV.
3737
*
3838
* @param array $array Source data to convert
39-
* @param string $rootKey Will not be used for converting because csv is flat
39+
* @param string|null $rootKey Will not be used for converting because csv is flat
4040
* @param boolean $isList Whether the input data contains more than one row
4141
* @param boolean $includeHeading Whether the output should contain a heading line
4242
*
@@ -62,6 +62,12 @@ public function fromArray($array, $rootKey = null, $isList = false, $includeHead
6262
return implode($this->lineTerminator, $rows) . $this->lineTerminator;
6363
}
6464

65+
/**
66+
* @param array $array
67+
* @param string|null $rootKey
68+
*
69+
* @return string
70+
*/
6571
public function listFromArray($array, $rootKey = null)
6672
{
6773
return $this->fromArray($array, $rootKey, true);

src/Propel/Runtime/Parser/XmlParser.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,19 @@ public function fromArray($array, $rootKey = 'data', $charset = null)
3434
return $rootNode->ownerDocument->saveXML();
3535
}
3636

37+
/**
38+
* @param array $array
39+
* @param string|null $rootKey
40+
* @param string|null $charset
41+
*
42+
* @return string
43+
*/
3744
public function listFromArray($array, $rootKey = 'data', $charset = null)
3845
{
3946
$rootNode = $this->getRootNode($rootKey);
4047
$this->arrayToDOM($array, $rootNode, $charset);
4148

42-
return $rootNode->ownerDocument->saveXML();
49+
return (string)$rootNode->ownerDocument->saveXML();
4350
}
4451

4552
/**

0 commit comments

Comments
 (0)