Thanks to visit codestin.com
Credit goes to github.com

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

Zend\Code\Generator\FileGenerator problem #4747

@Makar188

Description

@Makar188

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} */

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions