Merge branch '2.8' into 3.0
* 2.8: [VarDumper] Fix dumping jsons casted as arrays PassConfig::getMergePass is not an array Revert "bug #19114 [HttpKernel] Dont close the reponse stream in debug (nicolas-grekas)" Fix the retrieval of the last username when using forwarding [Yaml] Fix PHPDoc of the Yaml class [HttpFoundation] Add OPTIONS and TRACE to the list of safe methods Update getAbsoluteUri() for query string uris
This commit is contained in:
commit
8a2d5cd1df
@ -542,9 +542,9 @@ abstract class Client
|
|||||||
return parse_url($currentUri, PHP_URL_SCHEME).':'.$uri;
|
return parse_url($currentUri, PHP_URL_SCHEME).':'.$uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
// anchor?
|
// anchor or query string parameters?
|
||||||
if (!$uri || '#' == $uri[0]) {
|
if (!$uri || '#' == $uri[0] || '?' == $uri[0]) {
|
||||||
return preg_replace('/#.*?$/', '', $currentUri).$uri;
|
return preg_replace('/[#?].*?$/', '', $currentUri).$uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ('/' !== $uri[0]) {
|
if ('/' !== $uri[0]) {
|
||||||
|
@ -212,6 +212,15 @@ class ClientTest extends \PHPUnit_Framework_TestCase
|
|||||||
$client->request('GET', 'http://www.example.com/');
|
$client->request('GET', 'http://www.example.com/');
|
||||||
$client->request('GET', 'http');
|
$client->request('GET', 'http');
|
||||||
$this->assertEquals('http://www.example.com/http', $client->getRequest()->getUri(), '->request() uses the previous request for relative URLs');
|
$this->assertEquals('http://www.example.com/http', $client->getRequest()->getUri(), '->request() uses the previous request for relative URLs');
|
||||||
|
|
||||||
|
$client = new TestClient();
|
||||||
|
$client->request('GET', 'http://www.example.com/foo');
|
||||||
|
$client->request('GET', '?');
|
||||||
|
$this->assertEquals('http://www.example.com/foo?', $client->getRequest()->getUri(), '->request() uses the previous request for ?');
|
||||||
|
$client->request('GET', '?');
|
||||||
|
$this->assertEquals('http://www.example.com/foo?', $client->getRequest()->getUri(), '->request() uses the previous request for ?');
|
||||||
|
$client->request('GET', '?foo=bar');
|
||||||
|
$this->assertEquals('http://www.example.com/foo?foo=bar', $client->getRequest()->getUri(), '->request() uses the previous request for ?');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testRequestReferer()
|
public function testRequestReferer()
|
||||||
|
@ -153,9 +153,9 @@ class PassConfig
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets all passes for the Merge pass.
|
* Gets the Merge pass.
|
||||||
*
|
*
|
||||||
* @return array An array of passes
|
* @return CompilerPassInterface The merge pass
|
||||||
*/
|
*/
|
||||||
public function getMergePass()
|
public function getMergePass()
|
||||||
{
|
{
|
||||||
|
@ -1463,7 +1463,7 @@ class Request
|
|||||||
*/
|
*/
|
||||||
public function isMethodSafe()
|
public function isMethodSafe()
|
||||||
{
|
{
|
||||||
return in_array($this->getMethod(), array('GET', 'HEAD'));
|
return in_array($this->getMethod(), array('GET', 'HEAD', 'OPTIONS', 'TRACE'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -373,6 +373,12 @@ class Response
|
|||||||
$this->sendHeaders();
|
$this->sendHeaders();
|
||||||
$this->sendContent();
|
$this->sendContent();
|
||||||
|
|
||||||
|
if (function_exists('fastcgi_finish_request')) {
|
||||||
|
fastcgi_finish_request();
|
||||||
|
} elseif ('cli' !== PHP_SAPI) {
|
||||||
|
static::closeOutputBuffers(0, true);
|
||||||
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1934,6 +1934,32 @@ class RequestTest extends \PHPUnit_Framework_TestCase
|
|||||||
array(str_repeat(':', 101)),
|
array(str_repeat(':', 101)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @dataProvider methodSafeProvider
|
||||||
|
*/
|
||||||
|
public function testMethodSafe($method, $safe)
|
||||||
|
{
|
||||||
|
$request = new Request();
|
||||||
|
$request->setMethod($method);
|
||||||
|
$this->assertEquals($safe, $request->isMethodSafe());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function methodSafeProvider()
|
||||||
|
{
|
||||||
|
return array(
|
||||||
|
array('HEAD', true),
|
||||||
|
array('GET', true),
|
||||||
|
array('POST', false),
|
||||||
|
array('PUT', false),
|
||||||
|
array('PATCH', false),
|
||||||
|
array('DELETE', false),
|
||||||
|
array('PURGE', false),
|
||||||
|
array('OPTIONS', true),
|
||||||
|
array('TRACE', true),
|
||||||
|
array('CONNECT', false),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class RequestContentProxy extends Request
|
class RequestContentProxy extends Request
|
||||||
|
@ -134,14 +134,6 @@ abstract class Kernel implements KernelInterface, TerminableInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($this->getHttpKernel() instanceof TerminableInterface) {
|
if ($this->getHttpKernel() instanceof TerminableInterface) {
|
||||||
if (!$this->debug) {
|
|
||||||
if (function_exists('fastcgi_finish_request')) {
|
|
||||||
fastcgi_finish_request();
|
|
||||||
} elseif ('cli' !== PHP_SAPI) {
|
|
||||||
Response::closeOutputBuffers(0, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->getHttpKernel()->terminate($request, $response);
|
$this->getHttpKernel()->terminate($request, $response);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,13 @@ class AuthenticationUtils
|
|||||||
*/
|
*/
|
||||||
public function getLastUsername()
|
public function getLastUsername()
|
||||||
{
|
{
|
||||||
$session = $this->getRequest()->getSession();
|
$request = $this->getRequest();
|
||||||
|
|
||||||
|
if ($request->attributes->has(Security::LAST_USERNAME)) {
|
||||||
|
return $request->attributes->get(Security::LAST_USERNAME);
|
||||||
|
}
|
||||||
|
|
||||||
|
$session = $request->getSession();
|
||||||
|
|
||||||
return null === $session ? '' : $session->get(Security::LAST_USERNAME);
|
return null === $session ? '' : $session->get(Security::LAST_USERNAME);
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,8 @@ class Caster
|
|||||||
{
|
{
|
||||||
if ($reflector->hasMethod('__debugInfo')) {
|
if ($reflector->hasMethod('__debugInfo')) {
|
||||||
$a = $obj->__debugInfo();
|
$a = $obj->__debugInfo();
|
||||||
|
} elseif ($obj instanceof \Closure) {
|
||||||
|
$a = array();
|
||||||
} else {
|
} else {
|
||||||
$a = (array) $obj;
|
$a = (array) $obj;
|
||||||
}
|
}
|
||||||
@ -52,7 +54,7 @@ class Caster
|
|||||||
if ($a) {
|
if ($a) {
|
||||||
$p = array_keys($a);
|
$p = array_keys($a);
|
||||||
foreach ($p as $i => $k) {
|
foreach ($p as $i => $k) {
|
||||||
if (!isset($k[0]) || ("\0" !== $k[0] && !$reflector->hasProperty($k))) {
|
if (isset($k[0]) && "\0" !== $k[0] && !$reflector->hasProperty($k)) {
|
||||||
$p[$i] = self::PREFIX_DYNAMIC.$k;
|
$p[$i] = self::PREFIX_DYNAMIC.$k;
|
||||||
} elseif (isset($k[16]) && "\0" === $k[16] && 0 === strpos($k, "\0class@anonymous\0")) {
|
} elseif (isset($k[16]) && "\0" === $k[16] && 0 === strpos($k, "\0class@anonymous\0")) {
|
||||||
$p[$i] = "\0".$reflector->getParentClass().'@anonymous'.strrchr($k, "\0");
|
$p[$i] = "\0".$reflector->getParentClass().'@anonymous'.strrchr($k, "\0");
|
||||||
|
@ -58,7 +58,7 @@ class ReflectionCaster
|
|||||||
}
|
}
|
||||||
|
|
||||||
$prefix = Caster::PREFIX_DYNAMIC;
|
$prefix = Caster::PREFIX_DYNAMIC;
|
||||||
unset($a['name'], $a[$prefix.'0'], $a[$prefix.'this'], $a[$prefix.'parameter'], $a[Caster::PREFIX_VIRTUAL.'extra']);
|
unset($a['name'], $a[$prefix.'this'], $a[$prefix.'parameter'], $a[Caster::PREFIX_VIRTUAL.'extra']);
|
||||||
|
|
||||||
return $a;
|
return $a;
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ class VarCloner extends AbstractCloner
|
|||||||
$i = 0; // Current iteration position in $queue
|
$i = 0; // Current iteration position in $queue
|
||||||
$len = 1; // Length of $queue
|
$len = 1; // Length of $queue
|
||||||
$pos = 0; // Number of cloned items past the first level
|
$pos = 0; // Number of cloned items past the first level
|
||||||
$refs = 0; // Hard references counter
|
$refsCounter = 0; // Hard references counter
|
||||||
$queue = array(array($var)); // This breadth-first queue is the return value
|
$queue = array(array($var)); // This breadth-first queue is the return value
|
||||||
$arrayRefs = array(); // Map of queue indexes to stub array objects
|
$arrayRefs = array(); // Map of queue indexes to stub array objects
|
||||||
$hardRefs = array(); // Map of original zval hashes to stub objects
|
$hardRefs = array(); // Map of original zval hashes to stub objects
|
||||||
@ -60,27 +60,32 @@ class VarCloner extends AbstractCloner
|
|||||||
for ($i = 0; $i < $len; ++$i) {
|
for ($i = 0; $i < $len; ++$i) {
|
||||||
$indexed = true; // Whether the currently iterated array is numerically indexed or not
|
$indexed = true; // Whether the currently iterated array is numerically indexed or not
|
||||||
$j = -1; // Position in the currently iterated array
|
$j = -1; // Position in the currently iterated array
|
||||||
$step = $queue[$i]; // Copy of the currently iterated array used for hard references detection
|
$fromObjCast = array_keys($queue[$i]);
|
||||||
foreach ($step as $k => $v) {
|
$fromObjCast = array_keys(array_flip($fromObjCast)) !== $fromObjCast;
|
||||||
|
$refs = $vals = $fromObjCast ? array_values($queue[$i]) : $queue[$i];
|
||||||
|
foreach ($queue[$i] as $k => $v) {
|
||||||
// $k is the original key
|
// $k is the original key
|
||||||
// $v is the original value or a stub object in case of hard references
|
// $v is the original value or a stub object in case of hard references
|
||||||
if ($indexed && $k !== ++$j) {
|
if ($k !== ++$j) {
|
||||||
$indexed = false;
|
$indexed = false;
|
||||||
}
|
}
|
||||||
|
if ($fromObjCast) {
|
||||||
|
$k = $j;
|
||||||
|
}
|
||||||
if ($useExt) {
|
if ($useExt) {
|
||||||
$zval = symfony_zval_info($k, $step);
|
$zval = symfony_zval_info($k, $refs);
|
||||||
} else {
|
} else {
|
||||||
$step[$k] = $cookie;
|
$refs[$k] = $cookie;
|
||||||
if ($zval['zval_isref'] = $queue[$i][$k] === $cookie) {
|
if ($zval['zval_isref'] = $vals[$k] === $cookie) {
|
||||||
$zval['zval_hash'] = $v instanceof Stub ? spl_object_hash($v) : null;
|
$zval['zval_hash'] = $v instanceof Stub ? spl_object_hash($v) : null;
|
||||||
}
|
}
|
||||||
$zval['type'] = gettype($v);
|
$zval['type'] = gettype($v);
|
||||||
}
|
}
|
||||||
if ($zval['zval_isref']) {
|
if ($zval['zval_isref']) {
|
||||||
$queue[$i][$k] = &$stub; // Break hard references to make $queue completely
|
$vals[$k] = &$stub; // Break hard references to make $queue completely
|
||||||
unset($stub); // independent from the original structure
|
unset($stub); // independent from the original structure
|
||||||
if (isset($hardRefs[$zval['zval_hash']])) {
|
if (isset($hardRefs[$zval['zval_hash']])) {
|
||||||
$queue[$i][$k] = $useExt ? ($v = $hardRefs[$zval['zval_hash']]) : ($step[$k] = $v);
|
$vals[$k] = $useExt ? ($v = $hardRefs[$zval['zval_hash']]) : ($refs[$k] = $v);
|
||||||
if ($v->value instanceof Stub && (Stub::TYPE_OBJECT === $v->value->type || Stub::TYPE_RESOURCE === $v->value->type)) {
|
if ($v->value instanceof Stub && (Stub::TYPE_OBJECT === $v->value->type || Stub::TYPE_RESOURCE === $v->value->type)) {
|
||||||
++$v->value->refCount;
|
++$v->value->refCount;
|
||||||
}
|
}
|
||||||
@ -204,18 +209,18 @@ class VarCloner extends AbstractCloner
|
|||||||
if (isset($stub)) {
|
if (isset($stub)) {
|
||||||
if ($zval['zval_isref']) {
|
if ($zval['zval_isref']) {
|
||||||
if ($useExt) {
|
if ($useExt) {
|
||||||
$queue[$i][$k] = $hardRefs[$zval['zval_hash']] = $v = new Stub();
|
$vals[$k] = $hardRefs[$zval['zval_hash']] = $v = new Stub();
|
||||||
$v->value = $stub;
|
$v->value = $stub;
|
||||||
} else {
|
} else {
|
||||||
$step[$k] = new Stub();
|
$refs[$k] = new Stub();
|
||||||
$step[$k]->value = $stub;
|
$refs[$k]->value = $stub;
|
||||||
$h = spl_object_hash($step[$k]);
|
$h = spl_object_hash($refs[$k]);
|
||||||
$queue[$i][$k] = $hardRefs[$h] = &$step[$k];
|
$vals[$k] = $hardRefs[$h] = &$refs[$k];
|
||||||
$values[$h] = $v;
|
$values[$h] = $v;
|
||||||
}
|
}
|
||||||
$queue[$i][$k]->handle = ++$refs;
|
$vals[$k]->handle = ++$refsCounter;
|
||||||
} else {
|
} else {
|
||||||
$queue[$i][$k] = $stub;
|
$vals[$k] = $stub;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($a) {
|
if ($a) {
|
||||||
@ -243,19 +248,38 @@ class VarCloner extends AbstractCloner
|
|||||||
$stub = $a = null;
|
$stub = $a = null;
|
||||||
} elseif ($zval['zval_isref']) {
|
} elseif ($zval['zval_isref']) {
|
||||||
if ($useExt) {
|
if ($useExt) {
|
||||||
$queue[$i][$k] = $hardRefs[$zval['zval_hash']] = new Stub();
|
$vals[$k] = $hardRefs[$zval['zval_hash']] = new Stub();
|
||||||
$queue[$i][$k]->value = $v;
|
$vals[$k]->value = $v;
|
||||||
} else {
|
} else {
|
||||||
$step[$k] = $queue[$i][$k] = new Stub();
|
$refs[$k] = $vals[$k] = new Stub();
|
||||||
$step[$k]->value = $v;
|
$refs[$k]->value = $v;
|
||||||
$h = spl_object_hash($step[$k]);
|
$h = spl_object_hash($refs[$k]);
|
||||||
$hardRefs[$h] = &$step[$k];
|
$hardRefs[$h] = &$refs[$k];
|
||||||
$values[$h] = $v;
|
$values[$h] = $v;
|
||||||
}
|
}
|
||||||
$queue[$i][$k]->handle = ++$refs;
|
$vals[$k]->handle = ++$refsCounter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($fromObjCast) {
|
||||||
|
$refs = $vals;
|
||||||
|
$vals = array();
|
||||||
|
$j = -1;
|
||||||
|
foreach ($queue[$i] as $k => $v) {
|
||||||
|
foreach (array($k => $v) as $a => $v) {
|
||||||
|
}
|
||||||
|
if ($a !== $k) {
|
||||||
|
$vals = (object) $vals;
|
||||||
|
$vals->{$k} = $refs[++$j];
|
||||||
|
$vals = (array) $vals;
|
||||||
|
} else {
|
||||||
|
$vals[$k] = $refs[++$j];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$queue[$i] = $vals;
|
||||||
|
|
||||||
if (isset($arrayRefs[$i])) {
|
if (isset($arrayRefs[$i])) {
|
||||||
if ($indexed) {
|
if ($indexed) {
|
||||||
$arrayRefs[$i]->class = Stub::ARRAY_INDEXED;
|
$arrayRefs[$i]->class = Stub::ARRAY_INDEXED;
|
||||||
|
@ -128,6 +128,45 @@ EOTXT
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testJsonCast()
|
||||||
|
{
|
||||||
|
$var = (array) json_decode('{"0":{},"1":null}');
|
||||||
|
foreach ($var as &$v) {
|
||||||
|
}
|
||||||
|
$var[] = &$v;
|
||||||
|
$var[''] = 2;
|
||||||
|
|
||||||
|
$this->assertDumpMatchesFormat(
|
||||||
|
<<<EOTXT
|
||||||
|
array:4 [
|
||||||
|
"0" => {}
|
||||||
|
"1" => &1 null
|
||||||
|
0 => &1 null
|
||||||
|
"" => 2
|
||||||
|
]
|
||||||
|
EOTXT
|
||||||
|
,
|
||||||
|
$var
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testObjectCast()
|
||||||
|
{
|
||||||
|
$var = (object) array(1 => 1);
|
||||||
|
$var->{1} = 2;
|
||||||
|
|
||||||
|
$this->assertDumpMatchesFormat(
|
||||||
|
<<<EOTXT
|
||||||
|
{
|
||||||
|
+1: 1
|
||||||
|
+"1": 2
|
||||||
|
}
|
||||||
|
EOTXT
|
||||||
|
,
|
||||||
|
$var
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public function testClosedResource()
|
public function testClosedResource()
|
||||||
{
|
{
|
||||||
if (defined('HHVM_VERSION') && HHVM_VERSION_ID < 30600) {
|
if (defined('HHVM_VERSION') && HHVM_VERSION_ID < 30600) {
|
||||||
|
@ -135,6 +135,72 @@ EOTXT;
|
|||||||
$this->assertStringMatchesFormat($expected, print_r($clone, true));
|
$this->assertStringMatchesFormat($expected, print_r($clone, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testJsonCast()
|
||||||
|
{
|
||||||
|
$data = (array) json_decode('{"1":{}}');
|
||||||
|
|
||||||
|
$cloner = new VarCloner();
|
||||||
|
$clone = $cloner->cloneVar($data);
|
||||||
|
|
||||||
|
$expected = <<<'EOTXT'
|
||||||
|
object(Symfony\Component\VarDumper\Cloner\Data)#%i (4) {
|
||||||
|
["data":"Symfony\Component\VarDumper\Cloner\Data":private]=>
|
||||||
|
array(2) {
|
||||||
|
[0]=>
|
||||||
|
array(1) {
|
||||||
|
[0]=>
|
||||||
|
object(Symfony\Component\VarDumper\Cloner\Stub)#%i (7) {
|
||||||
|
["type"]=>
|
||||||
|
string(5) "array"
|
||||||
|
["class"]=>
|
||||||
|
string(5) "assoc"
|
||||||
|
["value"]=>
|
||||||
|
int(1)
|
||||||
|
["cut"]=>
|
||||||
|
int(0)
|
||||||
|
["handle"]=>
|
||||||
|
int(0)
|
||||||
|
["refCount"]=>
|
||||||
|
int(0)
|
||||||
|
["position"]=>
|
||||||
|
int(1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
[1]=>
|
||||||
|
array(1) {
|
||||||
|
["1"]=>
|
||||||
|
object(Symfony\Component\VarDumper\Cloner\Stub)#%i (7) {
|
||||||
|
["type"]=>
|
||||||
|
string(6) "object"
|
||||||
|
["class"]=>
|
||||||
|
string(8) "stdClass"
|
||||||
|
["value"]=>
|
||||||
|
NULL
|
||||||
|
["cut"]=>
|
||||||
|
int(0)
|
||||||
|
["handle"]=>
|
||||||
|
int(%i)
|
||||||
|
["refCount"]=>
|
||||||
|
int(0)
|
||||||
|
["position"]=>
|
||||||
|
int(0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
["maxDepth":"Symfony\Component\VarDumper\Cloner\Data":private]=>
|
||||||
|
int(20)
|
||||||
|
["maxItemsPerDepth":"Symfony\Component\VarDumper\Cloner\Data":private]=>
|
||||||
|
int(-1)
|
||||||
|
["useRefHandles":"Symfony\Component\VarDumper\Cloner\Data":private]=>
|
||||||
|
int(-1)
|
||||||
|
}
|
||||||
|
|
||||||
|
EOTXT;
|
||||||
|
ob_start();
|
||||||
|
var_dump($clone);
|
||||||
|
$this->assertStringMatchesFormat($expected, ob_get_clean());
|
||||||
|
}
|
||||||
|
|
||||||
public function testCaster()
|
public function testCaster()
|
||||||
{
|
{
|
||||||
$cloner = new VarCloner(array(
|
$cloner = new VarCloner(array(
|
||||||
|
@ -46,20 +46,20 @@ class Yaml
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dumps a PHP array to a YAML string.
|
* Dumps a PHP value to a YAML string.
|
||||||
*
|
*
|
||||||
* The dump method, when supplied with an array, will do its best
|
* The dump method, when supplied with an array, will do its best
|
||||||
* to convert the array into friendly YAML.
|
* to convert the array into friendly YAML.
|
||||||
*
|
*
|
||||||
* @param array $array PHP array
|
* @param mixed $input The PHP value
|
||||||
* @param int $inline The level where you switch to inline YAML
|
* @param int $inline The level where you switch to inline YAML
|
||||||
* @param int $indent The amount of spaces to use for indentation of nested nodes
|
* @param int $indent The amount of spaces to use for indentation of nested nodes
|
||||||
* @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise
|
* @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise
|
||||||
* @param bool $objectSupport true if object support is enabled, false otherwise
|
* @param bool $objectSupport true if object support is enabled, false otherwise
|
||||||
*
|
*
|
||||||
* @return string A YAML string representing the original PHP array
|
* @return string A YAML string representing the original PHP value
|
||||||
*/
|
*/
|
||||||
public static function dump($array, $inline = 2, $indent = 4, $exceptionOnInvalidType = false, $objectSupport = false)
|
public static function dump($input, $inline = 2, $indent = 4, $exceptionOnInvalidType = false, $objectSupport = false)
|
||||||
{
|
{
|
||||||
if ($indent < 1) {
|
if ($indent < 1) {
|
||||||
throw new \InvalidArgumentException('The indentation must be greater than zero.');
|
throw new \InvalidArgumentException('The indentation must be greater than zero.');
|
||||||
@ -68,6 +68,6 @@ class Yaml
|
|||||||
$yaml = new Dumper();
|
$yaml = new Dumper();
|
||||||
$yaml->setIndentation($indent);
|
$yaml->setIndentation($indent);
|
||||||
|
|
||||||
return $yaml->dump($array, $inline, 0, $exceptionOnInvalidType, $objectSupport);
|
return $yaml->dump($input, $inline, 0, $exceptionOnInvalidType, $objectSupport);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user