Better introduction content

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@344463 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Joe Watkins 2018-03-08 07:59:34 +00:00
parent 3ab38e2de5
commit 26a786694e

View file

@ -1,15 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<book xml:id="book.componere" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<book xml:id="book.componere" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns:xi="http://www.w3.org/2001/XInclude">
<title>Componere</title>
<titleabbrev>Componere</titleabbrev>
<preface xml:id="intro.componere">
&reftitle.intro;
<para>
Componere is able to compose classes at runtime, and monkey patch objects.
Componere <subscript>(latin, English: compose)</subscript> targets production environments and provides an API for
composition of classes, monkey patching, and casting.
</para>
<formalpara>
<title>Composition:</title>
<para>
<classname>Componere\Definition</classname> is used to define (or redefine) a class at runtime;
The class can then be registered, and in the case of redefinition it replaces the original class
for as long as the <classname>Componere\Definition</classname> exists.
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.componere-definition')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[not(@role='procedural')])" />
</para>
</formalpara>
<formalpara>
<title>Patching:</title>
<para>
<classname>Componere\Patch</classname> is used to change the class of a specific instance of an object at runtime;
Upon application the patch will remain applied for as long as the <classname>Componere\Patch</classname> exists, and can be reverted explicitly.
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.componere-patch')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[not(@role='procedural')])" />
</para>
</formalpara>
<formalpara>
<title>Casting:</title>
<para>
<classname>Componere\</classname> casting functions can cast among user defined compatible types;
Where compatible means <classname>Type</classname> is contravariant or covariant with the class of <parameter>object</parameter>.
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('componere.cast')/db:refsect1[@role='description']/descendant::db:methodsynopsis)" />
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('componere.cast_by_ref')/db:refsect1[@role='description']/descendant::db:methodsynopsis)" />
</para>
</formalpara>
</preface>
&reference.componere.setup;