From 7704b16d2a90676c5ee1f408202f669c776d81db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= <5175937+theofidry@users.noreply.github.com> Date: Sun, 4 Dec 2022 18:50:20 +0100 Subject: [PATCH] Remove unnecessary proc_open check (#28) I am not entirely sure why `proc_open` itself was checked when unused (in any implementation). I however don't think it's relevant anymore: - Each finder checks if the proc related functions do exist (I assume if `proc_open` was not there then `popen` was not neither). - In case it was not available, it was returning `1`, whereas I think the `NumberOfCpuCoreNotFound` makes more sense. --- src/CpuCoreCounter.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/CpuCoreCounter.php b/src/CpuCoreCounter.php index 1b6babe..f34463e 100644 --- a/src/CpuCoreCounter.php +++ b/src/CpuCoreCounter.php @@ -13,8 +13,6 @@ namespace Fidry\CpuCounter; -use function function_exists; - final class CpuCoreCounter { /** @@ -54,10 +52,6 @@ public function getCount(): int */ private function findCount(): int { - if (!function_exists('proc_open')) { - return 1; - } - foreach ($this->finders as $finder) { $cores = $finder->find();