mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 04:45:20 +01:00
Fixed code style issues.
This commit is contained in:
parent
326d1cb025
commit
99e5ded20c
@ -3,6 +3,8 @@ namespace Psalm;
|
||||
|
||||
use Webmozart\PathUtil\Path;
|
||||
use function preg_match;
|
||||
use function ini_get;
|
||||
use function strtoupper;
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
@ -26,18 +28,15 @@ function getMemoryLimitInBytes(): int
|
||||
if (preg_match('/^(\d+)(\D?)$/', $limit, $matches)) {
|
||||
$limit = (int)$matches[1];
|
||||
switch (strtoupper($matches[2] ?? '')) {
|
||||
case 'G': {
|
||||
case 'G':
|
||||
$limit *= 1024 * 1024 * 1024;
|
||||
break;
|
||||
}
|
||||
case 'M': {
|
||||
case 'M':
|
||||
$limit *= 1024 * 1024;
|
||||
break;
|
||||
}
|
||||
case 'K': {
|
||||
case 'K':
|
||||
$limit *= 1024;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
namespace Psalm\Tests\Functions;
|
||||
|
||||
use function Psalm\getMemoryLimitInBytes;
|
||||
use function ini_set;
|
||||
|
||||
class GetMemoryLimitInBytesTest extends \Psalm\Tests\TestCase
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user