-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Implement collection manager * Linting * fix arg info
- Loading branch information
Showing
13 changed files
with
1,119 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright 2014-Present Couchbase, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Couchbase\Management; | ||
|
||
class CreateCollectionOptions | ||
{ | ||
private ?int $timeoutMilliseconds; | ||
|
||
/** | ||
* Static helper to keep code more readable | ||
* | ||
* @return CreateCollectionOptions | ||
* @since 4.1.3 | ||
*/ | ||
public static function build(): CreateCollectionOptions | ||
{ | ||
return new CreateCollectionOptions(); | ||
} | ||
|
||
/** | ||
* Sets the operation timeout in milliseconds | ||
* | ||
* @param int $milliseconds the operation timeout to apply | ||
* | ||
* @return CreateCollectionOptions | ||
* @since 4.1.3 | ||
*/ | ||
public function timeout(int $milliseconds): CreateCollectionOptions | ||
{ | ||
$this->timeoutMilliseconds = $milliseconds; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @param CreateCollectionOptions|null $options | ||
* @return array | ||
* @internal | ||
* @since 4.1.3 | ||
*/ | ||
|
||
public static function export(?CreateCollectionOptions $options): array | ||
{ | ||
if ($options == null) { | ||
return []; | ||
} | ||
return [ | ||
'timeoutMilliseconds' => $options->timeoutMilliseconds, | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright 2014-Present Couchbase, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Couchbase\Management; | ||
|
||
class CreateScopeOptions | ||
{ | ||
private ?int $timeoutMilliseconds; | ||
|
||
/** | ||
* Static helper to make code more readable | ||
* | ||
* @return CreateScopeOptions | ||
* @since 4.1.3 | ||
*/ | ||
public static function build(): CreateScopeOptions | ||
{ | ||
return new CreateScopeOptions(); | ||
} | ||
/** | ||
* Sets the operation timeout in milliseconds | ||
* | ||
* @param int $milliseconds the operation timeout to apply | ||
* | ||
* @return CreateScopeOptions | ||
* @since 4.1.3 | ||
*/ | ||
public function timeout(int $milliseconds): CreateScopeOptions | ||
{ | ||
$this->timeoutMilliseconds = $milliseconds; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @param CreateScopeOptions|null $options | ||
* @return array | ||
* @internal | ||
* @since 4.1.3 | ||
*/ | ||
public static function export(?CreateScopeOptions $options): array | ||
{ | ||
if ($options == null) { | ||
return []; | ||
} | ||
return [ | ||
'timeoutMilliseconds' => $options->timeoutMilliseconds, | ||
]; | ||
} | ||
} |
Oops, something went wrong.