upgraded dependencies
This commit is contained in:
14
vendor/psy/psysh/src/Command/TimeitCommand.php
vendored
14
vendor/psy/psysh/src/Command/TimeitCommand.php
vendored
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* This file is part of Psy Shell.
|
||||
*
|
||||
* (c) 2012-2018 Justin Hileman
|
||||
* (c) 2012-2022 Justin Hileman
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
@@ -25,7 +25,7 @@ use Symfony\Component\Console\Output\OutputInterface;
|
||||
*/
|
||||
class TimeitCommand extends Command
|
||||
{
|
||||
const RESULT_MSG = '<info>Command took %.6f seconds to complete.</info>';
|
||||
const RESULT_MSG = '<info>Command took %.6f seconds to complete.</info>';
|
||||
const AVG_RESULT_MSG = '<info>Command took %.6f seconds on average (%.6f median; %.6f total) to complete.</info>';
|
||||
|
||||
private static $start = null;
|
||||
@@ -76,6 +76,8 @@ HELP
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return int 0 if everything went fine, or an exit code
|
||||
*/
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
@@ -167,7 +169,7 @@ HELP
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function instrumentCode($code)
|
||||
private function instrumentCode(string $code): string
|
||||
{
|
||||
return $this->printer->prettyPrint($this->traverser->traverse($this->parse($code)));
|
||||
}
|
||||
@@ -179,9 +181,9 @@ HELP
|
||||
*
|
||||
* @return array Statements
|
||||
*/
|
||||
private function parse($code)
|
||||
private function parse(string $code): array
|
||||
{
|
||||
$code = '<?php ' . $code;
|
||||
$code = '<?php '.$code;
|
||||
|
||||
try {
|
||||
return $this->parser->parse($code);
|
||||
@@ -191,7 +193,7 @@ HELP
|
||||
}
|
||||
|
||||
// If we got an unexpected EOF, let's try it again with a semicolon.
|
||||
return $this->parser->parse($code . ';');
|
||||
return $this->parser->parse($code.';');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user