summaryrefslogtreecommitdiff
path: root/vendor/symfony/debug/Exception
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@webtrees.net>2019-02-03 13:44:03 +0000
committerGreg Roach <fisharebest@webtrees.net>2019-02-04 11:17:33 +0000
commit7def76c7d817a9ec81e9ae4a03a850514b1a2e1c (patch)
tree3fcf7e8236356daac44f7c17b8c0c5bc736a0926 /vendor/symfony/debug/Exception
parentadfb3656b8dac8505590490f4f8aaf4bea27881b (diff)
downloadwebtrees-7def76c7d817a9ec81e9ae4a03a850514b1a2e1c.tar.gz
webtrees-7def76c7d817a9ec81e9ae4a03a850514b1a2e1c.tar.bz2
webtrees-7def76c7d817a9ec81e9ae4a03a850514b1a2e1c.zip
Working on upgrade wizard and testing
Diffstat (limited to 'vendor/symfony/debug/Exception')
-rw-r--r--vendor/symfony/debug/Exception/FatalErrorException.php2
-rw-r--r--vendor/symfony/debug/Exception/FlattenException.php52
-rw-r--r--vendor/symfony/debug/Exception/SilencedErrorContext.php6
3 files changed, 30 insertions, 30 deletions
diff --git a/vendor/symfony/debug/Exception/FatalErrorException.php b/vendor/symfony/debug/Exception/FatalErrorException.php
index 8305d39218..93880fbc32 100644
--- a/vendor/symfony/debug/Exception/FatalErrorException.php
+++ b/vendor/symfony/debug/Exception/FatalErrorException.php
@@ -61,7 +61,7 @@ class FatalErrorException extends \ErrorException
unset($frame);
$trace = array_reverse($trace);
} else {
- $trace = array();
+ $trace = [];
}
$this->setTrace($trace);
diff --git a/vendor/symfony/debug/Exception/FlattenException.php b/vendor/symfony/debug/Exception/FlattenException.php
index f85522ce62..d016bb2fb4 100644
--- a/vendor/symfony/debug/Exception/FlattenException.php
+++ b/vendor/symfony/debug/Exception/FlattenException.php
@@ -33,12 +33,12 @@ class FlattenException
private $file;
private $line;
- public static function create(\Exception $exception, $statusCode = null, array $headers = array())
+ public static function create(\Exception $exception, $statusCode = null, array $headers = [])
{
return static::createFromThrowable($exception, $statusCode, $headers);
}
- public static function createFromThrowable(\Throwable $exception, ?int $statusCode = null, array $headers = array()): self
+ public static function createFromThrowable(\Throwable $exception, ?int $statusCode = null, array $headers = []): self
{
$e = new static();
$e->setMessage($exception->getMessage());
@@ -73,13 +73,13 @@ class FlattenException
public function toArray()
{
- $exceptions = array();
- foreach (array_merge(array($this), $this->getAllPrevious()) as $exception) {
- $exceptions[] = array(
+ $exceptions = [];
+ foreach (array_merge([$this], $this->getAllPrevious()) as $exception) {
+ $exceptions[] = [
'message' => $exception->getMessage(),
'class' => $exception->getClass(),
'trace' => $exception->getTrace(),
- );
+ ];
}
return $exceptions;
@@ -213,7 +213,7 @@ class FlattenException
public function getAllPrevious()
{
- $exceptions = array();
+ $exceptions = [];
$e = $this;
while ($e = $e->getPrevious()) {
$exceptions[] = $e;
@@ -247,8 +247,8 @@ class FlattenException
*/
public function setTrace($trace, $file, $line)
{
- $this->trace = array();
- $this->trace[] = array(
+ $this->trace = [];
+ $this->trace[] = [
'namespace' => '',
'short_class' => '',
'class' => '',
@@ -256,8 +256,8 @@ class FlattenException
'function' => '',
'file' => $file,
'line' => $line,
- 'args' => array(),
- );
+ 'args' => [],
+ ];
foreach ($trace as $entry) {
$class = '';
$namespace = '';
@@ -267,7 +267,7 @@ class FlattenException
$namespace = implode('\\', $parts);
}
- $this->trace[] = array(
+ $this->trace[] = [
'namespace' => $namespace,
'short_class' => $class,
'class' => isset($entry['class']) ? $entry['class'] : '',
@@ -275,8 +275,8 @@ class FlattenException
'function' => isset($entry['function']) ? $entry['function'] : null,
'file' => isset($entry['file']) ? $entry['file'] : null,
'line' => isset($entry['line']) ? $entry['line'] : null,
- 'args' => isset($entry['args']) ? $this->flattenArgs($entry['args']) : array(),
- );
+ 'args' => isset($entry['args']) ? $this->flattenArgs($entry['args']) : [],
+ ];
}
return $this;
@@ -284,34 +284,34 @@ class FlattenException
private function flattenArgs($args, $level = 0, &$count = 0)
{
- $result = array();
+ $result = [];
foreach ($args as $key => $value) {
if (++$count > 1e4) {
- return array('array', '*SKIPPED over 10000 entries*');
+ return ['array', '*SKIPPED over 10000 entries*'];
}
if ($value instanceof \__PHP_Incomplete_Class) {
// is_object() returns false on PHP<=7.1
- $result[$key] = array('incomplete-object', $this->getClassNameFromIncomplete($value));
+ $result[$key] = ['incomplete-object', $this->getClassNameFromIncomplete($value)];
} elseif (\is_object($value)) {
- $result[$key] = array('object', \get_class($value));
+ $result[$key] = ['object', \get_class($value)];
} elseif (\is_array($value)) {
if ($level > 10) {
- $result[$key] = array('array', '*DEEP NESTED ARRAY*');
+ $result[$key] = ['array', '*DEEP NESTED ARRAY*'];
} else {
- $result[$key] = array('array', $this->flattenArgs($value, $level + 1, $count));
+ $result[$key] = ['array', $this->flattenArgs($value, $level + 1, $count)];
}
} elseif (null === $value) {
- $result[$key] = array('null', null);
+ $result[$key] = ['null', null];
} elseif (\is_bool($value)) {
- $result[$key] = array('boolean', $value);
+ $result[$key] = ['boolean', $value];
} elseif (\is_int($value)) {
- $result[$key] = array('integer', $value);
+ $result[$key] = ['integer', $value];
} elseif (\is_float($value)) {
- $result[$key] = array('float', $value);
+ $result[$key] = ['float', $value];
} elseif (\is_resource($value)) {
- $result[$key] = array('resource', get_resource_type($value));
+ $result[$key] = ['resource', get_resource_type($value)];
} else {
- $result[$key] = array('string', (string) $value);
+ $result[$key] = ['string', (string) $value];
}
}
diff --git a/vendor/symfony/debug/Exception/SilencedErrorContext.php b/vendor/symfony/debug/Exception/SilencedErrorContext.php
index 6f84617c46..236c56ed0e 100644
--- a/vendor/symfony/debug/Exception/SilencedErrorContext.php
+++ b/vendor/symfony/debug/Exception/SilencedErrorContext.php
@@ -25,7 +25,7 @@ class SilencedErrorContext implements \JsonSerializable
private $line;
private $trace;
- public function __construct(int $severity, string $file, int $line, array $trace = array(), int $count = 1)
+ public function __construct(int $severity, string $file, int $line, array $trace = [], int $count = 1)
{
$this->severity = $severity;
$this->file = $file;
@@ -56,12 +56,12 @@ class SilencedErrorContext implements \JsonSerializable
public function JsonSerialize()
{
- return array(
+ return [
'severity' => $this->severity,
'file' => $this->file,
'line' => $this->line,
'trace' => $this->trace,
'count' => $this->count,
- );
+ ];
}
}