Skip to content

Commit 5a802dd

Browse files
author
Jamie Hannaford
committed
add better functionality
1 parent b06a3d1 commit 5a802dd

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

src/Common/Resource/AbstractResource.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ private function parseDocBlockValue($type, $val)
116116
private function isNotNativeType($type)
117117
{
118118
return !in_array($type, [
119-
'string', 'bool', 'boolean', 'null', 'array', 'object', 'int', 'integer', 'float', 'numeric', 'mixed'
119+
'string', 'bool', 'boolean', 'double', 'null', 'array', 'object', 'int', 'integer', 'float', 'numeric',
120+
'mixed'
120121
]);
121122
}
122123

src/Common/Resource/HasWaiterTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ private function shouldHalt($timeout, $startTime)
9595
* or exceed this timeout, the blocking operation will immediately cease. If FALSE
9696
* is provided, the timeout will never be considered.
9797
*/
98-
public function waitUntilActive($timeout = 60)
98+
public function waitUntilActive($timeout = false)
9999
{
100-
$this->waitUntil('ACTIVE');
100+
$this->waitUntil('ACTIVE', $timeout);
101101
}
102102

103103
public function waitUntilDeleted($timeout = 60, $sleepPeriod = 1)

src/Common/Service/Builder.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use GuzzleHttp\Client;
66
use GuzzleHttp\ClientInterface;
77
use GuzzleHttp\Middleware as GuzzleMiddleware;
8-
use OpenStack\Common\Auth\ServiceUrlResolver;
98
use OpenStack\Common\Auth\Token;
109
use OpenStack\Common\Transport\HandlerStack;
1110
use OpenStack\Common\Transport\Middleware;
@@ -26,6 +25,9 @@ class Builder
2625
*/
2726
private $globalOptions = [];
2827

28+
/** @var string */
29+
private $rootNamespace;
30+
2931
/**
3032
* Defaults that will be applied to options if no values are provided by the user.
3133
*
@@ -38,9 +40,10 @@ class Builder
3840
* Eventually they will be merged (and if necessary overridden) by the
3941
* service-specific options passed in.
4042
*/
41-
public function __construct(array $globalOptions = [])
43+
public function __construct(array $globalOptions = [], $rootNamespace = 'OpenStack')
4244
{
4345
$this->globalOptions = $globalOptions;
46+
$this->rootNamespace = $rootNamespace;
4447
}
4548

4649
/**
@@ -53,7 +56,7 @@ public function __construct(array $globalOptions = [])
5356
*/
5457
private function getClasses($serviceName, $serviceVersion)
5558
{
56-
$rootNamespace = sprintf("OpenStack\\%s\\v%d", $serviceName, $serviceVersion);
59+
$rootNamespace = sprintf("%s\\%s\\v%d", $this->rootNamespace, $serviceName, $serviceVersion);
5760

5861
return [
5962
sprintf("%s\\Api", $rootNamespace),
@@ -164,4 +167,4 @@ private function mergeOptions(array $serviceOptions)
164167

165168
return $options;
166169
}
167-
}
170+
}

0 commit comments

Comments
 (0)