47 lines
2.6 KiB
HTML
47 lines
2.6 KiB
HTML
<h1 style="background-color:#151515; color: #ffffff;">Carbonight Contrast</h1>
|
|
<pre style="font-family:Monaco, monospace; padding:2em; background-color: #000000; color: #ffffff;">
|
|
<?php
|
|
|
|
<span style="color: #C4C4C4;">namespace</span> Illuminate\Container;
|
|
|
|
<span style="color: #C4C4C4;">use</span> Closure;
|
|
<span style="color: #C4C4C4;">use</span> ArrayAccess;
|
|
|
|
<span style="color: #423F3D;">/**
|
|
* Theme: Carbonight Contrast
|
|
* Carbonight Contrast.
|
|
*
|
|
* Copyright (c) 2014 Dayle Rees
|
|
*/</span>
|
|
<span style="color: #C4C4C4;">class</span> Container <span style="color: #8C8C8C;">implements</span> ArrayAccess
|
|
{
|
|
<span style="color: #423F3D;">/**
|
|
* An array of the types that have been resolved.
|
|
*
|
|
* <span style="color: #5c5856;">@var</span> array
|
|
*/</span>
|
|
<span style="color: #8C8C8C;">protected</span> <span style="color: ;">$resolved</span> <span style="color: #C4C4C4;">=</span> <span style="color: #ffffff;">array</span>();
|
|
|
|
<span style="color: #423F3D;">/**
|
|
* Determine if a given type is shared.
|
|
*
|
|
* <span style="color: #5c5856;">@param</span> string $abstract
|
|
* <span style="color: #5c5856;">@return</span> bool
|
|
*/</span>
|
|
<span style="color: #8C8C8C;">public</span> <span style="color: #C4C4C4;">function</span> <span style="color: #ffffff;">isShared</span>(<span style="color: ;">$abstract</span>)
|
|
{
|
|
<span style="color: #eeeeee;">if</span> (<span style="color: #ffffff;">isset</span>(<span style="color: ;">$this</span><span style="color: #eeeeee;">-></span><span style="color: ;">bindings</span>[<span style="color: ;">$abstract</span>][<span style="color: #ffffff;">'shared'</span>]))
|
|
{
|
|
<span style="color: ;">$shared</span> <span style="color: #eeeeee;">=</span> <span style="color: ;">$this</span><span style="color: #eeeeee;">-></span><span style="color: ;">bindings</span>[<span style="color: ;">$abstract</span>][<span style="color: #ffffff;">'shared'</span>];
|
|
}
|
|
<span style="color: #eeeeee;">else</span>
|
|
{
|
|
<span style="color: ;">$shared</span> <span style="color: #eeeeee;">=</span> <span style="color: #8C8C8C;">false</span>;
|
|
}
|
|
|
|
<span style="color: #eeeeee;">return</span> <span style="color: #ffffff;">isset</span>(<span style="color: ;">$this</span><span style="color: #eeeeee;">-></span><span style="color: ;">instances</span>[<span style="color: ;">$abstract</span>]) <span style="color: #eeeeee;">||</span> <span style="color: ;">$shared</span> <span style="color: #eeeeee;">===</span> <span style="color: #8C8C8C;">true</span>;
|
|
}
|
|
|
|
}
|
|
</pre>
|