<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>The Componere\Patch class</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="componere-definition.getclosures.html">Componere\Definition::getClosures</a></div> <div class="next" style="text-align: right; float: right;"><a href="componere-patch.construct.html">Componere\Patch::__construct</a></div> <div class="up"><a href="book.componere.html">Componere</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="class.componere-patch" class="reference"> <h1 class="title">The Componere\Patch class</h1> <div class="partintro"><p class="verinfo">(Componere 2 >= 2.1.0)</p> <div class="section" id="componere-patch.intro"> <h2 class="title">Introduction</h2> <p class="para"> The Patch class allows the programmer to change the type of an instance at runtime without registering a new Definition </p> <p class="para"> When a Patch is destroyed it is reverted, so that instances that were patched during the lifetime of the Patch are restored to their formal type. </p> </div> <div class="section" id="componere-patch.synopsis"> <h2 class="title">Class synopsis</h2> <div class="classsynopsis"> <div class="ooclass"></div> <div class="classsynopsisinfo"> <span class="ooclass"> <span class="modifier">final</span> <strong class="classname">Componere\Patch</strong> </span> <span class="ooclass"> <span class="modifier">extends</span> <a href="class.componere-abstract-definition.html" class="classname">Componere\Abstract\Definition</a> </span> {</div> <div class="classsynopsisinfo classsynopsisinfo_comment">/* Constructors */</div> <div class="constructorsynopsis dc-description"> <span class="modifier">public</span> <span class="methodname"><a href="componere-patch.construct.html" class="methodname">__construct</a></span> ( <span class="methodparam"><span class="type">object</span> <code class="parameter">$instance</code></span> )</div> <div class="constructorsynopsis dc-description"> <span class="modifier">public</span> <span class="methodname"><a href="componere-patch.construct.html" class="methodname">__construct</a></span> ( <span class="methodparam"><span class="type">object</span> <code class="parameter">$instance</code></span> , <span class="methodparam"><span class="type">array</span> <code class="parameter">$interfaces</code></span> )</div> <div class="classsynopsisinfo classsynopsisinfo_comment">/* Methods */</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">void</span> <span class="methodname"><a href="componere-patch.apply.html" class="methodname">apply</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">void</span> <span class="methodname"><a href="componere-patch.revert.html" class="methodname">revert</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">bool</span> <span class="methodname"><a href="componere-patch.isapplied.html" class="methodname">isApplied</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">Patch</span> <span class="methodname"><a href="componere-patch.derive.html" class="methodname">derive</a></span> ( <span class="methodparam"><span class="type">object</span> <code class="parameter">$instance</code></span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">\Closure</span> <span class="methodname"><a href="componere-patch.getclosure.html" class="methodname">getClosure</a></span> ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">array</span> <span class="methodname"><a href="componere-patch.getclosures.html" class="methodname">getClosures</a></span> ( <span class="methodparam">void</span> )</div> <div class="classsynopsisinfo classsynopsisinfo_comment">/* Inherited methods */</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">Definition</span> <span class="methodname"><a href="componere-abstract-definition.addinterface.html" class="methodname">Componere\Abstract\Definition::addInterface</a></span> ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$interface</code></span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">Definition</span> <span class="methodname"><a href="componere-abstract-definition.addmethod.html" class="methodname">Componere\Abstract\Definition::addMethod</a></span> ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span> , <span class="methodparam"><span class="type"><span class="type \Componere\Method">\Componere\Method</span></span> <code class="parameter">$method</code></span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">Definition</span> <span class="methodname"><a href="componere-abstract-definition.addtrait.html" class="methodname">Componere\Abstract\Definition::addTrait</a></span> ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$trait</code></span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">\ReflectionClass</span> <span class="methodname"><a href="componere-abstract-definition.getreflector.html" class="methodname">Componere\Abstract\Definition::getReflector</a></span> ( <span class="methodparam">void</span> )</div> }</div> </div> </div> <h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="componere-patch.construct.html">Componere\Patch::__construct</a> — Patch Construction</li><li><a href="componere-patch.apply.html">Componere\Patch::apply</a> — Application</li><li><a href="componere-patch.revert.html">Componere\Patch::revert</a> — Reversal</li><li><a href="componere-patch.isapplied.html">Componere\Patch::isApplied</a> — State Detection</li><li><a href="componere-patch.derive.html">Componere\Patch::derive</a> — Patch Derivation</li><li><a href="componere-patch.getclosure.html">Componere\Patch::getClosure</a> — Get Closure</li><li><a href="componere-patch.getclosures.html">Componere\Patch::getClosures</a> — Get Closures</li></ul> </div> <hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="componere-definition.getclosures.html">Componere\Definition::getClosures</a></div> <div class="next" style="text-align: right; float: right;"><a href="componere-patch.construct.html">Componere\Patch::__construct</a></div> <div class="up"><a href="book.componere.html">Componere</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>