fixed type-hinting in addDefaultMutator and added tests for it #768

Merged
merged 2 commits into from Nov 11, 2013

Projects

None yet

3 participants

Contributor
rvitaliy commented Oct 4, 2013

No description provided.

@willdurand willdurand commented on an outdated diff Oct 21, 2013
...estsuite/generator/builder/om/GeneratedObjectTest.php
+ $this->assertTrue(is_string($a->getFirstName()));
+
+
+ $a->clear();
+ $a->setFirstName($a2);
+ $this->assertTrue(is_string($a->getFirstName()));
+ $this->assertEquals($a->getFirstName(), (string)$a2);
+
+
+ $a->clear();
+ $a->setFirstName(true);
+ $this->assertTrue(is_string($a->getFirstName()));
+
+
+ /* php 5.4+ fail generate Notice: Array to string conversion
+ $a->clear();
@nibsirahsieu nibsirahsieu commented on an outdated diff Oct 21, 2013
generator/lib/builder/om/PHP5ObjectBuilder.php
@@ -1987,7 +1987,7 @@ protected function addDefaultMutator(&$script, Column $col)
// checking in mutators.
if ($col->isPhpPrimitiveType()) {
$script .= "
- if (\$v !== null && is_numeric(\$v)) {
nibsirahsieu
nibsirahsieu Oct 21, 2013 Contributor

the removal of is_numeric($v) will lead to another issue as described here #283

@willdurand willdurand merged commit 93f9fc8 into propelorm:master Nov 11, 2013

1 check passed

default The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment