Skip to content

Commit 29bd9cf

Browse files
committed
Reword api documentation
1 parent 7adbe7d commit 29bd9cf

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/main/php/lang/Environment.class.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<?php namespace lang;
22

3+
use Com;
4+
35
/**
46
* User environment
57
*
6-
* @test xp://net.xp_framework.unittest.core.EnvironmentTest
8+
* @test net.xp_framework.unittest.core.EnvironmentTest
79
*/
810
abstract class Environment {
911

@@ -112,9 +114,9 @@ public static function platform(): string {
112114
}
113115

114116
/**
115-
* Returns the number of processors available to the the runtime. First checks
117+
* Returns the number of processors available in this environment. First checks
116118
* for the `NUMBER_OF_PROCESSORS` environment variables, then uses platform-
117-
* specific files and tools. Returns NULL if discovery fails.
119+
* specific files and tools. Returns NULL if no discovery method is available.
118120
*
119121
* @see https://stackoverflow.com/q/6481005 (Linux)
120122
* @see https://stackoverflow.com/q/1715580 (Mac OS)
@@ -126,8 +128,8 @@ public static function platform(): string {
126128
public static function availableProcessors() {
127129
if ($n= getenv('NUMBER_OF_PROCESSORS')) {
128130
return (int)$n;
129-
} else if (class_exists(\Com::class)) {
130-
$c= new \Com('winmgmts://./root/cimv2');
131+
} else if (class_exists(Com::class)) {
132+
$c= new Com('winmgmts://./root/cimv2');
131133
foreach ($c->instancesOf('Win32_ComputerSystem') as $sys) {
132134
return $sys->NumberOfProcessors;
133135
}
@@ -155,6 +157,7 @@ public static function availableProcessors() {
155157
}
156158
}
157159
}
160+
158161
return null;
159162
}
160163

0 commit comments

Comments
 (0)