mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-01 17:00:51 +00:00
297478ae00
9e321a11ac
[TypeDeclaration] Add PropertyTypeFromStrictSetterGetterRector (#3313)
26 lines
569 B
PHP
26 lines
569 B
PHP
<?php
|
|
|
|
declare (strict_types=1);
|
|
namespace RectorPrefix202301\Symplify\EasyParallel;
|
|
|
|
use RectorPrefix202301\Fidry\CpuCoreCounter\CpuCoreCounter;
|
|
use RectorPrefix202301\Fidry\CpuCoreCounter\NumberOfCpuCoreNotFound;
|
|
/**
|
|
* @api
|
|
*/
|
|
final class CpuCoreCountProvider
|
|
{
|
|
/**
|
|
* @var int
|
|
*/
|
|
private const DEFAULT_CORE_COUNT = 2;
|
|
public function provide() : int
|
|
{
|
|
try {
|
|
return (new CpuCoreCounter())->getCount();
|
|
} catch (NumberOfCpuCoreNotFound $exception) {
|
|
return self::DEFAULT_CORE_COUNT;
|
|
}
|
|
}
|
|
}
|