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
8d0fb916
Commit
8d0fb916
authored
May 19, 2014
by
Klimov Paul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
`VarDumper::exportAsString()` removed
parent
e11ecad1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
13 deletions
+4
-13
BaseVarDumper.php
framework/helpers/BaseVarDumper.php
+1
-12
VarDumperTest.php
tests/unit/framework/helpers/VarDumperTest.php
+3
-1
No files found.
framework/helpers/BaseVarDumper.php
View file @
8d0fb916
...
@@ -127,24 +127,13 @@ class BaseVarDumper
...
@@ -127,24 +127,13 @@ class BaseVarDumper
}
}
/**
/**
* Outputs a parsable string representation of a variable.
* This method achieves the similar functionality as var_export
* but is more robust when handling arrays and objects.
* @param mixed $var variable to be exported.
*/
public
static
function
export
(
$var
)
{
echo
static
::
exportAsString
(
$var
);
}
/**
* Returns a parsable string representation of a variable.
* Returns a parsable string representation of a variable.
* This method achieves the similar functionality as var_export
* This method achieves the similar functionality as var_export
* but is more robust when handling arrays and objects.
* but is more robust when handling arrays and objects.
* @param mixed $var variable to be exported.
* @param mixed $var variable to be exported.
* @return string parsable string representation of a variable.
* @return string parsable string representation of a variable.
*/
*/
public
static
function
export
AsString
(
$var
)
public
static
function
export
(
$var
)
{
{
self
::
$_output
=
''
;
self
::
$_output
=
''
;
self
::
exportInternal
(
$var
,
0
);
self
::
exportInternal
(
$var
,
0
);
...
...
tests/unit/framework/helpers/VarDumperTest.php
View file @
8d0fb916
...
@@ -102,6 +102,8 @@ RESULT;
...
@@ -102,6 +102,8 @@ RESULT;
*/
*/
public
function
testExport
(
$var
,
$expectedResult
)
public
function
testExport
(
$var
,
$expectedResult
)
{
{
$this
->
assertEquals
(
$expectedResult
,
VarDumper
::
exportAsString
(
$var
));
$exportResult
=
VarDumper
::
export
(
$var
);
$this
->
assertEquals
(
$expectedResult
,
$exportResult
);
$this
->
assertEquals
(
$var
,
eval
(
'return '
.
$exportResult
.
';'
));
}
}
}
}
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