47 lines
2.5 KiB
HTML
47 lines
2.5 KiB
HTML
<h1 style="background-color:#242430; color: #c8c7d5;">Heroku</h1>
|
|
<pre style="font-family:Monaco, monospace; padding:2em; background-color: #1b1b24; color: #c8c7d5;">
|
|
<?php
|
|
|
|
<span style="color: #585480;">namespace</span> Illuminate\Container;
|
|
|
|
<span style="color: #585480;">use</span> Closure;
|
|
<span style="color: #585480;">use</span> ArrayAccess;
|
|
|
|
<span style="color: #505067;">/**
|
|
* Theme: Heroku
|
|
* Heroku.
|
|
*
|
|
* Copyright (c) 2014 Dayle Rees
|
|
*/</span>
|
|
<span style="color: #585480;">class</span> Container <span style="color: #7873ae;">implements</span> ArrayAccess
|
|
{
|
|
<span style="color: #505067;">/**
|
|
* An array of the types that have been resolved.
|
|
*
|
|
* <span style="color: #5d5d76;">@var</span> array
|
|
*/</span>
|
|
<span style="color: #7873ae;">protected</span> <span style="color: ;">$resolved</span> <span style="color: #585480;">=</span> <span style="color: #a6fa62;">array</span>();
|
|
|
|
<span style="color: #505067;">/**
|
|
* Determine if a given type is shared.
|
|
*
|
|
* <span style="color: #5d5d76;">@param</span> string $abstract
|
|
* <span style="color: #5d5d76;">@return</span> bool
|
|
*/</span>
|
|
<span style="color: #7873ae;">public</span> <span style="color: #585480;">function</span> <span style="color: #ffffff;">isShared</span>(<span style="color: ;">$abstract</span>)
|
|
{
|
|
<span style="color: #7873ae;">if</span> (<span style="color: #a6fa62;">isset</span>(<span style="color: ;">$this</span><span style="color: #7873ae;">-></span><span style="color: ;">bindings</span>[<span style="color: ;">$abstract</span>][<span style="color: #a6fa62;">'shared'</span>]))
|
|
{
|
|
<span style="color: ;">$shared</span> <span style="color: #7873ae;">=</span> <span style="color: ;">$this</span><span style="color: #7873ae;">-></span><span style="color: ;">bindings</span>[<span style="color: ;">$abstract</span>][<span style="color: #a6fa62;">'shared'</span>];
|
|
}
|
|
<span style="color: #7873ae;">else</span>
|
|
{
|
|
<span style="color: ;">$shared</span> <span style="color: #7873ae;">=</span> <span style="color: #7873ae;">false</span>;
|
|
}
|
|
|
|
<span style="color: #7873ae;">return</span> <span style="color: #a6fa62;">isset</span>(<span style="color: ;">$this</span><span style="color: #7873ae;">-></span><span style="color: ;">instances</span>[<span style="color: ;">$abstract</span>]) <span style="color: #7873ae;">||</span> <span style="color: ;">$shared</span> <span style="color: #7873ae;">===</span> <span style="color: #7873ae;">true</span>;
|
|
}
|
|
|
|
}
|
|
</pre>
|