Laravel version update

Laravel version update
This commit is contained in:
Manish Verma
2018-08-06 18:48:58 +05:30
parent d143048413
commit 126fbb0255
13678 changed files with 1031482 additions and 778530 deletions

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Scalar;
@@ -15,13 +15,13 @@ class DNumber extends Scalar
* @param float $value Value of the number
* @param array $attributes Additional attributes
*/
public function __construct($value, array $attributes = array()) {
public function __construct(float $value, array $attributes = []) {
parent::__construct($attributes);
$this->value = $value;
}
public function getSubNodeNames() {
return array('value');
public function getSubNodeNames() : array {
return ['value'];
}
/**
@@ -33,7 +33,7 @@ class DNumber extends Scalar
*
* @return float The parsed number
*/
public static function parse($str) {
public static function parse(string $str) : float {
// if string contains any of .eE just cast it to float
if (false !== strpbrk($str, '.eE')) {
return (float) $str;
@@ -61,4 +61,8 @@ class DNumber extends Scalar
// dec
return (float) $str;
}
public function getType() : string {
return 'Scalar_DNumber';
}
}

View File

@@ -1,26 +1,31 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Scalar;
use PhpParser\Node\Expr;
use PhpParser\Node\Scalar;
class Encapsed extends Scalar
{
/** @var array Encaps list */
/** @var Expr[] list of string parts */
public $parts;
/**
* Constructs an encapsed string node.
*
* @param array $parts Encaps list
* @param array $attributes Additional attributes
* @param Expr[] $parts Encaps list
* @param array $attributes Additional attributes
*/
public function __construct(array $parts, array $attributes = array()) {
public function __construct(array $parts, array $attributes = []) {
parent::__construct($attributes);
$this->parts = $parts;
}
public function getSubNodeNames() {
return array('parts');
public function getSubNodeNames() : array {
return ['parts'];
}
public function getType() : string {
return 'Scalar_Encapsed';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Scalar;
@@ -15,12 +15,16 @@ class EncapsedStringPart extends Scalar
* @param string $value String value
* @param array $attributes Additional attributes
*/
public function __construct($value, array $attributes = array()) {
public function __construct(string $value, array $attributes = []) {
parent::__construct($attributes);
$this->value = $value;
}
public function getSubNodeNames() {
return array('value');
public function getSubNodeNames() : array {
return ['value'];
}
public function getType() : string {
return 'Scalar_EncapsedStringPart';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Scalar;
@@ -22,13 +22,13 @@ class LNumber extends Scalar
* @param int $value Value of the number
* @param array $attributes Additional attributes
*/
public function __construct($value, array $attributes = array()) {
public function __construct(int $value, array $attributes = []) {
parent::__construct($attributes);
$this->value = $value;
}
public function getSubNodeNames() {
return array('value');
public function getSubNodeNames() : array {
return ['value'];
}
/**
@@ -40,7 +40,7 @@ class LNumber extends Scalar
*
* @return LNumber The constructed LNumber, including kind attribute
*/
public static function fromString($str, array $attributes = array(), $allowInvalidOctal = false) {
public static function fromString(string $str, array $attributes = [], bool $allowInvalidOctal = false) : LNumber {
if ('0' !== $str[0] || '0' === $str) {
$attributes['kind'] = LNumber::KIND_DEC;
return new LNumber((int) $str, $attributes);
@@ -64,4 +64,8 @@ class LNumber extends Scalar
$attributes['kind'] = LNumber::KIND_OCT;
return new LNumber(intval($str, 8), $attributes);
}
public function getType() : string {
return 'Scalar_LNumber';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Scalar;
@@ -11,12 +11,12 @@ abstract class MagicConst extends Scalar
*
* @param array $attributes Additional attributes
*/
public function __construct(array $attributes = array()) {
public function __construct(array $attributes = []) {
parent::__construct($attributes);
}
public function getSubNodeNames() {
return array();
public function getSubNodeNames() : array {
return [];
}
/**
@@ -24,5 +24,5 @@ abstract class MagicConst extends Scalar
*
* @return string Name of magic constant
*/
abstract public function getName();
abstract public function getName() : string;
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Scalar\MagicConst;
@@ -6,7 +6,11 @@ use PhpParser\Node\Scalar\MagicConst;
class Class_ extends MagicConst
{
public function getName() {
public function getName() : string {
return '__CLASS__';
}
}
public function getType() : string {
return 'Scalar_MagicConst_Class';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Scalar\MagicConst;
@@ -6,7 +6,11 @@ use PhpParser\Node\Scalar\MagicConst;
class Dir extends MagicConst
{
public function getName() {
public function getName() : string {
return '__DIR__';
}
}
public function getType() : string {
return 'Scalar_MagicConst_Dir';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Scalar\MagicConst;
@@ -6,7 +6,11 @@ use PhpParser\Node\Scalar\MagicConst;
class File extends MagicConst
{
public function getName() {
public function getName() : string {
return '__FILE__';
}
}
public function getType() : string {
return 'Scalar_MagicConst_File';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Scalar\MagicConst;
@@ -6,7 +6,11 @@ use PhpParser\Node\Scalar\MagicConst;
class Function_ extends MagicConst
{
public function getName() {
public function getName() : string {
return '__FUNCTION__';
}
}
public function getType() : string {
return 'Scalar_MagicConst_Function';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Scalar\MagicConst;
@@ -6,7 +6,11 @@ use PhpParser\Node\Scalar\MagicConst;
class Line extends MagicConst
{
public function getName() {
public function getName() : string {
return '__LINE__';
}
}
public function getType() : string {
return 'Scalar_MagicConst_Line';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Scalar\MagicConst;
@@ -6,7 +6,11 @@ use PhpParser\Node\Scalar\MagicConst;
class Method extends MagicConst
{
public function getName() {
public function getName() : string {
return '__METHOD__';
}
}
public function getType() : string {
return 'Scalar_MagicConst_Method';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Scalar\MagicConst;
@@ -6,7 +6,11 @@ use PhpParser\Node\Scalar\MagicConst;
class Namespace_ extends MagicConst
{
public function getName() {
public function getName() : string {
return '__NAMESPACE__';
}
}
public function getType() : string {
return 'Scalar_MagicConst_Namespace';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Scalar\MagicConst;
@@ -6,7 +6,11 @@ use PhpParser\Node\Scalar\MagicConst;
class Trait_ extends MagicConst
{
public function getName() {
public function getName() : string {
return '__TRAIT__';
}
}
public function getType() : string {
return 'Scalar_MagicConst_Trait';
}
}

View File

@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);
namespace PhpParser\Node\Scalar;
@@ -16,7 +16,7 @@ class String_ extends Scalar
/** @var string String value */
public $value;
protected static $replacements = array(
protected static $replacements = [
'\\' => '\\',
'$' => '$',
'n' => "\n",
@@ -25,7 +25,7 @@ class String_ extends Scalar
'f' => "\f",
'v' => "\v",
'e' => "\x1B",
);
];
/**
* Constructs a string scalar node.
@@ -33,13 +33,13 @@ class String_ extends Scalar
* @param string $value Value of the string
* @param array $attributes Additional attributes
*/
public function __construct($value, array $attributes = array()) {
public function __construct(string $value, array $attributes = []) {
parent::__construct($attributes);
$this->value = $value;
}
public function getSubNodeNames() {
return array('value');
public function getSubNodeNames() : array {
return ['value'];
}
/**
@@ -52,7 +52,7 @@ class String_ extends Scalar
*
* @return string The parsed string
*/
public static function parse($str, $parseUnicodeEscape = true) {
public static function parse(string $str, bool $parseUnicodeEscape = true) : string {
$bLength = 0;
if ('b' === $str[0] || 'B' === $str[0]) {
$bLength = 1;
@@ -60,8 +60,8 @@ class String_ extends Scalar
if ('\'' === $str[$bLength]) {
return str_replace(
array('\\\\', '\\\''),
array( '\\', '\''),
['\\\\', '\\\''],
['\\', '\''],
substr($str, $bLength + 1, -1)
);
} else {
@@ -82,7 +82,7 @@ class String_ extends Scalar
*
* @return string String with escape sequences parsed
*/
public static function parseEscapeSequences($str, $quote, $parseUnicodeEscape = true) {
public static function parseEscapeSequences(string $str, $quote, bool $parseUnicodeEscape = true) : string {
if (null !== $quote) {
$str = str_replace('\\' . $quote, $quote, $str);
}
@@ -111,7 +111,14 @@ class String_ extends Scalar
);
}
private static function codePointToUtf8($num) {
/**
* Converts a Unicode code point to its UTF-8 encoded representation.
*
* @param int $num Code point
*
* @return string UTF-8 representation of code point
*/
private static function codePointToUtf8(int $num) : string {
if ($num <= 0x7F) {
return chr($num);
}
@@ -139,7 +146,7 @@ class String_ extends Scalar
*
* @return string Parsed string
*/
public static function parseDocString($startToken, $str, $parseUnicodeEscape = true) {
public static function parseDocString(string $startToken, string $str, bool $parseUnicodeEscape = true) : string {
// strip last newline (thanks tokenizer for sticking it into the string!)
$str = preg_replace('~(\r\n|\n|\r)\z~', '', $str);
@@ -150,4 +157,8 @@ class String_ extends Scalar
return self::parseEscapeSequences($str, null, $parseUnicodeEscape);
}
public function getType() : string {
return 'Scalar_String';
}
}