Skip to content

Commit a89ae97

Browse files
authored
Fixes linting across all of PHP, along with trivial fixes. (#6039)
Fixes linting across all of PHP, along with trivial fixes to typos, variable names, style,etc. There are still plenty of logical and syntactical errors still, but those will be covered service by service in individual issues.
1 parent 0a839a8 commit a89ae97

File tree

356 files changed

+15914
-16315
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

356 files changed

+15914
-16315
lines changed

.github/linters/phpcs.xml

+1-8
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,9 @@
22
<ruleset name="PHP_CodeSniffer">
33
<rule ref="PSR12">
44
<exclude name="PSR12.Files.FileHeader.SpacingAfterBlock"/>
5+
<exclude name="PSR1.Files.SideEffects.FoundWithSymbols"/>
56
</rule>
67

7-
<file>app</file>
8-
<file>bootstrap</file>
9-
<file>config</file>
10-
<file>database</file>
11-
<file>resources</file>
12-
<file>routes</file>
13-
<file>tests</file>
14-
158
<exclude-pattern>*/vendor/*</exclude-pattern>
169
<exclude-pattern>bootstrap/cache/*</exclude-pattern>
1710
<exclude-pattern>bootstrap/autoload.php</exclude-pattern>

php/applications/photo_asset_manager/src/bootstrap

+2-6
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,6 @@ function sendResponse($invocationId, $response)
5353
'body' => $jsonResponse,
5454
'statusCode' => 200,
5555
]);
56-
$client->post(
57-
'http://' . $_ENV['AWS_LAMBDA_RUNTIME_API'] . '/2018-06-01/runtime/invocation/' . $invocationId . '/response',
58-
[
59-
'body' => $body
60-
]
61-
);
56+
$uri = 'http://' . $_ENV['AWS_LAMBDA_RUNTIME_API'] . "/2018-06-01/runtime/invocation/$invocationId/response";
57+
$client->post($uri, ['body' => $body]);
6258
}
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,61 @@
1-
<?php
2-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3-
// SPDX-License-Identifier: Apache-2.0
4-
5-
6-
// snippet-start:[apigateway.php.get_base_path_mapping.complete]
7-
// snippet-start:[apigateway.php.get_base_path_mapping.import]
8-
require 'vendor/autoload.php';
9-
10-
use Aws\ApiGateway\ApiGatewayClient;
11-
use Aws\Exception\AwsException;
12-
// snippet-end:[apigateway.php.get_base_path_mapping.import]
13-
14-
/* ////////////////////////////////////////////////////////////////////////////
15-
* Purpose: Gets the base path mapping for a custom domain name in
16-
* Amazon API Gateway.
17-
*
18-
* Prerequisites: A custom domain name in API Gateway. For more information,
19-
* see "Custom Domain Names" in the Amazon API Gateway Developer Guide.
20-
*
21-
* Inputs:
22-
* - $apiGatewayClient: An initialized AWS SDK for PHP API client for
23-
* API Gateway.
24-
* - $basePath: The base path name that callers must provide as part of the
25-
* URL after the domain name.
26-
* - $domainName: The custom domain name for the base path mapping.
27-
*
28-
* Returns: The base path mapping, if available; otherwise, the error message.
29-
* ///////////////////////////////////////////////////////////////////////// */
30-
31-
// snippet-start:[apigateway.php.get_base_path_mapping.main]
32-
function getBasePathMapping($apiGatewayClient, $basePath, $domainName)
33-
{
34-
try {
35-
$result = $apiGatewayClient->getBasePathMapping([
36-
'basePath' => $basePath,
37-
'domainName' => $domainName,
38-
]);
39-
return 'The base path mapping\'s effective URI is: ' .
40-
$result['@metadata']['effectiveUri'];
41-
} catch (AwsException $e) {
42-
return 'Error: ' . $e['message'];
43-
}
44-
}
45-
46-
function getsTheBasePathMapping()
47-
{
48-
$apiGatewayClient = new ApiGatewayClient([
49-
'profile' => 'default',
50-
'region' => 'us-east-1',
51-
'version' => '2015-07-09'
52-
]);
53-
54-
echo getBasePathMapping($apiGatewayClient, '(none)', 'example.com');
55-
}
56-
57-
// Uncomment the following line to run this code in an AWS account.
58-
// getsTheBasePathMapping();
59-
// snippet-end:[apigateway.php.get_base_path_mapping.main]
60-
// snippet-end:[apigateway.php.get_base_path_mapping.complete]
61-
1+
<?php
2+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
// SPDX-License-Identifier: Apache-2.0
4+
5+
6+
// snippet-start:[apigateway.php.get_base_path_mapping.complete]
7+
// snippet-start:[apigateway.php.get_base_path_mapping.import]
8+
require 'vendor/autoload.php';
9+
10+
use Aws\ApiGateway\ApiGatewayClient;
11+
use Aws\Exception\AwsException;
12+
13+
// snippet-end:[apigateway.php.get_base_path_mapping.import]
14+
15+
/* ////////////////////////////////////////////////////////////////////////////
16+
* Purpose: Gets the base path mapping for a custom domain name in
17+
* Amazon API Gateway.
18+
*
19+
* Prerequisites: A custom domain name in API Gateway. For more information,
20+
* see "Custom Domain Names" in the Amazon API Gateway Developer Guide.
21+
*
22+
* Inputs:
23+
* - $apiGatewayClient: An initialized AWS SDK for PHP API client for
24+
* API Gateway.
25+
* - $basePath: The base path name that callers must provide as part of the
26+
* URL after the domain name.
27+
* - $domainName: The custom domain name for the base path mapping.
28+
*
29+
* Returns: The base path mapping, if available; otherwise, the error message.
30+
* ///////////////////////////////////////////////////////////////////////// */
31+
32+
// snippet-start:[apigateway.php.get_base_path_mapping.main]
33+
function getBasePathMapping($apiGatewayClient, $basePath, $domainName)
34+
{
35+
try {
36+
$result = $apiGatewayClient->getBasePathMapping([
37+
'basePath' => $basePath,
38+
'domainName' => $domainName,
39+
]);
40+
return 'The base path mapping\'s effective URI is: ' .
41+
$result['@metadata']['effectiveUri'];
42+
} catch (AwsException $e) {
43+
return 'Error: ' . $e['message'];
44+
}
45+
}
46+
47+
function getsTheBasePathMapping()
48+
{
49+
$apiGatewayClient = new ApiGatewayClient([
50+
'profile' => 'default',
51+
'region' => 'us-east-1',
52+
'version' => '2015-07-09'
53+
]);
54+
55+
echo getBasePathMapping($apiGatewayClient, '(none)', 'example.com');
56+
}
57+
58+
// Uncomment the following line to run this code in an AWS account.
59+
// getsTheBasePathMapping();
60+
// snippet-end:[apigateway.php.get_base_path_mapping.main]
61+
// snippet-end:[apigateway.php.get_base_path_mapping.complete]
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,58 @@
1-
<?php
2-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3-
// SPDX-License-Identifier: Apache-2.0
4-
5-
6-
// snippet-start:[apigateway.php.list_base_path_mapping.complete]
7-
// snippet-start:[apigateway.php.list_base_path_mapping.import]
8-
require 'vendor/autoload.php';
9-
10-
use Aws\ApiGateway\ApiGatewayClient;
11-
use Aws\Exception\AwsException;
12-
// snippet-end:[apigateway.php.list_base_path_mapping.import]
13-
14-
/* ////////////////////////////////////////////////////////////////////////////
15-
* Purpose: Lists the base path mapping for a custom domain name in
16-
* Amazon API Gateway.
17-
*
18-
* Prerequisites: A custom domain name in API Gateway. For more information,
19-
* see "Custom Domain Names" in the Amazon API Gateway Developer Guide.
20-
*
21-
* Inputs:
22-
* - $apiGatewayClient: An initialized AWS SDK for PHP API client for
23-
* API Gateway.
24-
* - $domainName: The custom domain name for the base path mappings.
25-
*
26-
* Returns: Information about the base path mappings, if available;
27-
* otherwise, the error message.
28-
* ///////////////////////////////////////////////////////////////////////// */
29-
30-
// snippet-start:[apigateway.php.list_base_path_mapping.main]
31-
function listBasePathMappings($apiGatewayClient, $domainName)
32-
{
33-
try {
34-
$result = $apiGatewayClient->getBasePathMappings([
35-
'domainName' => $domainName
36-
]);
37-
return 'The base path mapping(s) effective URI is: ' .
38-
$result['@metadata']['effectiveUri'];
39-
} catch (AwsException $e) {
40-
return 'Error: ' . $e['message'];
41-
}
42-
}
43-
44-
function listTheBasePathMappings()
45-
{
46-
$apiGatewayClient = new ApiGatewayClient([
47-
'profile' => 'default',
48-
'region' => 'us-east-1',
49-
'version' => '2015-07-09'
50-
]);
51-
52-
echo listBasePathMappings($apiGatewayClient, 'example.com');
53-
}
54-
55-
// Uncomment the following line to run this code in an AWS account.
56-
// listTheBasePathMappings();
57-
// snippet-end:[apigateway.php.list_base_path_mapping.main]
58-
// snippet-end:[apigateway.php.list_base_path_mapping.complete]
59-
1+
<?php
2+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
// SPDX-License-Identifier: Apache-2.0
4+
5+
// snippet-start:[apigateway.php.list_base_path_mapping.complete]
6+
// snippet-start:[apigateway.php.list_base_path_mapping.import]
7+
require 'vendor/autoload.php';
8+
9+
use Aws\ApiGateway\ApiGatewayClient;
10+
use Aws\Exception\AwsException;
11+
12+
// snippet-end:[apigateway.php.list_base_path_mapping.import]
13+
14+
/* ////////////////////////////////////////////////////////////////////////////
15+
* Purpose: Lists the base path mapping for a custom domain name in
16+
* Amazon API Gateway.
17+
*
18+
* Prerequisites: A custom domain name in API Gateway. For more information,
19+
* see "Custom Domain Names" in the Amazon API Gateway Developer Guide.
20+
*
21+
* Inputs:
22+
* - $apiGatewayClient: An initialized AWS SDK for PHP API client for
23+
* API Gateway.
24+
* - $domainName: The custom domain name for the base path mappings.
25+
*
26+
* Returns: Information about the base path mappings, if available;
27+
* otherwise, the error message.
28+
* ///////////////////////////////////////////////////////////////////////// */
29+
30+
// snippet-start:[apigateway.php.list_base_path_mapping.main]
31+
function listBasePathMappings($apiGatewayClient, $domainName)
32+
{
33+
try {
34+
$result = $apiGatewayClient->getBasePathMappings([
35+
'domainName' => $domainName
36+
]);
37+
return 'The base path mapping(s) effective URI is: ' .
38+
$result['@metadata']['effectiveUri'];
39+
} catch (AwsException $e) {
40+
return 'Error: ' . $e['message'];
41+
}
42+
}
43+
44+
function listTheBasePathMappings()
45+
{
46+
$apiGatewayClient = new ApiGatewayClient([
47+
'profile' => 'default',
48+
'region' => 'us-east-1',
49+
'version' => '2015-07-09'
50+
]);
51+
52+
echo listBasePathMappings($apiGatewayClient, 'example.com');
53+
}
54+
55+
// Uncomment the following line to run this code in an AWS account.
56+
// listTheBasePathMappings();
57+
// snippet-end:[apigateway.php.list_base_path_mapping.main]
58+
// snippet-end:[apigateway.php.list_base_path_mapping.complete]

0 commit comments

Comments
 (0)