Skip to content

Commit

Permalink
Remove unnecessary proc_open check (#28)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
theofidry authored Dec 4, 2022
1 parent f5f3fa8 commit 7704b16
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/CpuCoreCounter.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@

namespace Fidry\CpuCounter;

use function function_exists;

final class CpuCoreCounter
{
/**
Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit 7704b16

Please sign in to comment.