|
Server : Apache System : Linux server.mata-lashes.com 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64 User : matalashes ( 1004) PHP Version : 8.1.29 Disable Function : NONE Directory : /home/matalashes/www/kite.mata-lashes.com/vendor/rector/rector/src/Application/ |
Upload File : |
<?php
declare (strict_types=1);
namespace Rector\Core\Application;
use DateTime;
use Rector\Core\Exception\VersionException;
use RectorPrefix20211231\Symfony\Component\Console\Command\Command;
use RectorPrefix20211231\Symfony\Component\Process\Process;
/**
* Inspired by https://github.com/composer/composer/blob/master/src/Composer/Composer.php
* See https://github.com/composer/composer/blob/6587715d0f8cae0cd39073b3bc5f018d0e6b84fe/src/Composer/Compiler.php#L208
*/
final class VersionResolver
{
/**
* @var string
*/
public const PACKAGE_VERSION = 'fee8a47d1a627b01bfba2d85293c84692715506a';
/**
* @var string
*/
public const RELEASE_DATE = '2021-12-31 19:05:06';
public static function resolvePackageVersion() : string
{
$process = new \RectorPrefix20211231\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__);
if ($process->run() !== \RectorPrefix20211231\Symfony\Component\Console\Command\Command::SUCCESS) {
throw new \Rector\Core\Exception\VersionException('You must ensure to run compile from composer git repository clone and that git binary is available.');
}
$version = \trim($process->getOutput());
return \trim($version, '"');
}
public static function resolverReleaseDateTime() : \DateTime
{
$process = new \RectorPrefix20211231\Symfony\Component\Process\Process(['git', 'log', '-n1', '--pretty=%ci', 'HEAD'], __DIR__);
if ($process->run() !== \RectorPrefix20211231\Symfony\Component\Console\Command\Command::SUCCESS) {
throw new \Rector\Core\Exception\VersionException('You must ensure to run compile from composer git repository clone and that git binary is available.');
}
return new \DateTime(\trim($process->getOutput()));
}
}