Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Zend\Code\Generator\FileGenerator problem #4747

Closed
Makar188 opened this issue Jun 29, 2013 · 1 comment
Closed

Zend\Code\Generator\FileGenerator problem #4747

Makar188 opened this issue Jun 29, 2013 · 1 comment
Assignees
Labels
Milestone

Comments

@Makar188
Copy link

I have test class

test_class.php

<?php

use Zend\Mvc\Controller\AbstractActionController;

class Test extends AbstractActionController {

    const test = 'test';

    public function test()  { return 1 + 1;  }
    public function remove() {  return 1 + 1; }
    public function exists() { return self::test; }
}

and this code

$g = new \Zend\Code\Generator\FileGenerator();
$g = $g->fromReflectedFileName(getcwd() . '/public/test_class.php');
$g->setFilename(getcwd() . '/public/result_class.php');
$g->getClass()->addMethod('added');
$g->write();

result

use Zend\Mvc\Controller\AbstractActionController;

class Test extends Zend\Mvc\Controller\AbstractActionController
{

    public function added()
    {
    }


}


<?php

use Zend\Mvc\Controller\AbstractActionController;

/* Zend_Code_Generator_Php_File-ClassMarker: {Test} */
@Ocramius
Copy link
Member

Handled in #6302

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants