PHP Classes

File: migration/1.0.1_to_1.1.0.md

Recommend this page to a friend!
  Classes of nvb   PHP Code Generator Software   migration/1.0.1_to_1.1.0.md   Download  
File: migration/1.0.1_to_1.1.0.md
Role: Auxiliary data
Content type: text/markdown
Description: Auxiliary data
Class: PHP Code Generator Software
Generate PHP code structures programatically
Author: By
Last change:
Date: 3 years ago
Size: 1,720 bytes
 

Contents

Class file image Download

steps

replace "ClassGenerator" with "InterfaceGenerator"

As seen in the interface example between version 1.0.1 and version 1.1.0, you have to replace the usage the "ClassGenerator" with the "InterfaceGenerator". Simple search for "markAsInterface" to spot the fitting places.

remove call of "markAsInterface"

The method call "markAsInterface" is not needed and available anymore since, remove it.

replace "addImplements" with "addExtends"

Using "implements" in an interface is not working (yes, this was a bug). Since an interface can have multiple extends, you have to change this call (second argument still is optional).

example

code in version 1.0.1

$interface->setDocumentation($documentationFactory->create());
$interface->setName('FooInterface');
$interface->setNamespace('My\\Example');
$interface->markAsInterface();
$interface->addImplements('BarInterface', true);
$method->setDocumentation($documentationFactory->create());
$method->setName('foo');
$method->markAsHasNoBody();
$method->markAsPublic();
$method->getDocumentation()
    ->setReturn('string');

code in version 1.1.0

$interface->setDocumentation($documentationFactory->create());
$interface->setName('FooInterface');
$interface->setNamespace('My\\Example');
$interface->addExtends('BarInterface', true);
$method->setDocumentation($documentationFactory->create());
$method->setName('foo');
$method->markAsHasNoBody();
$method->markAsPublic();
$method->getDocumentation()
    ->setReturn('string');