Skip to content

Commit d9c16dd

Browse files
Merge pull request #65 from lisachenko/feature/interface-inheritance
Add an bility to define inheritance for interfaces
2 parents 51f1d74 + 47c256f commit d9c16dd

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

include/interface.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,18 @@ class Interface : private ClassBase
4141
// return self
4242
return *this;
4343
}
44-
44+
45+
/**
46+
* Extends exisiting PHP interface
47+
*
48+
* Note that the interface that you supply must already exist! Therefore
49+
* you can only supply interfaces that you created in your own extension.
50+
*
51+
* @param interface Interface object
52+
* @return Interface Same object to allow chaining
53+
*/
54+
Interface &extends(const Interface &interface) { ClassBase::implements(interface); return *this; }
55+
4556
/**
4657
* The namespace needs to have access to the private ClassBase base
4758
* class, to actually register the interface.

0 commit comments

Comments
 (0)