When injecting a factory for a class without a namespace the generator creates a factory with an empty namespace.
<?php
namespace Vendor\ModuleName;
class MyClass {
protected $akismetFactory;
public function __construct(\Zend_Service_AkismetFactory $akismetFactory){
$this->akismetFactory = $akismetFactory;
}
<?php
/**
* Factory class for @see \Zend_Service_Akismet
*/
class Zend_Service_AkismetFactory
{
<?php
namespace ;
/**
* Factory class for @see \Zend_Service_Akismet
*/
class Zend_Service_AkismetFactory
{
Please, use namespaces as best practice.
The class "Zend_Service_Akismet" (as an example) is part of the magento fork of zend-framework (https://github.com/magento/zf1/blob/master/library/Zend/Service/Akismet.php).
Does that mean that i should not create a factory for a zf1 components?
Most helpful comment
The class "Zend_Service_Akismet" (as an example) is part of the magento fork of zend-framework (https://github.com/magento/zf1/blob/master/library/Zend/Service/Akismet.php).
Does that mean that i should not create a factory for a zf1 components?