color-schemes/build/resources/patterns/preview/preview.pattern
2014-02-12 21:22:37 +00:00

47 lines
3.0 KiB
Plaintext

<h1 style="background-color:{{ line_highlight }}; color: {{ foreground }};">{{ theme.name }}</h1>
<pre style="font-family:Monaco, monospace; padding:2em; background-color: {{ background }}; color: {{ foreground }};">
&lt;?php
<span style="color: {{ first }};">namespace</span> Illuminate\Container;
<span style="color: {{ first }};">use</span> Closure;
<span style="color: {{ first }};">use</span> ArrayAccess;
<span style="color: {{ comment }};">/**
* Theme: {{ theme.name }}
* {{ theme.description }}
*
* Copyright (c) {{ year }} {{ theme.author }}
*/</span>
<span style="color: {{ first }};">class</span> Container <span style="color: {{ second }};">implements</span> ArrayAccess
{
<span style="color: {{ comment }};">/**
* An array of the types that have been resolved.
*
* <span style="color: {{ docblock }};">@var</span> array
*/</span>
<span style="color: {{ second }};">protected</span> <span style="color: {{ variables }};">$resolved</span> <span style="color: {{ first }};">=</span> <span style="color: {{ fifth }};">array</span>();
<span style="color: {{ comment }};">/**
* Determine if a given type is shared.
*
* <span style="color: {{ docblock }};">@param</span> string $abstract
* <span style="color: {{ docblock }};">@return</span> bool
*/</span>
<span style="color: {{ second }};">public</span> <span style="color: {{ first }};">function</span> <span style="color: {{ third }};">isShared</span>(<span style="color: {{ variables }};">$abstract</span>)
{
<span style="color: {{ fourth }};">if</span> (<span style="color: {{ fifth }};">isset</span>(<span style="color: {{ variables }};">$this</span><span style="color: {{ fourth }};">-></span><span style="color: {{ variables }};">bindings</span>[<span style="color: {{ variables }};">$abstract</span>][<span style="color: {{ string }};">'shared'</span>]))
{
<span style="color: {{ variables }};">$shared</span> <span style="color: {{ fourth }};">=</span> <span style="color: {{ variables }};">$this</span><span style="color: {{ fourth }};">-></span><span style="color: {{ variables }};">bindings</span>[<span style="color: {{ variables }};">$abstract</span>][<span style="color: {{ string }};">'shared'</span>];
}
<span style="color: {{ fourth }};">else</span>
{
<span style="color: {{ variables }};">$shared</span> <span style="color: {{ fourth }};">=</span> <span style="color: {{ second }};">false</span>;
}
<span style="color: {{ fourth }};">return</span> <span style="color: {{ fifth }};">isset</span>(<span style="color: {{ variables }};">$this</span><span style="color: {{ fourth }};">-></span><span style="color: {{ variables }};">instances</span>[<span style="color: {{ variables }};">$abstract</span>]) <span style="color: {{ fourth }};">||</span> <span style="color: {{ variables }};">$shared</span> <span style="color: {{ fourth }};">===</span> <span style="color: {{ second }};">true</span>;
}
}
</pre>