FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
php-openapi/src/ReferenceContextCache.php at master · php-openapi/php-openapi · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
php-openapi
/
php-openapi
Public
forked from
cebe/php-openapi
Notifications
You must be signed in to change notification settings
Fork
0
Star
5
Code
Pull requests
0
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
php-openapi
/
src
/
ReferenceContextCache.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
38 lines (30 loc) · 907 Bytes
Breadcrumbs
php-openapi
/
src
/
ReferenceContextCache.php
Copy path
File metadata and controls
38 lines (30 loc) · 907 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
<?php
/**
* @copyright Copyright (c) 2018 Carsten Brandt <mail@cebe.cc> and contributors
* @license https://github.com/cebe/php-openapi/blob/master/LICENSE
*/
namespace
cebe
\
openapi
;
/**
* ReferenceContextCache represents a cache storage for caching content of referenced files.
*/
class
ReferenceContextCache
{
private
$
_cache
= [];
public
function
set
(
$
ref
,
$
type
,
$
data
)
{
$
this
->
_cache
[
$
ref
][
$
type
??
''
] =
$
data
;
// store fallback value for resolving with unknown type
if
(
$
type
!==
null
&& !
isset
(
$
this
->
_cache
[
$
ref
][
''
])) {
$
this
->
_cache
[
$
ref
][
''
] =
$
data
;
}
}
public
function
get
(
$
ref
,
$
type
)
{
return
$
this
->
_cache
[
$
ref
][
$
type
??
''
] ??
null
;
}
public
function
has
(
$
ref
,
$
type
)
{
return
isset
(
$
this
->
_cache
[
$
ref
]) &&
array_key_exists
(
$
type
??
''
,
$
this
->
_cache
[
$
ref
]);
}
}
Back
|
FazBrowse Home
|
New Git URL