Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
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
PSDI Army
yii2
Commits
ad19e332
Commit
ad19e332
authored
Mar 07, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added back some toArray() implementations.
parent
b3b515b9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
0 deletions
+23
-0
ErrorHandler.php
framework/base/ErrorHandler.php
+3
-0
CookieCollection.php
framework/web/CookieCollection.php
+10
-0
HeaderCollection.php
framework/web/HeaderCollection.php
+10
-0
No files found.
framework/base/ErrorHandler.php
View file @
ad19e332
...
@@ -145,6 +145,9 @@ class ErrorHandler extends Component
...
@@ -145,6 +145,9 @@ class ErrorHandler extends Component
'message'
=>
$exception
->
getMessage
(),
'message'
=>
$exception
->
getMessage
(),
'code'
=>
$exception
->
getCode
(),
'code'
=>
$exception
->
getCode
(),
];
];
if
(
$exception
instanceof
HttpException
)
{
$array
[
'status'
]
=
$exception
->
statusCode
;
}
if
((
$prev
=
$exception
->
getPrevious
())
!==
null
)
{
if
((
$prev
=
$exception
->
getPrevious
())
!==
null
)
{
$array
[
'previous'
]
=
$this
->
convertExceptionToArray
(
$prev
);
$array
[
'previous'
]
=
$this
->
convertExceptionToArray
(
$prev
);
}
}
...
...
framework/web/CookieCollection.php
View file @
ad19e332
...
@@ -166,6 +166,16 @@ class CookieCollection extends Object implements \IteratorAggregate, \ArrayAcces
...
@@ -166,6 +166,16 @@ class CookieCollection extends Object implements \IteratorAggregate, \ArrayAcces
}
}
/**
/**
* Returns the collection as a PHP array.
* @return array the array representation of the collection.
* The array keys are cookie names, and the array values are the corresponding cookie objects.
*/
public
function
toArray
()
{
return
$this
->
_cookies
;
}
/**
* Returns whether there is a cookie with the specified name.
* Returns whether there is a cookie with the specified name.
* This method is required by the SPL interface `ArrayAccess`.
* This method is required by the SPL interface `ArrayAccess`.
* It is implicitly called when you use something like `isset($collection[$name])`.
* It is implicitly called when you use something like `isset($collection[$name])`.
...
...
framework/web/HeaderCollection.php
View file @
ad19e332
...
@@ -160,6 +160,16 @@ class HeaderCollection extends Object implements \IteratorAggregate, \ArrayAcces
...
@@ -160,6 +160,16 @@ class HeaderCollection extends Object implements \IteratorAggregate, \ArrayAcces
}
}
/**
/**
* Returns the collection as a PHP array.
* @return array the array representation of the collection.
* The array keys are header names, and the array values are the corresponding header values.
*/
public
function
toArray
()
{
return
$this
->
_headers
;
}
/**
* Returns whether there is a header with the specified name.
* Returns whether there is a header with the specified name.
* This method is required by the SPL interface `ArrayAccess`.
* This method is required by the SPL interface `ArrayAccess`.
* It is implicitly called when you use something like `isset($collection[$name])`.
* It is implicitly called when you use something like `isset($collection[$name])`.
...
...
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