Skip to content

Commit

Permalink
Rename the CpuFinder namespace to CpuCoreFinder (#39)
Browse files Browse the repository at this point in the history
Closes #35
  • Loading branch information
theofidry authored Dec 5, 2022
1 parent c528907 commit 25dbab2
Show file tree
Hide file tree
Showing 19 changed files with 36 additions and 36 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ composer require fidry/cpu-core-counter
## Usage

```php
use Fidry\CpuCounter\CpuCoreCounter;
use Fidry\CpuCoreCounter\CpuCoreCounter;

$counter = new CpuCoreCounter();

Expand Down Expand Up @@ -43,7 +43,7 @@ $cores = (new CpuCoreCounter($finders))->getCount();

```php
// Use CPUInfo first & don't use Nproc
use Fidry\CpuCounter\CpuInfoFinder;use Fidry\CpuCounter\HwFinder;use Fidry\CpuCounter\WindowsWmicFinder;$finders = [
use Fidry\CpuCoreCounter\CpuInfoFinder;use Fidry\CpuCoreCounter\HwFinder;use Fidry\CpuCoreCounter\WindowsWmicFinder;$finders = [
new CpuInfoFinder(),
new WindowsWmicFinder(),
new HwFinder(),
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
},
"autoload": {
"psr-4": {
"Fidry\\CpuCounter\\": "src/"
"Fidry\\CpuCoreCounter\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Fidry\\CpuCounter\\Test\\": "tests/"
"Fidry\\CpuCoreCounter\\Test\\": "tests/"
}
},
"config": {
Expand Down
2 changes: 1 addition & 1 deletion infection.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@default": true,
"ArrayItemRemoval": {
"ignore": [
"Fidry\\CpuCounter\\CpuCoreCounter::getDefaultFinders"
"Fidry\\CpuCoreCounter\\CpuCoreCounter::getDefaultFinders"
]
},
"PublicVisibility": false
Expand Down
2 changes: 1 addition & 1 deletion src/CpuCoreCounter.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

declare(strict_types=1);

namespace Fidry\CpuCounter;
namespace Fidry\CpuCoreCounter;

final class CpuCoreCounter
{
Expand Down
2 changes: 1 addition & 1 deletion src/CpuCoreFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

declare(strict_types=1);

namespace Fidry\CpuCounter;
namespace Fidry\CpuCoreCounter;

interface CpuCoreFinder
{
Expand Down
2 changes: 1 addition & 1 deletion src/CpuInfoFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

declare(strict_types=1);

namespace Fidry\CpuCounter;
namespace Fidry\CpuCoreCounter;

use function file_get_contents;
use function is_file;
Expand Down
2 changes: 1 addition & 1 deletion src/Exec/ExecException.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

declare(strict_types=1);

namespace Fidry\CpuCounter\Exec;
namespace Fidry\CpuCoreCounter\Exec;

use ErrorException;
use function error_get_last;
Expand Down
2 changes: 1 addition & 1 deletion src/Exec/ShellExec.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

declare(strict_types=1);

namespace Fidry\CpuCounter\Exec;
namespace Fidry\CpuCoreCounter\Exec;

use function error_clear_last;
use function shell_exec;
Expand Down
2 changes: 1 addition & 1 deletion src/HwFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

declare(strict_types=1);

namespace Fidry\CpuCounter;
namespace Fidry\CpuCoreCounter;

use function fgets;
use function filter_var;
Expand Down
6 changes: 3 additions & 3 deletions src/NProcFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

declare(strict_types=1);

namespace Fidry\CpuCounter;
namespace Fidry\CpuCoreCounter;

use Fidry\CpuCounter\Exec\ExecException;
use Fidry\CpuCounter\Exec\ShellExec;
use Fidry\CpuCoreCounter\Exec\ExecException;
use Fidry\CpuCoreCounter\Exec\ShellExec;
use function filter_var;
use function function_exists;
use function is_int;
Expand Down
2 changes: 1 addition & 1 deletion src/NumberOfCpuCoreNotFound.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

declare(strict_types=1);

namespace Fidry\CpuCounter;
namespace Fidry\CpuCoreCounter;

use RuntimeException;

Expand Down
2 changes: 1 addition & 1 deletion src/WindowsWmicFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

declare(strict_types=1);

namespace Fidry\CpuCounter;
namespace Fidry\CpuCoreCounter;

use function defined;
use function fgets;
Expand Down
10 changes: 5 additions & 5 deletions tests/CpuCoreCounterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@

declare(strict_types=1);

namespace Fidry\CpuCounter\Test;
namespace Fidry\CpuCoreCounter\Test;

use Exception;
use Fidry\CpuCounter\CpuCoreCounter;
use Fidry\CpuCounter\CpuCoreFinder;
use Fidry\CpuCounter\NumberOfCpuCoreNotFound;
use Fidry\CpuCoreCounter\CpuCoreCounter;
use Fidry\CpuCoreCounter\CpuCoreFinder;
use Fidry\CpuCoreCounter\NumberOfCpuCoreNotFound;
use PHPUnit\Framework\TestCase;
use function get_class;
use function is_int;

/**
* @covers \Fidry\CpuCounter\CpuCoreCounter
* @covers \Fidry\CpuCoreCounter\CpuCoreCounter
*
* @internal
*/
Expand Down
6 changes: 3 additions & 3 deletions tests/CpuInfoFinderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@

declare(strict_types=1);

namespace Fidry\CpuCounter\Test;
namespace Fidry\CpuCoreCounter\Test;

use Fidry\CpuCounter\CpuInfoFinder;
use Fidry\CpuCoreCounter\CpuInfoFinder;
use PHPUnit\Framework\TestCase;

/**
* @covers \Fidry\CpuCounter\CpuInfoFinder
* @covers \Fidry\CpuCoreCounter\CpuInfoFinder
*
* @internal
*/
Expand Down
4 changes: 2 additions & 2 deletions tests/DummyCpuCoreFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

declare(strict_types=1);

namespace Fidry\CpuCounter\Test;
namespace Fidry\CpuCoreCounter\Test;

use Fidry\CpuCounter\CpuCoreFinder;
use Fidry\CpuCoreCounter\CpuCoreFinder;

final class DummyCpuCoreFinder implements CpuCoreFinder
{
Expand Down
6 changes: 3 additions & 3 deletions tests/HwFinderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@

declare(strict_types=1);

namespace Fidry\CpuCounter\Test;
namespace Fidry\CpuCoreCounter\Test;

use Fidry\CpuCounter\HwFinder;
use Fidry\CpuCoreCounter\HwFinder;
use PHPUnit\Framework\TestCase;

/**
* @covers \Fidry\CpuCounter\HwFinder
* @covers \Fidry\CpuCoreCounter\HwFinder
*
* @internal
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/MakefileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

declare(strict_types=1);

namespace Fidry\CpuCounter\Test;
namespace Fidry\CpuCoreCounter\Test;

use Fidry\Makefile\Test\BaseMakefileTestCase;

Expand Down
6 changes: 3 additions & 3 deletions tests/NProcFinderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@

declare(strict_types=1);

namespace Fidry\CpuCounter\Test;
namespace Fidry\CpuCoreCounter\Test;

use Fidry\CpuCounter\NProcFinder;
use Fidry\CpuCoreCounter\NProcFinder;
use PHPUnit\Framework\TestCase;

/**
* @covers \Fidry\CpuCounter\NProcFinder
* @covers \Fidry\CpuCoreCounter\NProcFinder
*
* @internal
*/
Expand Down
6 changes: 3 additions & 3 deletions tests/WindowsWmicTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@

declare(strict_types=1);

namespace Fidry\CpuCounter\Test;
namespace Fidry\CpuCoreCounter\Test;

use Fidry\CpuCounter\WindowsWmicFinder;
use Fidry\CpuCoreCounter\WindowsWmicFinder;
use PHPUnit\Framework\TestCase;

/**
* @covers \Fidry\CpuCounter\WindowsWmicFinder
* @covers \Fidry\CpuCoreCounter\WindowsWmicFinder
*
* @internal
*/
Expand Down

0 comments on commit 25dbab2

Please sign in to comment.