forked from daylerees/colour-schemes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjuicy.html
46 lines (40 loc) · 2.52 KB
/
juicy.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<h1 style="background-color:#282828; color: #e3e2e0;">Juicy</h1>
<pre style="font-family:Monaco, monospace; padding:2em; background-color: #222222; color: #e3e2e0;">
<?php
<span style="color: #FF4E50;">namespace</span> Illuminate\Container;
<span style="color: #FF4E50;">use</span> Closure;
<span style="color: #FF4E50;">use</span> ArrayAccess;
<span style="color: #777777;">/**
* Theme: Juicy
* Juicy.
*
* Copyright (c) 2014 Dayle Rees
*/</span>
<span style="color: #FF4E50;">class</span> Container <span style="color: #3bc7b8;">implements</span> ArrayAccess
{
<span style="color: #777777;">/**
* An array of the types that have been resolved.
*
* <span style="color: #9b9b9b;">@var</span> array
*/</span>
<span style="color: #3bc7b8;">protected</span> <span style="color: ;">$resolved</span> <span style="color: #FF4E50;">=</span> <span style="color: #F85931;">array</span>();
<span style="color: #777777;">/**
* Determine if a given type is shared.
*
* <span style="color: #9b9b9b;">@param</span> string $abstract
* <span style="color: #9b9b9b;">@return</span> bool
*/</span>
<span style="color: #3bc7b8;">public</span> <span style="color: #FF4E50;">function</span> <span style="color: #c3cb4c;">isShared</span>(<span style="color: ;">$abstract</span>)
{
<span style="color: #EDB92E;">if</span> (<span style="color: #F85931;">isset</span>(<span style="color: ;">$this</span><span style="color: #EDB92E;">-></span><span style="color: ;">bindings</span>[<span style="color: ;">$abstract</span>][<span style="color: #3bc7b8;">'shared'</span>]))
{
<span style="color: ;">$shared</span> <span style="color: #EDB92E;">=</span> <span style="color: ;">$this</span><span style="color: #EDB92E;">-></span><span style="color: ;">bindings</span>[<span style="color: ;">$abstract</span>][<span style="color: #3bc7b8;">'shared'</span>];
}
<span style="color: #EDB92E;">else</span>
{
<span style="color: ;">$shared</span> <span style="color: #EDB92E;">=</span> <span style="color: #3bc7b8;">false</span>;
}
<span style="color: #EDB92E;">return</span> <span style="color: #F85931;">isset</span>(<span style="color: ;">$this</span><span style="color: #EDB92E;">-></span><span style="color: ;">instances</span>[<span style="color: ;">$abstract</span>]) <span style="color: #EDB92E;">||</span> <span style="color: ;">$shared</span> <span style="color: #EDB92E;">===</span> <span style="color: #3bc7b8;">true</span>;
}
}
</pre>