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,9 +1,3 @@
.idea
phpunit.xml
composer.lock
composer.phar
vendor/
cache.properties
build/LICENSE
build/README.md
build/*.tgz
/.idea
/composer.lock
/vendor

View File

@@ -1,21 +1,23 @@
language: php
php:
- 5.3.3
- 5.3
- 5.4
- 5.5
- 5.6
- hhvm
- 7.0
- 7.0snapshot
- 7.1
- 7.1snapshot
- master
sudo: false
before_script:
before_install:
- composer self-update
- composer install --no-interaction --prefer-source --dev
- composer clear-cache
script: ./vendor/bin/phpunit
install:
- travis_retry composer update --no-interaction --no-ansi --no-progress --no-suggest --optimize-autoloader --prefer-stable
script:
- ./vendor/bin/phpunit
notifications:
email: false
irc: "irc.freenode.org#phpunit"

View File

@@ -1,6 +1,6 @@
Recursion Context
Copyright (c) 2002-2015, Sebastian Bergmann <sebastian@phpunit.de>.
Copyright (c) 2002-2017, Sebastian Bergmann <sebastian@phpunit.de>.
All rights reserved.
Redistribution and use in source and binary forms, with or without

View File

@@ -4,10 +4,11 @@
## Installation
To add Recursion Context as a local, per-project dependency to your project, simply add a dependency on `sebastian/recursion-context` to your project's `composer.json` file. Here is a minimal example of a `composer.json` file that just defines a dependency on Recursion Context 1.0:
You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/):
composer require sebastian/recursion-context
If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency:
composer require --dev sebastian/recursion-context
{
"require": {
"sebastian/recursion-context": "~1.0"
}
}

View File

@@ -1,27 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="recursion-context">
<project name="recursion-context" default="setup">
<target name="setup" depends="clean,composer"/>
<target name="clean" description="Cleanup build artifacts">
<delete dir="${basedir}/vendor"/>
<delete file="${basedir}/composer.lock"/>
</target>
<target name="composer" depends="clean" description="Install dependencies with Composer">
<tstamp>
<format property="thirty.days.ago" pattern="MM/dd/yyyy hh:mm aa" offset="-30" unit="day"/>
</tstamp>
<delete>
<fileset dir="${basedir}">
<include name="composer.phar" />
<date datetime="${thirty.days.ago}" when="before"/>
</fileset>
</delete>
<get src="https://getcomposer.org/composer.phar" dest="${basedir}/composer.phar" skipexisting="true"/>
<exec executable="php">
<arg value="composer.phar"/>
<arg value="install"/>
<exec executable="composer" taskname="composer">
<arg value="update"/>
<arg value="--no-interaction"/>
<arg value="--no-progress"/>
<arg value="--no-ansi"/>
<arg value="--no-suggest"/>
<arg value="--optimize-autoloader"/>
<arg value="--prefer-stable"/>
</exec>
</target>
</project>

View File

@@ -18,10 +18,10 @@
}
],
"require": {
"php": ">=5.3.3"
"php": "^7.0"
},
"require-dev": {
"phpunit/phpunit": "~4.4"
"phpunit/phpunit": "^6.0"
},
"autoload": {
"classmap": [
@@ -30,7 +30,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
"dev-master": "3.0.x-dev"
}
}
}

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/6.0/phpunit.xsd"
bootstrap="vendor/autoload.php"
forceCoversAnnotation="true"
beStrictAboutCoversAnnotation="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
verbose="true">
<testsuite>
<directory suffix="Test.php">tests</directory>
</testsuite>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
</whitelist>
</filter>
</phpunit>

View File

@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
bootstrap="vendor/autoload.php"
beStrictAboutTestsThatDoNotTestAnything="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
checkForUnintentionallyCoveredCode="true"
forceCoversAnnotation="true"
verbose="true">
<testsuites>
<testsuite name="recursion-context">
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist addUncoveredFilesFromWhitelist="true" processUncoveredFilesFromWhitelist="true">
<directory>src</directory>
</whitelist>
</filter>
</phpunit>

View File

@@ -38,19 +38,17 @@ final class Context
/**
* Adds a value to the context.
*
* @param array|object $value The value to add.
* @return int|string The ID of the stored value, either as
* a string or integer.
* @throws InvalidArgumentException Thrown if $value is not an array or
* object
* @param array|object $value The value to add.
*
* @return int|string The ID of the stored value, either as a string or integer.
*
* @throws InvalidArgumentException Thrown if $value is not an array or object
*/
public function add(&$value)
{
if (is_array($value)) {
return $this->addArray($value);
}
else if (is_object($value)) {
} elseif (is_object($value)) {
return $this->addObject($value);
}
@@ -62,20 +60,17 @@ final class Context
/**
* Checks if the given value exists within the context.
*
* @param array|object $value The value to check.
* @return int|string|false The string or integer ID of the stored
* value if it has already been seen, or
* false if the value is not stored.
* @throws InvalidArgumentException Thrown if $value is not an array or
* object
* @param array|object $value The value to check.
*
* @return int|string|false The string or integer ID of the stored value if it has already been seen, or false if the value is not stored.
*
* @throws InvalidArgumentException Thrown if $value is not an array or object
*/
public function contains(&$value)
{
if (is_array($value)) {
return $this->containsArray($value);
}
else if (is_object($value)) {
} elseif (is_object($value)) {
return $this->containsObject($value);
}
@@ -85,7 +80,8 @@ final class Context
}
/**
* @param array $array
* @param array $array
*
* @return bool|int
*/
private function addArray(array &$array)
@@ -96,13 +92,32 @@ final class Context
return $key;
}
$key = count($this->arrays);
$this->arrays[] = &$array;
return count($this->arrays) - 1;
if (!isset($array[PHP_INT_MAX]) && !isset($array[PHP_INT_MAX - 1])) {
$array[] = $key;
$array[] = $this->objects;
} else { /* cover the improbable case too */
do {
$key = random_int(PHP_INT_MIN, PHP_INT_MAX);
} while (isset($array[$key]));
$array[$key] = $key;
do {
$key = random_int(PHP_INT_MIN, PHP_INT_MAX);
} while (isset($array[$key]));
$array[$key] = $this->objects;
}
return $key;
}
/**
* @param object $object
* @param object $object
*
* @return string
*/
private function addObject($object)
@@ -115,31 +130,20 @@ final class Context
}
/**
* @param array $array
* @param array $array
*
* @return int|false
*/
private function containsArray(array &$array)
{
$keys = array_keys($this->arrays, $array, true);
$hash = '_Key_' . microtime(true);
$end = array_slice($array, -2);
foreach ($keys as $key) {
$this->arrays[$key][$hash] = $hash;
if (isset($array[$hash]) && $array[$hash] === $hash) {
unset($this->arrays[$key][$hash]);
return $key;
}
unset($this->arrays[$key][$hash]);
}
return false;
return isset($end[1]) && $end[1] === $this->objects ? $end[0] : false;
}
/**
* @param object $value
* @param object $value
*
* @return string|false
*/
private function containsObject($value)
@@ -150,4 +154,14 @@ final class Context
return false;
}
public function __destruct()
{
foreach ($this->arrays as &$array) {
if (is_array($array)) {
array_pop($array);
array_pop($array);
}
}
}
}

View File

@@ -10,12 +10,12 @@
namespace SebastianBergmann\RecursionContext;
use PHPUnit_Framework_TestCase;
use PHPUnit\Framework\TestCase;
/**
* @covers SebastianBergmann\RecursionContext\Context
*/
class ContextTest extends PHPUnit_Framework_TestCase
class ContextTest extends TestCase
{
/**
* @var \SebastianBergmann\RecursionContext\Context
@@ -42,7 +42,7 @@ class ContextTest extends PHPUnit_Framework_TestCase
public function valuesProvider()
{
$obj2 = new \stdClass();
$obj2 = new \stdClass();
$obj2->foo = 'bar';
$obj3 = (object) array(1,2,"Test\r\n",4,5,6,7,8);
@@ -51,17 +51,17 @@ class ContextTest extends PHPUnit_Framework_TestCase
//@codingStandardsIgnoreStart
$obj->null = null;
//@codingStandardsIgnoreEnd
$obj->boolean = true;
$obj->integer = 1;
$obj->double = 1.2;
$obj->string = '1';
$obj->text = "this\nis\na\nvery\nvery\nvery\nvery\nvery\nvery\rlong\n\rtext";
$obj->object = $obj2;
$obj->boolean = true;
$obj->integer = 1;
$obj->double = 1.2;
$obj->string = '1';
$obj->text = "this\nis\na\nvery\nvery\nvery\nvery\nvery\nvery\rlong\n\rtext";
$obj->object = $obj2;
$obj->objectagain = $obj2;
$obj->array = array('foo' => 'bar');
$obj->array2 = array(1,2,3,4,5,6);
$obj->array3 = array($obj, $obj2, $obj3);
$obj->self = $obj;
$obj->array = array('foo' => 'bar');
$obj->array2 = array(1,2,3,4,5,6);
$obj->array3 = array($obj, $obj2, $obj3);
$obj->self = $obj;
$storage = new \SplObjectStorage();
$storage->attach($obj2);
@@ -85,10 +85,9 @@ class ContextTest extends PHPUnit_Framework_TestCase
*/
public function testAddFails($value)
{
$this->setExpectedException(
'SebastianBergmann\\RecursionContext\\Exception',
'Only arrays and objects are supported'
);
$this->expectException(Exception::class);
$this->expectExceptionMessage('Only arrays and objects are supported');
$this->context->add($value);
}
@@ -99,10 +98,9 @@ class ContextTest extends PHPUnit_Framework_TestCase
*/
public function testContainsFails($value)
{
$this->setExpectedException(
'SebastianBergmann\\RecursionContext\\Exception',
'Only arrays and objects are supported'
);
$this->expectException(Exception::class);
$this->expectExceptionMessage('Only arrays and objects are supported');
$this->context->contains($value);
}