Cleanup pass based on prior PRs (#21)

* Updates to stub generation

* More idiomatic fixes from PHP team

* Moved tests from src/tests -> tests, got rid of extension-only tests

* fixed up test paths, regenerated arginfo
This commit is contained in:
Justin Boswell
2021-05-05 13:37:47 -07:00
committed by GitHub
parent 531330e1b2
commit 7e925c92fb
30 changed files with 99 additions and 119 deletions
+4 -1
View File
@@ -1,5 +1,8 @@
<?php
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
namespace AWS\CRT\Auth;
use AWS\CRT\NativeResource as NativeResource;
+4 -1
View File
@@ -1,5 +1,8 @@
<?php
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
namespace AWS\CRT\Auth;
use AWS\CRT\NativeResource as NativeResource;
@@ -1,5 +1,8 @@
<?php
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
namespace AWS\CRT\Auth;
/**
+5 -2
View File
@@ -1,5 +1,8 @@
<?php
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
namespace AWS\CRT;
use AWS\CRT\Internal\Extension;
@@ -102,7 +105,7 @@ final class CRT {
* @param object $elg Pointer to the event loop group to release
*/
function event_loop_group_release($elg) {
return self::$impl->aws_crt_event_loop_group_release($elg);
self::$impl->aws_crt_event_loop_group_release($elg);
}
/**
+4 -1
View File
@@ -1,5 +1,8 @@
<?php
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
namespace AWS\CRT\HTTP;
use AWS\CRT\Internal\Encoding;
+5 -1
View File
@@ -1,5 +1,8 @@
<?php
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
namespace AWS\CRT\HTTP;
use AWS\CRT\NativeResource;
@@ -12,6 +15,7 @@ abstract class Message extends NativeResource {
private $headers;
public function __construct($method, $path, $query = [], $headers = []) {
parent::__construct();
$this->method = $method;
$this->path = $path;
$this->query = $query;
+5 -2
View File
@@ -1,5 +1,8 @@
<?php
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
namespace AWS\CRT\HTTP;
use AWS\CRT\IO\InputStream;
@@ -10,7 +13,7 @@ class Request extends Message {
public function __construct($method, $path, $query = [], $headers = [], $body_stream = null) {
parent::__construct($method, $path, $query, $headers);
if (!is_null($body_stream) && !($body_stream instanceof InputStream)) {
throw \InvalidArgumentException('body_stream must be an ' . InputStream::class);
throw InvalidArgumentException('body_stream must be an instance of ' . InputStream::class);
}
$this->body_stream = $body_stream;
}
+4 -1
View File
@@ -1,5 +1,8 @@
<?php
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
namespace AWS\CRT\HTTP;
class Response extends Message {
+4 -1
View File
@@ -1,5 +1,8 @@
<?php
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
namespace AWS\CRT\IO;
use AWS\CRT\NativeResource as NativeResource;
+4 -1
View File
@@ -1,5 +1,8 @@
<?php
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
namespace AWS\CRT\IO;
use AWS\CRT\NativeResource as NativeResource;
+4 -1
View File
@@ -1,5 +1,8 @@
<?php
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
namespace AWS\CRT\Internal;
final class Encoding {
+4 -1
View File
@@ -1,5 +1,8 @@
<?php
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
namespace AWS\CRT\Internal;
use \RuntimeException;
+4 -1
View File
@@ -1,5 +1,8 @@
<?php
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
namespace AWS\CRT;
use AWS\CRT\CRT as CRT;
+4 -1
View File
@@ -1,5 +1,8 @@
<?php
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
namespace AWS\CRT;
final class Options {