Issues

ZF-8849: PHP Notice: Undefined variable: type in Zend/CodeGenerator/Php/Property/DefaultValue.php on line 113

Issue Type: Bug Created: 2010-01-17T11:06:16.000+0000 Last Updated: 2010-04-24T04:09:09.000+0000 Status: Resolved Fix version(s): - 1.10.4 (28/Apr/10)

Reporter: Paul Seiffert (powl) Assignee: Jan Pieper (jpieper) Tags: - Zend_CodeGenerator

Related issues: Attachments:

Description

Hi everybody,

I think I've found a bug in Zend/CodeGenerator/Php/Property/DefaultValue.php: Shouldn't the method isValidConstantType look like this:

<pre class="highlight">
    public function isValidConstantType()
    {
        if ($this->_type == self::TYPE_AUTO) {
            $type = $this->_getAutoDeterminedType($this->_value);
        } else {
            $type = $this->_type;
        }

        // valid types for constants
        $scalarTypes = array(
            self::TYPE_BOOLEAN,
            self::TYPE_BOOL,
            self::TYPE_NUMBER,
            self::TYPE_INTEGER,
            self::TYPE_INT,
            self::TYPE_FLOAT,
            self::TYPE_DOUBLE,
            self::TYPE_STRING,
            self::TYPE_CONSTANT,
            self::TYPE_NULL
            );

        return in_array($type, $scalarTypes);
    }

Sorry if not all line breaks are correctly, copy&paste did not work that good this time...

Best regards,

Paul

Comments

Posted by Jan Pieper (jpieper) on 2010-04-24T04:07:58.000+0000

Fixed in r21979.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts