Scrollreveal+cat+datenews

This commit is contained in:
2019-01-07 11:43:39 +01:00
parent e4cac3d01e
commit 762a1ad170
3158 changed files with 140699 additions and 73915 deletions
+1 -1
View File
@@ -4,4 +4,4 @@
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInite06b0f4c0ece9f0782a1eed117593fd5::getLoader();
return ComposerAutoloaderInit29f7a49da74dabb04fcb876e0192cfad::getLoader();
+1 -1
View File
@@ -279,7 +279,7 @@ class ClassLoader
*/
public function setApcuPrefix($apcuPrefix)
{
$this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
}
/**
+2
View File
@@ -204,6 +204,7 @@ return array(
'Grav\\Common\\Processors\\TasksProcessor' => $baseDir . '/system/src/Grav/Common/Processors/TasksProcessor.php',
'Grav\\Common\\Processors\\ThemesProcessor' => $baseDir . '/system/src/Grav/Common/Processors/ThemesProcessor.php',
'Grav\\Common\\Processors\\TwigProcessor' => $baseDir . '/system/src/Grav/Common/Processors/TwigProcessor.php',
'Grav\\Common\\Security' => $baseDir . '/system/src/Grav/Common/Security.php',
'Grav\\Common\\Service\\AssetsServiceProvider' => $baseDir . '/system/src/Grav/Common/Service/AssetsServiceProvider.php',
'Grav\\Common\\Service\\ConfigServiceProvider' => $baseDir . '/system/src/Grav/Common/Service/ConfigServiceProvider.php',
'Grav\\Common\\Service\\ErrorServiceProvider' => $baseDir . '/system/src/Grav/Common/Service/ErrorServiceProvider.php',
@@ -244,6 +245,7 @@ return array(
'Grav\\Console\\Cli\\InstallCommand' => $baseDir . '/system/src/Grav/Console/Cli/InstallCommand.php',
'Grav\\Console\\Cli\\NewProjectCommand' => $baseDir . '/system/src/Grav/Console/Cli/NewProjectCommand.php',
'Grav\\Console\\Cli\\SandboxCommand' => $baseDir . '/system/src/Grav/Console/Cli/SandboxCommand.php',
'Grav\\Console\\Cli\\SecurityCommand' => $baseDir . '/system/src/Grav/Console/Cli/SecurityCommand.php',
'Grav\\Console\\ConsoleCommand' => $baseDir . '/system/src/Grav/Console/ConsoleCommand.php',
'Grav\\Console\\ConsoleTrait' => $baseDir . '/system/src/Grav/Console/ConsoleTrait.php',
'Grav\\Console\\Gpm\\DirectInstallCommand' => $baseDir . '/system/src/Grav/Console/Gpm/DirectInstallCommand.php',
+7 -7
View File
@@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInite06b0f4c0ece9f0782a1eed117593fd5
class ComposerAutoloaderInit29f7a49da74dabb04fcb876e0192cfad
{
private static $loader;
@@ -19,15 +19,15 @@ class ComposerAutoloaderInite06b0f4c0ece9f0782a1eed117593fd5
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInite06b0f4c0ece9f0782a1eed117593fd5', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit29f7a49da74dabb04fcb876e0192cfad', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInite06b0f4c0ece9f0782a1eed117593fd5', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit29f7a49da74dabb04fcb876e0192cfad', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInite06b0f4c0ece9f0782a1eed117593fd5::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit29f7a49da74dabb04fcb876e0192cfad::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
@@ -48,19 +48,19 @@ class ComposerAutoloaderInite06b0f4c0ece9f0782a1eed117593fd5
$loader->register(true);
if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInite06b0f4c0ece9f0782a1eed117593fd5::$files;
$includeFiles = Composer\Autoload\ComposerStaticInit29f7a49da74dabb04fcb876e0192cfad::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequiree06b0f4c0ece9f0782a1eed117593fd5($fileIdentifier, $file);
composerRequire29f7a49da74dabb04fcb876e0192cfad($fileIdentifier, $file);
}
return $loader;
}
}
function composerRequiree06b0f4c0ece9f0782a1eed117593fd5($fileIdentifier, $file)
function composerRequire29f7a49da74dabb04fcb876e0192cfad($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;
+8 -6
View File
@@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInite06b0f4c0ece9f0782a1eed117593fd5
class ComposerStaticInit29f7a49da74dabb04fcb876e0192cfad
{
public static $files = array (
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
@@ -467,6 +467,7 @@ class ComposerStaticInite06b0f4c0ece9f0782a1eed117593fd5
'Grav\\Common\\Processors\\TasksProcessor' => __DIR__ . '/../..' . '/system/src/Grav/Common/Processors/TasksProcessor.php',
'Grav\\Common\\Processors\\ThemesProcessor' => __DIR__ . '/../..' . '/system/src/Grav/Common/Processors/ThemesProcessor.php',
'Grav\\Common\\Processors\\TwigProcessor' => __DIR__ . '/../..' . '/system/src/Grav/Common/Processors/TwigProcessor.php',
'Grav\\Common\\Security' => __DIR__ . '/../..' . '/system/src/Grav/Common/Security.php',
'Grav\\Common\\Service\\AssetsServiceProvider' => __DIR__ . '/../..' . '/system/src/Grav/Common/Service/AssetsServiceProvider.php',
'Grav\\Common\\Service\\ConfigServiceProvider' => __DIR__ . '/../..' . '/system/src/Grav/Common/Service/ConfigServiceProvider.php',
'Grav\\Common\\Service\\ErrorServiceProvider' => __DIR__ . '/../..' . '/system/src/Grav/Common/Service/ErrorServiceProvider.php',
@@ -507,6 +508,7 @@ class ComposerStaticInite06b0f4c0ece9f0782a1eed117593fd5
'Grav\\Console\\Cli\\InstallCommand' => __DIR__ . '/../..' . '/system/src/Grav/Console/Cli/InstallCommand.php',
'Grav\\Console\\Cli\\NewProjectCommand' => __DIR__ . '/../..' . '/system/src/Grav/Console/Cli/NewProjectCommand.php',
'Grav\\Console\\Cli\\SandboxCommand' => __DIR__ . '/../..' . '/system/src/Grav/Console/Cli/SandboxCommand.php',
'Grav\\Console\\Cli\\SecurityCommand' => __DIR__ . '/../..' . '/system/src/Grav/Console/Cli/SecurityCommand.php',
'Grav\\Console\\ConsoleCommand' => __DIR__ . '/../..' . '/system/src/Grav/Console/ConsoleCommand.php',
'Grav\\Console\\ConsoleTrait' => __DIR__ . '/../..' . '/system/src/Grav/Console/ConsoleTrait.php',
'Grav\\Console\\Gpm\\DirectInstallCommand' => __DIR__ . '/../..' . '/system/src/Grav/Console/Gpm/DirectInstallCommand.php',
@@ -1445,11 +1447,11 @@ class ComposerStaticInite06b0f4c0ece9f0782a1eed117593fd5
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInite06b0f4c0ece9f0782a1eed117593fd5::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInite06b0f4c0ece9f0782a1eed117593fd5::$prefixDirsPsr4;
$loader->fallbackDirsPsr4 = ComposerStaticInite06b0f4c0ece9f0782a1eed117593fd5::$fallbackDirsPsr4;
$loader->prefixesPsr0 = ComposerStaticInite06b0f4c0ece9f0782a1eed117593fd5::$prefixesPsr0;
$loader->classMap = ComposerStaticInite06b0f4c0ece9f0782a1eed117593fd5::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit29f7a49da74dabb04fcb876e0192cfad::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit29f7a49da74dabb04fcb876e0192cfad::$prefixDirsPsr4;
$loader->fallbackDirsPsr4 = ComposerStaticInit29f7a49da74dabb04fcb876e0192cfad::$fallbackDirsPsr4;
$loader->prefixesPsr0 = ComposerStaticInit29f7a49da74dabb04fcb876e0192cfad::$prefixesPsr0;
$loader->classMap = ComposerStaticInit29f7a49da74dabb04fcb876e0192cfad::$classMap;
}, null, ClassLoader::class);
}
+33 -33
View File
@@ -392,17 +392,17 @@
},
{
"name": "filp/whoops",
"version": "2.2.0",
"version_normalized": "2.2.0.0",
"version": "2.2.1",
"version_normalized": "2.2.1.0",
"source": {
"type": "git",
"url": "https://github.com/filp/whoops.git",
"reference": "181c4502d8f34db7aed7bfe88d4f87875b8e947a"
"reference": "e79cd403fb77fc8963a99ecc30e80ddd885b3311"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/filp/whoops/zipball/181c4502d8f34db7aed7bfe88d4f87875b8e947a",
"reference": "181c4502d8f34db7aed7bfe88d4f87875b8e947a",
"url": "https://api.github.com/repos/filp/whoops/zipball/e79cd403fb77fc8963a99ecc30e80ddd885b3311",
"reference": "e79cd403fb77fc8963a99ecc30e80ddd885b3311",
"shasum": ""
},
"require": {
@@ -418,11 +418,11 @@
"symfony/var-dumper": "Pretty print complex values better with var-dumper available",
"whoops/soap": "Formats errors as SOAP responses"
},
"time": "2018-03-03T17:56:25+00:00",
"time": "2018-06-30T13:14:06+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.1-dev"
"dev-master": "2.2-dev"
}
},
"installation-source": "dist",
@@ -1352,17 +1352,17 @@
},
{
"name": "symfony/console",
"version": "v3.4.14",
"version_normalized": "3.4.14.0",
"version": "v3.4.17",
"version_normalized": "3.4.17.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "6b217594552b9323bcdcfc14f8a0ce126e84cd73"
"reference": "3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/6b217594552b9323bcdcfc14f8a0ce126e84cd73",
"reference": "6b217594552b9323bcdcfc14f8a0ce126e84cd73",
"url": "https://api.github.com/repos/symfony/console/zipball/3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b",
"reference": "3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b",
"shasum": ""
},
"require": {
@@ -1388,7 +1388,7 @@
"symfony/lock": "",
"symfony/process": ""
},
"time": "2018-07-26T11:19:56+00:00",
"time": "2018-10-02T16:33:53+00:00",
"type": "library",
"extra": {
"branch-alias": {
@@ -1423,17 +1423,17 @@
},
{
"name": "symfony/debug",
"version": "v3.4.14",
"version_normalized": "3.4.14.0",
"version": "v3.4.17",
"version_normalized": "3.4.17.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
"reference": "d5a058ff6ecad26b30c1ba452241306ea34c65cc"
"reference": "0a612e9dfbd2ccce03eb174365f31ecdca930ff6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/debug/zipball/d5a058ff6ecad26b30c1ba452241306ea34c65cc",
"reference": "d5a058ff6ecad26b30c1ba452241306ea34c65cc",
"url": "https://api.github.com/repos/symfony/debug/zipball/0a612e9dfbd2ccce03eb174365f31ecdca930ff6",
"reference": "0a612e9dfbd2ccce03eb174365f31ecdca930ff6",
"shasum": ""
},
"require": {
@@ -1446,7 +1446,7 @@
"require-dev": {
"symfony/http-kernel": "~2.8|~3.0|~4.0"
},
"time": "2018-07-26T11:19:56+00:00",
"time": "2018-10-02T16:33:53+00:00",
"type": "library",
"extra": {
"branch-alias": {
@@ -1481,8 +1481,8 @@
},
{
"name": "symfony/event-dispatcher",
"version": "v3.4.14",
"version_normalized": "3.4.14.0",
"version": "v3.4.17",
"version_normalized": "3.4.17.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
@@ -1728,17 +1728,17 @@
},
{
"name": "symfony/var-dumper",
"version": "v3.4.14",
"version_normalized": "3.4.14.0",
"version": "v3.4.17",
"version_normalized": "3.4.17.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
"reference": "f62a394bd3de96f2f5e8f4c7d685035897fb3cb3"
"reference": "ff8ac19e97e5c7c3979236b584719a1190f84181"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/f62a394bd3de96f2f5e8f4c7d685035897fb3cb3",
"reference": "f62a394bd3de96f2f5e8f4c7d685035897fb3cb3",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/ff8ac19e97e5c7c3979236b584719a1190f84181",
"reference": "ff8ac19e97e5c7c3979236b584719a1190f84181",
"shasum": ""
},
"require": {
@@ -1757,7 +1757,7 @@
"ext-intl": "To show region name in time zone dump",
"ext-symfony_debug": ""
},
"time": "2018-07-26T11:19:56+00:00",
"time": "2018-10-02T16:33:53+00:00",
"type": "library",
"extra": {
"branch-alias": {
@@ -1799,17 +1799,17 @@
},
{
"name": "symfony/yaml",
"version": "v3.4.14",
"version_normalized": "3.4.14.0",
"version": "v3.4.17",
"version_normalized": "3.4.17.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "810af2d35fc72b6cf5c01116806d2b65ccaaf2e2"
"reference": "640b6c27fed4066d64b64d5903a86043f4a4de7f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/810af2d35fc72b6cf5c01116806d2b65ccaaf2e2",
"reference": "810af2d35fc72b6cf5c01116806d2b65ccaaf2e2",
"url": "https://api.github.com/repos/symfony/yaml/zipball/640b6c27fed4066d64b64d5903a86043f4a4de7f",
"reference": "640b6c27fed4066d64b64d5903a86043f4a4de7f",
"shasum": ""
},
"require": {
@@ -1825,7 +1825,7 @@
"suggest": {
"symfony/console": "For validating YAML files using the lint command"
},
"time": "2018-07-26T11:19:56+00:00",
"time": "2018-10-02T16:33:53+00:00",
"type": "library",
"extra": {
"branch-alias": {
+4
View File
@@ -1,3 +1,7 @@
# 2.2.0
* Support PHP 7.2
# 2.1.0
* Add a `SystemFacade` to allow clients to override Whoops behavior.
@@ -507,6 +507,10 @@ class PrettyPageHandler extends Handler
$callback = call_user_func($this->editors[$this->editor], $filePath, $line);
}
if (empty($callback)) {
return [];
}
if (is_string($callback)) {
return [
'ajax' => false,
@@ -0,0 +1,16 @@
CREATE TABLE phpdebugbar (
id TEXT PRIMARY KEY,
data TEXT,
meta_utime TEXT,
meta_datetime TEXT,
meta_uri TEXT,
meta_ip TEXT,
meta_method TEXT
);
CREATE INDEX idx_debugbar_id ON phpdebugbar (id);
CREATE INDEX idx_debugbar_meta_utime ON phpdebugbar (meta_utime);
CREATE INDEX idx_debugbar_meta_datetime ON phpdebugbar (meta_datetime);
CREATE INDEX idx_debugbar_meta_uri ON phpdebugbar (meta_uri);
CREATE INDEX idx_debugbar_meta_ip ON phpdebugbar (meta_ip);
CREATE INDEX idx_debugbar_meta_method ON phpdebugbar (meta_method);
Binary file not shown.
+6 -2
View File
@@ -150,7 +150,7 @@ class Command
* execute() method, you set the code to execute by passing
* a Closure to the setCode() method.
*
* @return null|int null or 0 if everything went fine, or an error code
* @return int|null null or 0 if everything went fine, or an error code
*
* @throws LogicException When this abstract method is not implemented
*
@@ -173,10 +173,14 @@ class Command
}
/**
* Initializes the command just after the input has been validated.
* Initializes the command after the input has been bound and before the input
* is validated.
*
* This is mainly useful when a lot of commands extends one main command
* where some things need to be initialized based on the input arguments and options.
*
* @see InputInterface::bind()
* @see InputInterface::validate()
*/
protected function initialize(InputInterface $input, OutputInterface $output)
{
+4 -20
View File
@@ -90,11 +90,7 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
}
if (!isset(static::$availableForegroundColors[$color])) {
throw new InvalidArgumentException(sprintf(
'Invalid foreground color specified: "%s". Expected one of (%s)',
$color,
implode(', ', array_keys(static::$availableForegroundColors))
));
throw new InvalidArgumentException(sprintf('Invalid foreground color specified: "%s". Expected one of (%s)', $color, implode(', ', array_keys(static::$availableForegroundColors))));
}
$this->foreground = static::$availableForegroundColors[$color];
@@ -116,11 +112,7 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
}
if (!isset(static::$availableBackgroundColors[$color])) {
throw new InvalidArgumentException(sprintf(
'Invalid background color specified: "%s". Expected one of (%s)',
$color,
implode(', ', array_keys(static::$availableBackgroundColors))
));
throw new InvalidArgumentException(sprintf('Invalid background color specified: "%s". Expected one of (%s)', $color, implode(', ', array_keys(static::$availableBackgroundColors))));
}
$this->background = static::$availableBackgroundColors[$color];
@@ -136,11 +128,7 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
public function setOption($option)
{
if (!isset(static::$availableOptions[$option])) {
throw new InvalidArgumentException(sprintf(
'Invalid option specified: "%s". Expected one of (%s)',
$option,
implode(', ', array_keys(static::$availableOptions))
));
throw new InvalidArgumentException(sprintf('Invalid option specified: "%s". Expected one of (%s)', $option, implode(', ', array_keys(static::$availableOptions))));
}
if (!\in_array(static::$availableOptions[$option], $this->options)) {
@@ -158,11 +146,7 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
public function unsetOption($option)
{
if (!isset(static::$availableOptions[$option])) {
throw new InvalidArgumentException(sprintf(
'Invalid option specified: "%s". Expected one of (%s)',
$option,
implode(', ', array_keys(static::$availableOptions))
));
throw new InvalidArgumentException(sprintf('Invalid option specified: "%s". Expected one of (%s)', $option, implode(', ', array_keys(static::$availableOptions))));
}
$pos = array_search(static::$availableOptions[$option], $this->options);
+1 -1
View File
@@ -130,7 +130,7 @@ class QuestionHelper extends Helper
/**
* Asks the question to the user.
*
* @return bool|mixed|null|string
* @return bool|mixed|string|null
*
* @throws RuntimeException In case the fallback is deactivated and the response cannot be hidden
*/
+1 -1
View File
@@ -86,7 +86,7 @@ class SymfonyQuestionHelper extends QuestionHelper
case $question instanceof ChoiceQuestion:
$choices = $question->getChoices();
$text = sprintf(' <info>%s</info> [<comment>%s</comment>]:', $text, OutputFormatter::escape($choices[$default]));
$text = sprintf(' <info>%s</info> [<comment>%s</comment>]:', $text, OutputFormatter::escape(isset($choices[$default]) ? $choices[$default] : $default));
break;
+16 -13
View File
@@ -263,15 +263,14 @@ class Table
* Renders table to output.
*
* Example:
* <code>
* +---------------+-----------------------+------------------+
* | ISBN | Title | Author |
* +---------------+-----------------------+------------------+
* | 99921-58-10-7 | Divine Comedy | Dante Alighieri |
* | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens |
* | 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien |
* +---------------+-----------------------+------------------+
* </code>
*
* +---------------+-----------------------+------------------+
* | ISBN | Title | Author |
* +---------------+-----------------------+------------------+
* | 99921-58-10-7 | Divine Comedy | Dante Alighieri |
* | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens |
* | 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien |
* +---------------+-----------------------+------------------+
*/
public function render()
{
@@ -305,7 +304,9 @@ class Table
/**
* Renders horizontal header separator.
*
* Example: <code>+-----+-----------+-------+</code>
* Example:
*
* +-----+-----------+-------+
*/
private function renderRowSeparator()
{
@@ -336,7 +337,9 @@ class Table
/**
* Renders table row.
*
* Example: <code>| 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens |</code>
* Example:
*
* | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens |
*
* @param array $row
* @param string $cellFormat
@@ -609,7 +612,7 @@ class Table
$lengths[] = $this->getCellWidth($row, $column);
}
$this->effectiveColumnWidths[$column] = max($lengths) + \strlen($this->style->getCellRowContentFormat()) - 2;
$this->effectiveColumnWidths[$column] = max($lengths) + Helper::strlen($this->style->getCellRowContentFormat()) - 2;
}
}
@@ -620,7 +623,7 @@ class Table
*/
private function getColumnSeparatorWidth()
{
return \strlen(sprintf($this->style->getBorderFormat(), $this->style->getVerticalBorderChar()));
return Helper::strlen(sprintf($this->style->getBorderFormat(), $this->style->getVerticalBorderChar()));
}
/**
+2 -1
View File
@@ -121,7 +121,8 @@ class ArgvInput extends Input
$len = \strlen($name);
for ($i = 0; $i < $len; ++$i) {
if (!$this->definition->hasShortcut($name[$i])) {
throw new RuntimeException(sprintf('The "-%s" option does not exist.', $name[$i]));
$encoding = mb_detect_encoding($name, null, true);
throw new RuntimeException(sprintf('The "-%s" option does not exist.', false === $encoding ? $name[$i] : mb_substr($name, $i, 1, $encoding)));
}
$option = $this->definition->getOptionForShortcut($name[$i]);
+6 -6
View File
@@ -31,10 +31,10 @@ class InputArgument
private $description;
/**
* @param string $name The argument name
* @param int $mode The argument mode: self::REQUIRED or self::OPTIONAL
* @param string $description A description text
* @param mixed $default The default value (for self::OPTIONAL mode only)
* @param string $name The argument name
* @param int|null $mode The argument mode: self::REQUIRED or self::OPTIONAL
* @param string $description A description text
* @param string|string[]|null $default The default value (for self::OPTIONAL mode only)
*
* @throws InvalidArgumentException When argument mode is not valid
*/
@@ -86,7 +86,7 @@ class InputArgument
/**
* Sets the default value.
*
* @param mixed $default The default value
* @param string|string[]|null $default The default value
*
* @throws LogicException When incorrect default value is given
*/
@@ -110,7 +110,7 @@ class InputArgument
/**
* Returns the default value.
*
* @return mixed The default value
* @return string|string[]|null The default value
*/
public function getDefault()
{
+3 -3
View File
@@ -20,8 +20,8 @@ use Symfony\Component\Console\Exception\LogicException;
* Usage:
*
* $definition = new InputDefinition(array(
* new InputArgument('name', InputArgument::REQUIRED),
* new InputOption('foo', 'f', InputOption::VALUE_REQUIRED),
* new InputArgument('name', InputArgument::REQUIRED),
* new InputOption('foo', 'f', InputOption::VALUE_REQUIRED),
* ));
*
* @author Fabien Potencier <fabien@symfony.com>
@@ -387,7 +387,7 @@ class InputDefinition
if (!$argument->isRequired()) {
$element = '['.$element.']';
} elseif ($argument->isArray()) {
$element = $element.' ('.$element.')';
$element .= ' ('.$element.')';
}
if ($argument->isArray()) {
+8 -6
View File
@@ -61,6 +61,8 @@ interface InputInterface
/**
* Binds the current Input instance with the given arguments and options.
*
* @throws RuntimeException
*/
public function bind(InputDefinition $definition);
@@ -83,7 +85,7 @@ interface InputInterface
*
* @param string $name The argument name
*
* @return mixed The argument value
* @return string|string[]|null The argument value
*
* @throws InvalidArgumentException When argument given doesn't exist
*/
@@ -92,8 +94,8 @@ interface InputInterface
/**
* Sets an argument value by name.
*
* @param string $name The argument name
* @param string $value The argument value
* @param string $name The argument name
* @param string|string[]|null $value The argument value
*
* @throws InvalidArgumentException When argument given doesn't exist
*/
@@ -120,7 +122,7 @@ interface InputInterface
*
* @param string $name The option name
*
* @return mixed The option value
* @return string|string[]|bool|null The option value
*
* @throws InvalidArgumentException When option given doesn't exist
*/
@@ -129,8 +131,8 @@ interface InputInterface
/**
* Sets an option value by name.
*
* @param string $name The option name
* @param string|bool $value The option value
* @param string $name The option name
* @param string|string[]|bool|null $value The option value
*
* @throws InvalidArgumentException When option given doesn't exist
*/
+7 -7
View File
@@ -33,11 +33,11 @@ class InputOption
private $description;
/**
* @param string $name The option name
* @param string|array $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
* @param int $mode The option mode: One of the VALUE_* constants
* @param string $description A description text
* @param mixed $default The default value (must be null for self::VALUE_NONE)
* @param string $name The option name
* @param string|array $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
* @param int|null $mode The option mode: One of the VALUE_* constants
* @param string $description A description text
* @param string|string[]|bool|null $default The default value (must be null for self::VALUE_NONE)
*
* @throws InvalidArgumentException If option mode is invalid or incompatible
*/
@@ -149,7 +149,7 @@ class InputOption
/**
* Sets the default value.
*
* @param mixed $default The default value
* @param string|string[]|bool|null $default The default value
*
* @throws LogicException When incorrect default value is given
*/
@@ -173,7 +173,7 @@ class InputOption
/**
* Returns the default value.
*
* @return mixed The default value
* @return string|string[]|bool|null The default value
*/
public function getDefault()
{
+2 -2
View File
@@ -20,11 +20,11 @@ use Symfony\Component\Console\Formatter\OutputFormatterInterface;
*
* Usage:
*
* $output = new StreamOutput(fopen('php://stdout', 'w'));
* $output = new StreamOutput(fopen('php://stdout', 'w'));
*
* As `StreamOutput` can use any stream, you can also use a file:
*
* $output = new StreamOutput(fopen('/path/to/output.log', 'a', false));
* $output = new StreamOutput(fopen('/path/to/output.log', 'a', false));
*
* @author Fabien Potencier <fabien@symfony.com>
*/
+6 -6
View File
@@ -117,7 +117,7 @@ class Question
/**
* Gets values for the autocompleter.
*
* @return null|iterable
* @return iterable|null
*/
public function getAutocompleterValues()
{
@@ -127,7 +127,7 @@ class Question
/**
* Sets values for the autocompleter.
*
* @param null|iterable $values
* @param iterable|null $values
*
* @return $this
*
@@ -156,7 +156,7 @@ class Question
/**
* Sets a validator for the question.
*
* @param null|callable $validator
* @param callable|null $validator
*
* @return $this
*/
@@ -170,7 +170,7 @@ class Question
/**
* Gets the validator for the question.
*
* @return null|callable
* @return callable|null
*/
public function getValidator()
{
@@ -182,7 +182,7 @@ class Question
*
* Null means an unlimited number of attempts.
*
* @param null|int $attempts
* @param int|null $attempts
*
* @return $this
*
@@ -204,7 +204,7 @@ class Question
*
* Null means an unlimited number of attempts.
*
* @return null|int
* @return int|null
*/
public function getMaxAttempts()
{
Binary file not shown.
+206 -181
View File
@@ -129,8 +129,6 @@ class DebugClassLoader
*
* @param string $class The name of the class
*
* @return bool|null True, if loaded
*
* @throws \RuntimeException
*/
public function loadClass($class)
@@ -184,200 +182,227 @@ class DebugClassLoader
throw new \RuntimeException(sprintf('Case mismatch between loaded and declared class names: "%s" vs "%s".', $class, $name));
}
// Don't trigger deprecations for classes in the same vendor
if (2 > $len = 1 + (\strpos($name, '\\') ?: \strpos($name, '_'))) {
$len = 0;
$ns = '';
} else {
$ns = \substr($name, 0, $len);
}
// Detect annotations on the class
if (false !== $doc = $refl->getDocComment()) {
foreach (array('final', 'deprecated', 'internal') as $annotation) {
if (false !== \strpos($doc, $annotation) && preg_match('#\n \* @'.$annotation.'(?:( .+?)\.?)?\r?\n \*(?: @|/$)#s', $doc, $notice)) {
self::${$annotation}[$name] = isset($notice[1]) ? preg_replace('#\s*\r?\n \* +#', ' ', $notice[1]) : '';
}
}
}
$parentAndTraits = \class_uses($name, false);
if ($parent = \get_parent_class($class)) {
$parentAndTraits[] = $parent;
if (!isset(self::$checkedClasses[$parent])) {
$this->checkClass($parent);
}
if (isset(self::$final[$parent])) {
@trigger_error(sprintf('The "%s" class is considered final%s. It may change without further notice as of its next major version. You should not extend it from "%s".', $parent, self::$final[$parent], $name), E_USER_DEPRECATED);
}
}
// Detect if the parent is annotated
foreach ($parentAndTraits + $this->getOwnInterfaces($name, $parent) as $use) {
if (!isset(self::$checkedClasses[$use])) {
$this->checkClass($use);
}
if (isset(self::$deprecated[$use]) && \strncmp($ns, $use, $len)) {
$type = class_exists($name, false) ? 'class' : (interface_exists($name, false) ? 'interface' : 'trait');
$verb = class_exists($use, false) || interface_exists($name, false) ? 'extends' : (interface_exists($use, false) ? 'implements' : 'uses');
@trigger_error(sprintf('The "%s" %s %s "%s" that is deprecated%s.', $name, $type, $verb, $use, self::$deprecated[$use]), E_USER_DEPRECATED);
}
if (isset(self::$internal[$use]) && \strncmp($ns, $use, $len)) {
@trigger_error(sprintf('The "%s" %s is considered internal%s. It may change without further notice. You should not use it from "%s".', $use, class_exists($use, false) ? 'class' : (interface_exists($use, false) ? 'interface' : 'trait'), self::$internal[$use], $name), E_USER_DEPRECATED);
}
}
// Inherit @final and @internal annotations for methods
self::$finalMethods[$name] = array();
self::$internalMethods[$name] = array();
foreach ($parentAndTraits as $use) {
foreach (array('finalMethods', 'internalMethods') as $property) {
if (isset(self::${$property}[$use])) {
self::${$property}[$name] = self::${$property}[$name] ? self::${$property}[$use] + self::${$property}[$name] : self::${$property}[$use];
}
}
}
$isClass = \class_exists($name, false);
foreach ($refl->getMethods(\ReflectionMethod::IS_PUBLIC | \ReflectionMethod::IS_PROTECTED) as $method) {
if ($method->class !== $name) {
continue;
}
// Method from a trait
if ($method->getFilename() !== $refl->getFileName()) {
continue;
}
if ($isClass && $parent && isset(self::$finalMethods[$parent][$method->name])) {
list($declaringClass, $message) = self::$finalMethods[$parent][$method->name];
@trigger_error(sprintf('The "%s::%s()" method is considered final%s. It may change without further notice as of its next major version. You should not extend it from "%s".', $declaringClass, $method->name, $message, $name), E_USER_DEPRECATED);
}
foreach ($parentAndTraits as $use) {
if (isset(self::$internalMethods[$use][$method->name])) {
list($declaringClass, $message) = self::$internalMethods[$use][$method->name];
if (\strncmp($ns, $declaringClass, $len)) {
@trigger_error(sprintf('The "%s::%s()" method is considered internal%s. It may change without further notice. You should not extend it from "%s".', $declaringClass, $method->name, $message, $name), E_USER_DEPRECATED);
}
}
}
// Detect method annotations
if (false === $doc = $method->getDocComment()) {
continue;
}
foreach (array('final', 'internal') as $annotation) {
if (false !== \strpos($doc, $annotation) && preg_match('#\n\s+\* @'.$annotation.'(?:( .+?)\.?)?\r?\n\s+\*(?: @|/$)#s', $doc, $notice)) {
$message = isset($notice[1]) ? preg_replace('#\s*\r?\n \* +#', ' ', $notice[1]) : '';
self::${$annotation.'Methods'}[$name][$method->name] = array($name, $message);
}
}
}
$deprecations = $this->checkAnnotations($refl, $name);
if (isset(self::$php7Reserved[\strtolower($refl->getShortName())])) {
@trigger_error(sprintf('The "%s" class uses the reserved name "%s", it will break on PHP 7 and higher', $name, $refl->getShortName()), E_USER_DEPRECATED);
$deprecations[] = sprintf('The "%s" class uses the reserved name "%s", it will break on PHP 7 and higher', $name, $refl->getShortName());
}
foreach ($deprecations as $message) {
@trigger_error($message, E_USER_DEPRECATED);
}
}
if ($file) {
if (!$exists) {
if (false !== strpos($class, '/')) {
throw new \RuntimeException(sprintf('Trying to autoload a class with an invalid name "%s". Be careful that the namespace separator is "\" in PHP, not "/".', $class));
}
if (!$file) {
return;
}
throw new \RuntimeException(sprintf('The autoloader expected class "%s" to be defined in file "%s". The file was found but the class was not in it, the class name or namespace probably has a typo.', $class, $file));
if (!$exists) {
if (false !== strpos($class, '/')) {
throw new \RuntimeException(sprintf('Trying to autoload a class with an invalid name "%s". Be careful that the namespace separator is "\" in PHP, not "/".', $class));
}
if (self::$caseCheck) {
$real = explode('\\', $class.strrchr($file, '.'));
$tail = explode(\DIRECTORY_SEPARATOR, str_replace('/', \DIRECTORY_SEPARATOR, $file));
$i = \count($tail) - 1;
$j = \count($real) - 1;
throw new \RuntimeException(sprintf('The autoloader expected class "%s" to be defined in file "%s". The file was found but the class was not in it, the class name or namespace probably has a typo.', $class, $file));
}
while (isset($tail[$i], $real[$j]) && $tail[$i] === $real[$j]) {
--$i;
--$j;
}
if (self::$caseCheck && $message = $this->checkCase($refl, $file, $class)) {
throw new \RuntimeException(sprintf('Case mismatch between class and real file names: "%s" vs "%s" in "%s".', $message[0], $message[1], $message[2]));
}
}
array_splice($tail, 0, $i + 1);
}
if (self::$caseCheck && $tail) {
$tail = \DIRECTORY_SEPARATOR.implode(\DIRECTORY_SEPARATOR, $tail);
$tailLen = \strlen($tail);
$real = $refl->getFileName();
public function checkAnnotations(\ReflectionClass $refl, $class)
{
$deprecations = array();
if (2 === self::$caseCheck) {
// realpath() on MacOSX doesn't normalize the case of characters
// Don't trigger deprecations for classes in the same vendor
if (2 > $len = 1 + (\strpos($class, '\\') ?: \strpos($class, '_'))) {
$len = 0;
$ns = '';
} else {
$ns = \substr($class, 0, $len);
}
$i = 1 + strrpos($real, '/');
$file = substr($real, $i);
$real = substr($real, 0, $i);
if (isset(self::$darwinCache[$real])) {
$kDir = $real;
} else {
$kDir = strtolower($real);
if (isset(self::$darwinCache[$kDir])) {
$real = self::$darwinCache[$kDir][0];
} else {
$dir = getcwd();
chdir($real);
$real = getcwd().'/';
chdir($dir);
$dir = $real;
$k = $kDir;
$i = \strlen($dir) - 1;
while (!isset(self::$darwinCache[$k])) {
self::$darwinCache[$k] = array($dir, array());
self::$darwinCache[$dir] = &self::$darwinCache[$k];
while ('/' !== $dir[--$i]) {
}
$k = substr($k, 0, ++$i);
$dir = substr($dir, 0, $i--);
}
}
}
$dirFiles = self::$darwinCache[$kDir][1];
if (isset($dirFiles[$file])) {
$kFile = $file;
} else {
$kFile = strtolower($file);
if (!isset($dirFiles[$kFile])) {
foreach (scandir($real, 2) as $f) {
if ('.' !== $f[0]) {
$dirFiles[$f] = $f;
if ($f === $file) {
$kFile = $k = $file;
} elseif ($f !== $k = strtolower($f)) {
$dirFiles[$k] = $f;
}
}
}
self::$darwinCache[$kDir][1] = $dirFiles;
}
}
$real .= $dirFiles[$kFile];
}
if (0 === substr_compare($real, $tail, -$tailLen, $tailLen, true)
&& 0 !== substr_compare($real, $tail, -$tailLen, $tailLen, false)
) {
throw new \RuntimeException(sprintf('Case mismatch between class and real file names: "%s" vs "%s" in "%s".', substr($tail, -$tailLen + 1), substr($real, -$tailLen + 1), substr($real, 0, -$tailLen + 1)));
// Detect annotations on the class
if (false !== $doc = $refl->getDocComment()) {
foreach (array('final', 'deprecated', 'internal') as $annotation) {
if (false !== \strpos($doc, $annotation) && preg_match('#\n \* @'.$annotation.'(?:( .+?)\.?)?\r?\n \*(?: @|/$)#s', $doc, $notice)) {
self::${$annotation}[$class] = isset($notice[1]) ? preg_replace('#\s*\r?\n \* +#', ' ', $notice[1]) : '';
}
}
}
$parent = \get_parent_class($class);
$parentAndOwnInterfaces = $this->getOwnInterfaces($class, $parent);
if ($parent) {
$parentAndOwnInterfaces[$parent] = $parent;
if (!isset(self::$checkedClasses[$parent])) {
$this->checkClass($parent);
}
if (isset(self::$final[$parent])) {
$deprecations[] = sprintf('The "%s" class is considered final%s. It may change without further notice as of its next major version. You should not extend it from "%s".', $parent, self::$final[$parent], $class);
}
}
// Detect if the parent is annotated
foreach ($parentAndOwnInterfaces + \class_uses($class, false) as $use) {
if (!isset(self::$checkedClasses[$use])) {
$this->checkClass($use);
}
if (isset(self::$deprecated[$use]) && \strncmp($ns, $use, $len)) {
$type = class_exists($class, false) ? 'class' : (interface_exists($class, false) ? 'interface' : 'trait');
$verb = class_exists($use, false) || interface_exists($class, false) ? 'extends' : (interface_exists($use, false) ? 'implements' : 'uses');
$deprecations[] = sprintf('The "%s" %s %s "%s" that is deprecated%s.', $class, $type, $verb, $use, self::$deprecated[$use]);
}
if (isset(self::$internal[$use]) && \strncmp($ns, $use, $len)) {
$deprecations[] = sprintf('The "%s" %s is considered internal%s. It may change without further notice. You should not use it from "%s".', $use, class_exists($use, false) ? 'class' : (interface_exists($use, false) ? 'interface' : 'trait'), self::$internal[$use], $class);
}
}
if (\trait_exists($class)) {
return $deprecations;
}
// Inherit @final and @internal annotations for methods
self::$finalMethods[$class] = array();
self::$internalMethods[$class] = array();
foreach ($parentAndOwnInterfaces as $use) {
foreach (array('finalMethods', 'internalMethods') as $property) {
if (isset(self::${$property}[$use])) {
self::${$property}[$class] = self::${$property}[$class] ? self::${$property}[$use] + self::${$property}[$class] : self::${$property}[$use];
}
}
}
foreach ($refl->getMethods(\ReflectionMethod::IS_PUBLIC | \ReflectionMethod::IS_PROTECTED) as $method) {
if ($method->class !== $class) {
continue;
}
if ($parent && isset(self::$finalMethods[$parent][$method->name])) {
list($declaringClass, $message) = self::$finalMethods[$parent][$method->name];
$deprecations[] = sprintf('The "%s::%s()" method is considered final%s. It may change without further notice as of its next major version. You should not extend it from "%s".', $declaringClass, $method->name, $message, $class);
}
if (isset(self::$internalMethods[$class][$method->name])) {
list($declaringClass, $message) = self::$internalMethods[$class][$method->name];
if (\strncmp($ns, $declaringClass, $len)) {
$deprecations[] = sprintf('The "%s::%s()" method is considered internal%s. It may change without further notice. You should not extend it from "%s".', $declaringClass, $method->name, $message, $class);
}
}
// Detect method annotations
if (false === $doc = $method->getDocComment()) {
continue;
}
foreach (array('final', 'internal') as $annotation) {
if (false !== \strpos($doc, $annotation) && preg_match('#\n\s+\* @'.$annotation.'(?:( .+?)\.?)?\r?\n\s+\*(?: @|/$)#s', $doc, $notice)) {
$message = isset($notice[1]) ? preg_replace('#\s*\r?\n \* +#', ' ', $notice[1]) : '';
self::${$annotation.'Methods'}[$class][$method->name] = array($class, $message);
}
}
}
return $deprecations;
}
public function checkCase(\ReflectionClass $refl, $file, $class)
{
$real = explode('\\', $class.strrchr($file, '.'));
$tail = explode(\DIRECTORY_SEPARATOR, str_replace('/', \DIRECTORY_SEPARATOR, $file));
$i = \count($tail) - 1;
$j = \count($real) - 1;
while (isset($tail[$i], $real[$j]) && $tail[$i] === $real[$j]) {
--$i;
--$j;
}
array_splice($tail, 0, $i + 1);
if (!$tail) {
return;
}
$tail = \DIRECTORY_SEPARATOR.implode(\DIRECTORY_SEPARATOR, $tail);
$tailLen = \strlen($tail);
$real = $refl->getFileName();
if (2 === self::$caseCheck) {
$real = $this->darwinRealpath($real);
}
if (0 === substr_compare($real, $tail, -$tailLen, $tailLen, true)
&& 0 !== substr_compare($real, $tail, -$tailLen, $tailLen, false)
) {
return array(substr($tail, -$tailLen + 1), substr($real, -$tailLen + 1), substr($real, 0, -$tailLen + 1));
}
}
/**
* `realpath` on MacOSX doesn't normalize the case of characters.
*/
private function darwinRealpath($real)
{
$i = 1 + strrpos($real, '/');
$file = substr($real, $i);
$real = substr($real, 0, $i);
if (isset(self::$darwinCache[$real])) {
$kDir = $real;
} else {
$kDir = strtolower($real);
if (isset(self::$darwinCache[$kDir])) {
$real = self::$darwinCache[$kDir][0];
} else {
$dir = getcwd();
chdir($real);
$real = getcwd().'/';
chdir($dir);
$dir = $real;
$k = $kDir;
$i = \strlen($dir) - 1;
while (!isset(self::$darwinCache[$k])) {
self::$darwinCache[$k] = array($dir, array());
self::$darwinCache[$dir] = &self::$darwinCache[$k];
while ('/' !== $dir[--$i]) {
}
$k = substr($k, 0, ++$i);
$dir = substr($dir, 0, $i--);
}
}
}
$dirFiles = self::$darwinCache[$kDir][1];
if (isset($dirFiles[$file])) {
return $real .= $dirFiles[$file];
}
$kFile = strtolower($file);
if (!isset($dirFiles[$kFile])) {
foreach (scandir($real, 2) as $f) {
if ('.' !== $f[0]) {
$dirFiles[$f] = $f;
if ($f === $file) {
$kFile = $k = $file;
} elseif ($f !== $k = strtolower($f)) {
$dirFiles[$k] = $f;
}
}
}
self::$darwinCache[$kDir][1] = $dirFiles;
}
return $real .= $dirFiles[$kFile];
}
/**
+2 -2
View File
@@ -55,9 +55,9 @@ class LinkStub extends ConstStub
if ($composerRoot = $this->getComposerRoot($href, $this->inVendor)) {
$this->attr['ellipsis'] = \strlen($href) - \strlen($composerRoot) + 1;
$this->attr['ellipsis-type'] = 'path';
$this->attr['ellipsis-tail'] = 1 + ($this->inVendor ? 2 + \strlen(implode(\array_slice(explode(\DIRECTORY_SEPARATOR, substr($href, 1 - $this->attr['ellipsis'])), 0, 2))) : 0);
$this->attr['ellipsis-tail'] = 1 + ($this->inVendor ? 2 + \strlen(implode('', \array_slice(explode(\DIRECTORY_SEPARATOR, substr($href, 1 - $this->attr['ellipsis'])), 0, 2))) : 0);
} elseif (3 < \count($ellipsis = explode(\DIRECTORY_SEPARATOR, $href))) {
$this->attr['ellipsis'] = 2 + \strlen(implode(\array_slice($ellipsis, -2)));
$this->attr['ellipsis'] = 2 + \strlen(implode('', \array_slice($ellipsis, -2)));
$this->attr['ellipsis-type'] = 'path';
$this->attr['ellipsis-tail'] = 1;
}
+1 -1
View File
@@ -63,7 +63,7 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
/**
* @param bool $recursive Whether values should be resolved recursively or not
*
* @return string|int|float|bool|array|null|Data[] A native representation of the original value
* @return string|int|float|bool|array|Data[]|null A native representation of the original value
*/
public function getValue($recursive = false)
{
+2 -2
View File
@@ -17,8 +17,8 @@ if (!function_exists('dump')) {
*/
function dump($var)
{
foreach (func_get_args() as $var) {
VarDumper::dump($var);
foreach (func_get_args() as $v) {
VarDumper::dump($v);
}
if (1 < func_num_args()) {
+2 -2
View File
@@ -325,7 +325,7 @@ class Inline
if (null !== $delimiters) {
$tmp = ltrim(substr($scalar, $i), ' ');
if ('' === $tmp) {
throw new ParseException(sprintf('Unexpected end of line, expected one of "%s".', implode($delimiters)), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
throw new ParseException(sprintf('Unexpected end of line, expected one of "%s".', implode('', $delimiters)), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
}
if (!\in_array($tmp[0], $delimiters)) {
throw new ParseException(sprintf('Unexpected characters (%s).', substr($scalar, $i)), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
@@ -788,7 +788,7 @@ class Inline
* @param int &$i
* @param int $flags
*
* @return null|string
* @return string|null
*/
private static function parseTag($value, &$i, $flags)
{
-36
View File
@@ -549,11 +549,6 @@ class Parser
private function getNextEmbedBlock($indentation = null, $inSequence = false)
{
$oldLineIndentation = $this->getCurrentLineIndentation();
$blockScalarIndentations = array();
if ($this->isBlockScalarHeader()) {
$blockScalarIndentations[] = $oldLineIndentation;
}
if (!$this->moveToNextLine()) {
return;
@@ -612,30 +607,9 @@ class Parser
$isItUnindentedCollection = $this->isStringUnIndentedCollectionItem();
if (empty($blockScalarIndentations) && $this->isBlockScalarHeader()) {
$blockScalarIndentations[] = $this->getCurrentLineIndentation();
}
$previousLineIndentation = $this->getCurrentLineIndentation();
while ($this->moveToNextLine()) {
$indent = $this->getCurrentLineIndentation();
// terminate all block scalars that are more indented than the current line
if (!empty($blockScalarIndentations) && $indent < $previousLineIndentation && '' !== trim($this->currentLine)) {
foreach ($blockScalarIndentations as $key => $blockScalarIndentation) {
if ($blockScalarIndentation >= $indent) {
unset($blockScalarIndentations[$key]);
}
}
}
if (empty($blockScalarIndentations) && !$this->isCurrentLineComment() && $this->isBlockScalarHeader()) {
$blockScalarIndentations[] = $indent;
}
$previousLineIndentation = $indent;
if ($isItUnindentedCollection && !$this->isCurrentLineEmpty() && !$this->isStringUnIndentedCollectionItem() && $newIndent === $indent) {
$this->moveToPreviousLine();
break;
@@ -1054,16 +1028,6 @@ class Parser
return '-' === rtrim($this->currentLine) || 0 === strpos($this->currentLine, '- ');
}
/**
* Tests whether or not the current line is the header of a block scalar.
*
* @return bool
*/
private function isBlockScalarHeader()
{
return (bool) self::preg_match('~'.self::BLOCK_SCALAR_HEADER_PATTERN.'$~', $this->currentLine);
}
/**
* A local wrapper for `preg_match` which will throw a ParseException if there
* is an internal error in the PCRE engine.
+4 -5
View File
@@ -42,11 +42,10 @@ class Yaml
/**
* Parses a YAML file into a PHP value.
*
* Usage:
* <code>
* $array = Yaml::parseFile('config.yml');
* print_r($array);
* </code>
* Usage:
*
* $array = Yaml::parseFile('config.yml');
* print_r($array);
*
* @param string $filename The path to the YAML file to be parsed
* @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior