Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeray Santana Hualde
syncEnrollments
Commits
fb3a0df0
Commit
fb3a0df0
authored
Aug 26, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change is_callable checks to instanceof Closure.
parent
429c9cee
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
8 additions
and
8 deletions
+8
-8
arr.php
laravel/arr.php
+1
-1
driver.php
laravel/cache/driver.php
+2
-2
config.php
laravel/config.php
+1
-1
lang.php
laravel/lang.php
+1
-1
handler.php
laravel/routing/handler.php
+1
-1
driver.php
laravel/session/driver.php
+1
-1
view.php
laravel/view.php
+1
-1
No files found.
laravel/arr.php
View file @
fb3a0df0
...
@@ -27,7 +27,7 @@ class Arr {
...
@@ -27,7 +27,7 @@ class Arr {
{
{
if
(
!
is_array
(
$array
)
or
!
array_key_exists
(
$segment
,
$array
))
if
(
!
is_array
(
$array
)
or
!
array_key_exists
(
$segment
,
$array
))
{
{
return
is_callable
(
$default
)
?
call_user_func
(
$default
)
:
$default
;
return
(
$default
instanceof
\Closure
)
?
call_user_func
(
$default
)
:
$default
;
}
}
$array
=
$array
[
$segment
];
$array
=
$array
[
$segment
];
...
...
laravel/cache/driver.php
View file @
fb3a0df0
...
@@ -38,7 +38,7 @@ abstract class Driver {
...
@@ -38,7 +38,7 @@ abstract class Driver {
{
{
if
(
!
is_null
(
$item
=
$this
->
retrieve
(
$key
)))
return
$item
;
if
(
!
is_null
(
$item
=
$this
->
retrieve
(
$key
)))
return
$item
;
return
(
is_callable
(
$default
)
)
?
call_user_func
(
$default
)
:
$default
;
return
(
$default
instanceof
\Closure
)
?
call_user_func
(
$default
)
:
$default
;
}
}
/**
/**
...
@@ -82,7 +82,7 @@ abstract class Driver {
...
@@ -82,7 +82,7 @@ abstract class Driver {
{
{
if
(
!
is_null
(
$item
=
$this
->
get
(
$key
,
null
)))
return
$item
;
if
(
!
is_null
(
$item
=
$this
->
get
(
$key
,
null
)))
return
$item
;
$default
=
is_callable
(
$default
)
?
call_user_func
(
$default
)
:
$default
;
$default
=
(
$default
instanceof
\Closure
)
?
call_user_func
(
$default
)
:
$default
;
$this
->
put
(
$key
,
$default
,
$minutes
);
$this
->
put
(
$key
,
$default
,
$minutes
);
...
...
laravel/config.php
View file @
fb3a0df0
...
@@ -58,7 +58,7 @@ class Config {
...
@@ -58,7 +58,7 @@ class Config {
if
(
!
static
::
load
(
$file
))
if
(
!
static
::
load
(
$file
))
{
{
return
is_callable
(
$default
)
?
call_user_func
(
$default
)
:
$default
;
return
(
$default
instanceof
\Closure
)
?
call_user_func
(
$default
)
:
$default
;
}
}
if
(
is_null
(
$key
))
return
static
::
$items
[
$file
];
if
(
is_null
(
$key
))
return
static
::
$items
[
$file
];
...
...
laravel/lang.php
View file @
fb3a0df0
...
@@ -88,7 +88,7 @@ class Lang {
...
@@ -88,7 +88,7 @@ class Lang {
if
(
!
$this
->
load
(
$file
))
if
(
!
$this
->
load
(
$file
))
{
{
return
is_callable
(
$default
)
?
call_user_func
(
$default
)
:
$default
;
return
(
$default
instanceof
\Closure
)
?
call_user_func
(
$default
)
:
$default
;
}
}
$line
=
Arr
::
get
(
static
::
$lines
[
$this
->
language
.
$file
],
$line
,
$default
);
$line
=
Arr
::
get
(
static
::
$lines
[
$this
->
language
.
$file
],
$line
,
$default
);
...
...
laravel/routing/handler.php
View file @
fb3a0df0
...
@@ -83,7 +83,7 @@ class Handler {
...
@@ -83,7 +83,7 @@ class Handler {
{
{
if
(
isset
(
$route
->
callback
[
'do'
]))
return
$route
->
callback
[
'do'
];
if
(
isset
(
$route
->
callback
[
'do'
]))
return
$route
->
callback
[
'do'
];
foreach
(
$route
->
callback
as
$value
)
{
if
(
is_callable
(
$value
)
)
return
$value
;
}
foreach
(
$route
->
callback
as
$value
)
{
if
(
$value
instanceof
Closure
)
return
$value
;
}
}
}
/**
/**
...
...
laravel/session/driver.php
View file @
fb3a0df0
...
@@ -104,7 +104,7 @@ abstract class Driver {
...
@@ -104,7 +104,7 @@ abstract class Driver {
if
(
array_key_exists
(
$possibility
,
$this
->
session
[
'data'
]))
return
$this
->
session
[
'data'
][
$possibility
];
if
(
array_key_exists
(
$possibility
,
$this
->
session
[
'data'
]))
return
$this
->
session
[
'data'
][
$possibility
];
}
}
return
is_callable
(
$default
)
?
call_user_func
(
$default
)
:
$default
;
return
(
$default
instanceof
\Closure
)
?
call_user_func
(
$default
)
:
$default
;
}
}
/**
/**
...
...
laravel/view.php
View file @
fb3a0df0
...
@@ -91,7 +91,7 @@ class View implements Renderable {
...
@@ -91,7 +91,7 @@ class View implements Renderable {
{
{
foreach
((
array
)
$composers
[
$this
->
view
]
as
$key
=>
$value
)
foreach
((
array
)
$composers
[
$this
->
view
]
as
$key
=>
$value
)
{
{
if
(
is_callable
(
$value
)
)
return
call_user_func
(
$value
,
$this
);
if
(
$value
instanceof
\Closure
)
return
call_user_func
(
$value
,
$this
);
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment