File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 1
1
<?php namespace lang ;
2
2
3
+ use Com ;
4
+
3
5
/**
4
6
* User environment
5
7
*
6
- * @test xp:// net.xp_framework.unittest.core.EnvironmentTest
8
+ * @test net.xp_framework.unittest.core.EnvironmentTest
7
9
*/
8
10
abstract class Environment {
9
11
@@ -112,9 +114,9 @@ public static function platform(): string {
112
114
}
113
115
114
116
/**
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
116
118
* 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 .
118
120
*
119
121
* @see https://stackoverflow.com/q/6481005 (Linux)
120
122
* @see https://stackoverflow.com/q/1715580 (Mac OS)
@@ -126,8 +128,8 @@ public static function platform(): string {
126
128
public static function availableProcessors () {
127
129
if ($ n = getenv ('NUMBER_OF_PROCESSORS ' )) {
128
130
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 ' );
131
133
foreach ($ c ->instancesOf ('Win32_ComputerSystem ' ) as $ sys ) {
132
134
return $ sys ->NumberOfProcessors ;
133
135
}
@@ -155,6 +157,7 @@ public static function availableProcessors() {
155
157
}
156
158
}
157
159
}
160
+
158
161
return null ;
159
162
}
160
163
You can’t perform that action at this time.
0 commit comments