composer update

This commit is contained in:
2019-12-01 06:37:45 +00:00
parent fa199eef05
commit 3115ab75a5
3650 changed files with 72361 additions and 147137 deletions

View File

@@ -15,10 +15,12 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\VarDumper\Caster\LinkStub;
use Symfony\Component\VarDumper\Caster\ClassStub;
/**
* @author Fabien Potencier <fabien@symfony.com>
*
* @final since Symfony 4.4
*/
class ConfigDataCollector extends DataCollector implements LateDataCollectorInterface
{
@@ -28,7 +30,6 @@ class ConfigDataCollector extends DataCollector implements LateDataCollectorInte
private $kernel;
private $name;
private $version;
private $hasVarDumper;
public function __construct(string $name = null, string $version = null)
{
@@ -41,7 +42,6 @@ class ConfigDataCollector extends DataCollector implements LateDataCollectorInte
$this->name = $name;
$this->version = $version;
$this->hasVarDumper = class_exists(LinkStub::class);
}
/**
@@ -54,8 +54,10 @@ class ConfigDataCollector extends DataCollector implements LateDataCollectorInte
/**
* {@inheritdoc}
*
* @param \Throwable|null $exception
*/
public function collect(Request $request, Response $response, \Exception $exception = null)
public function collect(Request $request, Response $response/*, \Throwable $exception = null*/)
{
$this->data = [
'app_name' => $this->name,
@@ -78,13 +80,14 @@ class ConfigDataCollector extends DataCollector implements LateDataCollectorInte
if (isset($this->kernel)) {
foreach ($this->kernel->getBundles() as $name => $bundle) {
$this->data['bundles'][$name] = $this->hasVarDumper ? new LinkStub($bundle->getPath()) : $bundle->getPath();
$this->data['bundles'][$name] = new ClassStub(\get_class($bundle));
}
$this->data['symfony_state'] = $this->determineSymfonyState();
$this->data['symfony_minor_version'] = sprintf('%s.%s', Kernel::MAJOR_VERSION, Kernel::MINOR_VERSION);
$eom = \DateTime::createFromFormat('m/Y', Kernel::END_OF_MAINTENANCE);
$eol = \DateTime::createFromFormat('m/Y', Kernel::END_OF_LIFE);
$this->data['symfony_lts'] = 4 === Kernel::MINOR_VERSION;
$eom = \DateTime::createFromFormat('d/m/Y', '01/'.Kernel::END_OF_MAINTENANCE);
$eol = \DateTime::createFromFormat('d/m/Y', '01/'.Kernel::END_OF_LIFE);
$this->data['symfony_eom'] = $eom->format('F Y');
$this->data['symfony_eol'] = $eol->format('F Y');
}
@@ -131,7 +134,7 @@ class ConfigDataCollector extends DataCollector implements LateDataCollectorInte
/**
* Gets the token.
*
* @return string The token
* @return string|null The token
*/
public function getToken()
{
@@ -169,6 +172,14 @@ class ConfigDataCollector extends DataCollector implements LateDataCollectorInte
return $this->data['symfony_minor_version'];
}
/**
* Returns if the current Symfony version is a Long-Term Support one.
*/
public function isSymfonyLts(): bool
{
return $this->data['symfony_lts'];
}
/**
* Returns the human redable date when this Symfony version ends its
* maintenance period.
@@ -327,11 +338,11 @@ class ConfigDataCollector extends DataCollector implements LateDataCollectorInte
*
* @return string One of: dev, stable, eom, eol
*/
private function determineSymfonyState()
private function determineSymfonyState(): string
{
$now = new \DateTime();
$eom = \DateTime::createFromFormat('m/Y', Kernel::END_OF_MAINTENANCE)->modify('last day of this month');
$eol = \DateTime::createFromFormat('m/Y', Kernel::END_OF_LIFE)->modify('last day of this month');
$eom = \DateTime::createFromFormat('d/m/Y', '01/'.Kernel::END_OF_MAINTENANCE)->modify('last day of this month');
$eol = \DateTime::createFromFormat('d/m/Y', '01/'.Kernel::END_OF_LIFE)->modify('last day of this month');
if ($now > $eol) {
$versionState = 'eol';