Updating composer

1.10.x
Julio Montoya 10 years ago
parent abb3ccde3a
commit 52e8a0546c
  1. 32
      composer.lock
  2. 2
      vendor/autoload.php
  3. 32
      vendor/symfony/console/Symfony/Component/Console/Application.php
  4. 2
      vendor/symfony/console/Symfony/Component/Console/Descriptor/MarkdownDescriptor.php
  5. 5
      vendor/symfony/console/Symfony/Component/Console/Helper/Table.php
  6. 6
      vendor/symfony/console/Symfony/Component/Console/Input/ArgvInput.php
  7. 6
      vendor/symfony/console/Symfony/Component/Console/Tester/CommandTester.php
  8. 10
      vendor/symfony/console/Symfony/Component/Console/Tests/ApplicationTest.php
  9. 1
      vendor/symfony/console/Symfony/Component/Console/Tests/Input/ArgvInputTest.php
  10. 2
      vendor/symfony/process/Symfony/Component/Process/Pipes/UnixPipes.php
  11. 2
      vendor/symfony/process/Symfony/Component/Process/Pipes/WindowsPipes.php
  12. 3
      vendor/symfony/process/Symfony/Component/Process/Process.php
  13. 8
      vendor/symfony/yaml/Symfony/Component/Yaml/Escaper.php
  14. 8
      vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php
  15. 16
      vendor/symfony/yaml/Symfony/Component/Yaml/Parser.php
  16. 20
      vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/unindentedCollections.yml
  17. 16
      vendor/symfony/yaml/Symfony/Component/Yaml/Tests/InlineTest.php
  18. 27
      vendor/symfony/yaml/Symfony/Component/Yaml/Tests/ParserTest.php

32
composer.lock generated

@ -637,17 +637,17 @@
},
{
"name": "symfony/console",
"version": "v2.6.3",
"version": "v2.6.4",
"target-dir": "Symfony/Component/Console",
"source": {
"type": "git",
"url": "https://github.com/symfony/Console.git",
"reference": "6ac6491ff60c0e5a941db3ccdc75a07adbb61476"
"reference": "e44154bfe3e41e8267d7a3794cd9da9a51cfac34"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/Console/zipball/6ac6491ff60c0e5a941db3ccdc75a07adbb61476",
"reference": "6ac6491ff60c0e5a941db3ccdc75a07adbb61476",
"url": "https://api.github.com/repos/symfony/Console/zipball/e44154bfe3e41e8267d7a3794cd9da9a51cfac34",
"reference": "e44154bfe3e41e8267d7a3794cd9da9a51cfac34",
"shasum": ""
},
"require": {
@ -690,11 +690,11 @@
],
"description": "Symfony Console Component",
"homepage": "http://symfony.com",
"time": "2015-01-06 17:50:02"
"time": "2015-01-25 04:39:26"
},
{
"name": "symfony/filesystem",
"version": "v2.6.3",
"version": "v2.6.4",
"target-dir": "Symfony/Component/Filesystem",
"source": {
"type": "git",
@ -741,17 +741,17 @@
},
{
"name": "symfony/process",
"version": "v2.6.3",
"version": "v2.6.4",
"target-dir": "Symfony/Component/Process",
"source": {
"type": "git",
"url": "https://github.com/symfony/Process.git",
"reference": "319794f611bd8bdefbac72beb3f05e847f8ebc92"
"reference": "ecfc23e89d9967999fa5f60a1e9af7384396e9ae"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/Process/zipball/319794f611bd8bdefbac72beb3f05e847f8ebc92",
"reference": "319794f611bd8bdefbac72beb3f05e847f8ebc92",
"url": "https://api.github.com/repos/symfony/Process/zipball/ecfc23e89d9967999fa5f60a1e9af7384396e9ae",
"reference": "ecfc23e89d9967999fa5f60a1e9af7384396e9ae",
"shasum": ""
},
"require": {
@ -784,21 +784,21 @@
],
"description": "Symfony Process Component",
"homepage": "http://symfony.com",
"time": "2015-01-06 22:47:52"
"time": "2015-01-25 04:39:26"
},
{
"name": "symfony/yaml",
"version": "v2.6.3",
"version": "v2.6.4",
"target-dir": "Symfony/Component/Yaml",
"source": {
"type": "git",
"url": "https://github.com/symfony/Yaml.git",
"reference": "82462a90848a52c2533aa6b598b107d68076b018"
"reference": "60ed7751671113cf1ee7d7778e691642c2e9acd8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/Yaml/zipball/82462a90848a52c2533aa6b598b107d68076b018",
"reference": "82462a90848a52c2533aa6b598b107d68076b018",
"url": "https://api.github.com/repos/symfony/Yaml/zipball/60ed7751671113cf1ee7d7778e691642c2e9acd8",
"reference": "60ed7751671113cf1ee7d7778e691642c2e9acd8",
"shasum": ""
},
"require": {
@ -831,7 +831,7 @@
],
"description": "Symfony Yaml Component",
"homepage": "http://symfony.com",
"time": "2015-01-03 15:33:07"
"time": "2015-01-25 04:39:26"
},
{
"name": "toin0u/digitalocean",

@ -4,4 +4,4 @@
require_once __DIR__ . '/composer' . '/autoload_real.php';
return ComposerAutoloaderInit30cd6c748fb2261197202fd59459a7bf::getLoader();
return ComposerAutoloaderInit9eafe859ee8be4d5a438d1eca7997a07::getLoader();

@ -460,10 +460,10 @@ class Application
{
$namespaces = array();
foreach ($this->commands as $command) {
$namespaces[] = $this->extractNamespace($command->getName());
$namespaces = array_merge($namespaces, $this->extractAllNamespaces($command->getName()));
foreach ($command->getAliases() as $alias) {
$namespaces[] = $this->extractNamespace($alias);
$namespaces = array_merge($namespaces, $this->extractAllNamespaces($alias));
}
}
@ -708,8 +708,8 @@ class Application
$trace = $e->getTrace();
array_unshift($trace, array(
'function' => '',
'file' => $e->getFile() != null ? $e->getFile() : 'n/a',
'line' => $e->getLine() != null ? $e->getLine() : 'n/a',
'file' => $e->getFile() !== null ? $e->getFile() : 'n/a',
'line' => $e->getLine() !== null ? $e->getLine() : 'n/a',
'args' => array(),
));
@ -1146,4 +1146,28 @@ class Application
return $lines;
}
/**
* Returns all namespaces of the command name.
*
* @param string $name The full name of the command
*
* @return array The namespaces of the command
*/
private function extractAllNamespaces($name)
{
// -1 as third argument is needed to skip the command short name when exploding
$parts = explode(':', $name, -1);
$namespaces = array();
foreach ($parts as $part) {
if (count($namespaces)) {
$namespaces[] = end($namespaces).':'.$part;
} else {
$namespaces[] = $part;
}
}
return $namespaces;
}
}

@ -105,7 +105,7 @@ class MarkdownDescriptor extends Descriptor
$this->write($help);
}
if ($definition = $command->getNativeDefinition()) {
if ($command->getNativeDefinition()) {
$this->write("\n\n");
$this->describeInputDefinition($command->getNativeDefinition());
}

@ -174,8 +174,9 @@ class Table
$this->rows[] = array_values($row);
$keys = array_keys($this->rows);
$rowKey = array_pop($keys);
end($this->rows);
$rowKey = key($this->rows);
reset($this->rows);
foreach ($row as $key => $cellValue) {
if (!strstr($cellValue, "\n")) {

@ -309,9 +309,11 @@ class ArgvInput extends Input
public function getParameterOption($values, $default = false)
{
$values = (array) $values;
$tokens = $this->tokens;
while ($token = array_shift($tokens)) {
while (0 < count($tokens)) {
$token = array_shift($tokens);
foreach ($values as $value) {
if ($token === $value || 0 === strpos($token, $value.'=')) {
if (false !== $pos = strpos($token, '=')) {

@ -42,14 +42,14 @@ class CommandTester
/**
* Executes the command.
*
* Available options:
* Available execution options:
*
* * interactive: Sets the input interactive flag
* * decorated: Sets the output decorated flag
* * verbosity: Sets the output verbosity flag
*
* @param array $input An array of arguments and options
* @param array $options An array of options
* @param array $input An array of command arguments and options
* @param array $options An array of execution options
*
* @return int The command exit code
*/

@ -45,6 +45,8 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
require_once self::$fixturesPath.'/Foo5Command.php';
require_once self::$fixturesPath.'/FoobarCommand.php';
require_once self::$fixturesPath.'/BarBucCommand.php';
require_once self::$fixturesPath.'/FooSubnamespaced1Command.php';
require_once self::$fixturesPath.'/FooSubnamespaced2Command.php';
}
protected function normalizeLineBreaks($text)
@ -201,6 +203,14 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('foo', $application->findNamespace('foo'), '->findNamespace() returns the given namespace if it exists');
}
public function testFindNamespaceWithSubnamespaces()
{
$application = new Application();
$application->add(new \FooSubnamespaced1Command());
$application->add(new \FooSubnamespaced2Command());
$this->assertEquals('foo', $application->findNamespace('foo'), '->findNamespace() returns commands even if the commands are only contained in subnamespaces');
}
/**
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage The namespace "f" is ambiguous (foo, foo1).

@ -304,6 +304,7 @@ class ArgvInputTest extends \PHPUnit_Framework_TestCase
array(array('app/console', 'foo:bar', '-e', 'dev'), array('-e', '--env'), 'dev'),
array(array('app/console', 'foo:bar', '--env=dev'), array('-e', '--env'), 'dev'),
array(array('app/console', 'foo:bar', '--env=dev', '--en=1'), array('--en'), '1'),
array(array('app/console', 'foo:bar', '--env=dev', '', '--en=1'), array('--en'), '1'),
);
}

@ -172,7 +172,7 @@ class UnixPipes extends AbstractPipes
}
if (null !== $w && 0 < count($w)) {
while ($len = strlen($this->inputBuffer)) {
while (strlen($this->inputBuffer)) {
$written = fwrite($w[0], $this->inputBuffer, 2 << 18); // write 512k
if ($written > 0) {
$this->inputBuffer = (string) substr($this->inputBuffer, $written);

@ -235,7 +235,7 @@ class WindowsPipes extends AbstractPipes
}
if (null !== $w && 0 < count($w)) {
while ($len = strlen($this->inputBuffer)) {
while (strlen($this->inputBuffer)) {
$written = fwrite($w[0], $this->inputBuffer, 2 << 18);
if ($written > 0) {
$this->inputBuffer = (string) substr($this->inputBuffer, $written);

@ -1290,8 +1290,7 @@ class Process
{
$that = $this;
$out = self::OUT;
$err = self::ERR;
$callback = function ($type, $data) use ($that, $callback, $out, $err) {
$callback = function ($type, $data) use ($that, $callback, $out) {
if ($out == $type) {
$that->addOutput($data);
} else {

@ -72,6 +72,14 @@ class Escaper
*/
public static function requiresSingleQuoting($value)
{
// Determines if a PHP value is entirely composed of a value that would
// require single quoting in YAML.
if (in_array(strtolower($value), array('null', '~', 'true', 'false', 'y', 'n', 'yes', 'no', 'on', 'off'))) {
return true;
}
// Determines if the PHP value contains any single characters that would
// cause it to require single quoting in YAML.
return preg_match('/[ \s \' " \: \{ \} \[ \] , & \* \# \?] | \A[ \- ? | < > = ! % @ ` ]/x', $value);
}

@ -144,15 +144,13 @@ class Inline
}
return $repr;
case '' == $value:
return "''";
case Escaper::requiresDoubleQuoting($value):
return Escaper::escapeWithDoubleQuotes($value);
case Escaper::requiresSingleQuoting($value):
return Escaper::escapeWithSingleQuotes($value);
case '' == $value:
return "''";
case preg_match(self::getTimestampRegex(), $value):
case in_array(strtolower($value), array('null', '~', 'true', 'false')):
return "'$value'";
return Escaper::escapeWithSingleQuotes($value);
default:
return $value;
}

@ -98,7 +98,6 @@ class Parser
$data[] = $parser->parse($this->getNextEmbedBlock(null, true), $exceptionOnInvalidType, $objectSupport, $objectForMap);
} else {
if (isset($values['leadspaces'])
&& ' ' == $values['leadspaces']
&& preg_match('#^(?P<key>'.Inline::REGEX_QUOTED_STRING.'|[^ \'"\{\[].*?) *\:(\s+(?P<value>.+?))?\s*$#u', $values['value'], $matches)
) {
// this is a compact notation element, add to next block and parse
@ -108,7 +107,7 @@ class Parser
$block = $values['value'];
if ($this->isNextLineIndented()) {
$block .= "\n".$this->getNextEmbedBlock($this->getCurrentLineIndentation() + 2);
$block .= "\n".$this->getNextEmbedBlock($this->getCurrentLineIndentation() + strlen($values['leadspaces']) + 1);
}
$data[] = $parser->parse($block, $exceptionOnInvalidType, $objectSupport, $objectForMap);
@ -349,7 +348,14 @@ class Parser
$newIndent = $indentation;
}
$data = array(substr($this->currentLine, $newIndent));
$data = array();
if ($this->getCurrentLineIndentation() >= $newIndent) {
$data[] = substr($this->currentLine, $newIndent);
} else {
$this->moveToPreviousLine();
return;
}
if ($inSequence && $oldLineIndentation === $newIndent && '-' === $data[0][0]) {
// the previous line contained a dash but no item content, this line is a sequence item with the same indentation
@ -372,7 +378,7 @@ class Parser
$removeComments = !preg_match($removeCommentsPattern, $this->currentLine);
}
if ($isItUnindentedCollection && !$this->isStringUnIndentedCollectionItem($this->currentLine)) {
if ($isItUnindentedCollection && !$this->isStringUnIndentedCollectionItem($this->currentLine) && $newIndent === $indent) {
$this->moveToPreviousLine();
break;
}
@ -623,7 +629,7 @@ class Parser
// strip YAML header
$count = 0;
$value = preg_replace('#^\%YAML[: ][\d\.]+.*\n#su', '', $value, -1, $count);
$value = preg_replace('#^\%YAML[: ][\d\.]+.*\n#u', '', $value, -1, $count);
$this->offset += $count;
// remove leading comments

@ -60,3 +60,23 @@ yaml: |
foo: bar
php: |
array('collection' => array('key' => array('a', 'b', 'c'), 'foo' => 'bar'))
---
test: Shortcut Key after unindented collection
brief: >
Key/value after unindented collection
yaml: |
collection:
- key: foo
foo: bar
php: |
array('collection' => array(array('key' => 'foo', 'foo' => 'bar')))
---
test: Shortcut Key after unindented collection with custom spaces
brief: >
Key/value after unindented collection
yaml: |
collection:
- key: foo
foo: bar
php: |
array('collection' => array(array('key' => 'foo', 'foo' => 'bar')))

@ -194,6 +194,14 @@ class InlineTest extends \PHPUnit_Framework_TestCase
array("'#cfcfcf'", '#cfcfcf'),
array('::form_base.html.twig', '::form_base.html.twig'),
// Pre-YAML-1.2 booleans
array("'y'", 'y'),
array("'n'", 'n'),
array("'yes'", 'yes'),
array("'no'", 'no'),
array("'on'", 'on'),
array("'off'", 'off'),
array('2007-10-30', mktime(0, 0, 0, 10, 30, 2007)),
array('2007-10-30T02:59:43Z', gmmktime(2, 59, 43, 10, 30, 2007)),
array('2007-10-30 02:59:43 Z', gmmktime(2, 59, 43, 10, 30, 2007)),
@ -339,6 +347,14 @@ class InlineTest extends \PHPUnit_Framework_TestCase
array("'-dash'", '-dash'),
array("'-'", '-'),
// Pre-YAML-1.2 booleans
array("'y'", 'y'),
array("'n'", 'n'),
array("'yes'", 'yes'),
array("'no'", 'no'),
array("'on'", 'on'),
array("'off'", 'off'),
// sequences
array('[foo, bar, false, null, 12]', array('foo', 'bar', false, null, 12)),
array('[\'foo,bar\', \'foo bar\']', array('foo,bar', 'foo bar')),

@ -475,6 +475,22 @@ collection:
-item2
-item3
EOF;
$this->parser->parse($yaml);
}
/**
* @expectedException \Symfony\Component\Yaml\Exception\ParseException
*/
public function testShortcutKeyUnindentedCollectionException()
{
$yaml = <<<EOF
collection:
- key: foo
foo: bar
EOF;
$this->parser->parse($yaml);
@ -697,6 +713,17 @@ map_in_map: { foo: { bar: *var } }
EOF
));
}
public function testYamlDirective()
{
$yaml = <<<EOF
%YAML 1.2
---
foo: 1
bar: 2
EOF;
$this->assertEquals(array('foo' => 1, 'bar' => 2), $this->parser->parse($yaml));
}
}
class B

Loading…
Cancel
Save