ZF-12185: Zend/EventManager exceptions are not valid PHP 5.2

Issue Type: Bug Created: 2012-05-02T16:43:00.000+0000 Last Updated: 2012-05-06T00:24:51.000+0000 Status: Resolved Fix version(s): - 1.12.0 (27/Aug/12)

Reporter: Martin Hujer (mhujer) Assignee: Adam Lundrigan (adamlundrigan) Tags: - FixForZF1.12

Related issues: Attachments: - ZF-12185.patch



<pre class="highlight">
namespace Zend\EventManager\Exception;
use Zend\EventManager\Exception;


<pre class="highlight">
+    /**
+     * @expectedException Zend_EventManager_Exception_InvalidArgumentException
+     */
+    public function testExpectedExceptions1()
+    {
+        $this->events->attach('');
+    }

PHP 5.2 output: PHP Parse error: syntax error, unexpected T_STRING in I:\xampp\zf\library\Zend\EventManager\Exception\InvalidArgumentException.php on line 24

However, is is probably broken even for PHP 5.3. PHP 5.3 output: Fatal error: Interface 'Zend\EventManager\Exception' not found in I:\xampp\zf\library\Zend\EventManager\Exception\InvalidArgumentException.php on line 38

//and can't choose EventManager as a component here in issue tracker - Zend_EventManager is not a valid component.


Posted by Adam Lundrigan (adamlundrigan) on 2012-05-03T18:44:53.000+0000

A quick grep of the source code shows a few namespace/use calls still exist:

<pre class="highlight">
[adam@zfdev library/Zend/EventManager]$ find . -type f | xargs grep -in -- "Zend\\\\"
./Exception/InvalidArgumentException.php:24:namespace Zend\EventManager\Exception;
./Exception/InvalidArgumentException.php:26:use Zend\EventManager\Exception;
./Exception.php:24:namespace Zend\EventManager;

Posted by Adam Lundrigan (adamlundrigan) on 2012-05-03T18:55:56.000+0000

Attached patch should resolve this issue.

Posted by Adam Lundrigan (adamlundrigan) on 2012-05-06T00:24:51.000+0000

Fixed in trunk (1.12.0): r24765

Have you found an issue?

See the Overview section for more details.


© 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.