Laravel 5.6 updates

Travis config update

Removed HHVM script as Laravel no longer support HHVM after releasing 5.3
This commit is contained in:
Manish Verma
2018-08-06 20:08:55 +05:30
parent 126fbb0255
commit 1ac0f42a58
2464 changed files with 65239 additions and 46734 deletions

View File

@@ -30,11 +30,9 @@ class FileProfilerStorage implements ProfilerStorageInterface
*
* Example : "file:/path/to/the/storage/folder"
*
* @param string $dsn The DSN
*
* @throws \RuntimeException
*/
public function __construct($dsn)
public function __construct(string $dsn)
{
if (0 !== strpos($dsn, 'file:')) {
throw new \RuntimeException(sprintf('Please check your configuration. You are trying to use FileStorage with an invalid dsn "%s". The expected format is "file:/path/to/the/storage/folder".', $dsn));
@@ -146,7 +144,7 @@ class FileProfilerStorage implements ProfilerStorageInterface
// when there are errors in sub-requests, the parent and/or children tokens
// may equal the profile token, resulting in infinite loops
$parentToken = $profile->getParentToken() !== $profileToken ? $profile->getParentToken() : null;
$childrenToken = array_filter(array_map(function ($p) use ($profileToken) {
$childrenToken = array_filter(array_map(function (Profile $p) use ($profileToken) {
return $profileToken !== $p->getToken() ? $p->getToken() : null;
}, $profile->getChildren()));

View File

@@ -43,10 +43,7 @@ class Profile
*/
private $children = array();
/**
* @param string $token The token
*/
public function __construct($token)
public function __construct(string $token)
{
$this->token = $token;
}
@@ -74,7 +71,7 @@ class Profile
/**
* Sets the parent token.
*/
public function setParent(Profile $parent)
public function setParent(self $parent)
{
$this->parent = $parent;
}
@@ -213,12 +210,23 @@ class Profile
/**
* Adds the child token.
*/
public function addChild(Profile $child)
public function addChild(self $child)
{
$this->children[] = $child;
$child->setParent($this);
}
public function getChildByToken(string $token): ?self
{
foreach ($this->children as $child) {
if ($token === $child->getToken()) {
return $child;
}
}
return null;
}
/**
* Gets a Collector by name.
*

View File

@@ -36,14 +36,11 @@ class Profiler
private $initiallyEnabled = true;
private $enabled = true;
/**
* @param bool $enable The initial enabled state
*/
public function __construct(ProfilerStorageInterface $storage, LoggerInterface $logger = null, $enable = true)
public function __construct(ProfilerStorageInterface $storage, LoggerInterface $logger = null, bool $enable = true)
{
$this->storage = $storage;
$this->logger = $logger;
$this->initiallyEnabled = $this->enabled = (bool) $enable;
$this->initiallyEnabled = $this->enabled = $enable;
}
/**
@@ -159,6 +156,10 @@ class Profiler
$profile->setIp('Unknown');
}
if ($prevToken = $response->headers->get('X-Debug-Token')) {
$response->headers->set('X-Previous-Debug-Token', $prevToken);
}
$response->headers->set('X-Debug-Token', $profile->getToken());
foreach ($this->collectors as $collector) {
@@ -174,10 +175,6 @@ class Profiler
public function reset()
{
foreach ($this->collectors as $collector) {
if (!method_exists($collector, 'reset')) {
continue;
}
$collector->reset();
}
$this->enabled = $this->initiallyEnabled;
@@ -211,10 +208,6 @@ class Profiler
*/
public function add(DataCollectorInterface $collector)
{
if (!method_exists($collector, 'reset')) {
@trigger_error(sprintf('Implementing "%s" without the "reset()" method is deprecated since Symfony 3.4 and will be unsupported in 4.0 for class "%s".', DataCollectorInterface::class, \get_class($collector)), E_USER_DEPRECATED);
}
$this->collectors[$collector->getName()] = $collector;
}