From 06cf52b3224ffe5bdb0d8d97cfacb5a700f2f034 Mon Sep 17 00:00:00 2001 From: inxilpro Date: Tue, 20 Aug 2024 16:10:53 +0000 Subject: [PATCH 1/4] Fix code styling [ci skip] --- src/Clients/CloudWatchLogsClient.php | 4 +--- src/Clients/S3Client.php | 4 +--- src/Exceptions/ConfigurationException.php | 4 +--- src/Exceptions/LambdaExecutionException.php | 4 +--- src/Exceptions/SidecarException.php | 4 +--- 5 files changed, 5 insertions(+), 15 deletions(-) diff --git a/src/Clients/CloudWatchLogsClient.php b/src/Clients/CloudWatchLogsClient.php index ed69678..e095cf0 100644 --- a/src/Clients/CloudWatchLogsClient.php +++ b/src/Clients/CloudWatchLogsClient.php @@ -7,6 +7,4 @@ use Aws\CloudWatchLogs\CloudWatchLogsClient as BaseClient; -class CloudWatchLogsClient extends BaseClient -{ -} +class CloudWatchLogsClient extends BaseClient {} diff --git a/src/Clients/S3Client.php b/src/Clients/S3Client.php index 77278d5..a2414a1 100644 --- a/src/Clients/S3Client.php +++ b/src/Clients/S3Client.php @@ -4,6 +4,4 @@ use Aws\S3\S3Client as BaseClient; -class S3Client extends BaseClient -{ -} +class S3Client extends BaseClient {} diff --git a/src/Exceptions/ConfigurationException.php b/src/Exceptions/ConfigurationException.php index 89d01c1..a76a6e7 100644 --- a/src/Exceptions/ConfigurationException.php +++ b/src/Exceptions/ConfigurationException.php @@ -5,6 +5,4 @@ namespace Hammerstone\Sidecar\Exceptions; -class ConfigurationException extends SidecarException -{ -} +class ConfigurationException extends SidecarException {} diff --git a/src/Exceptions/LambdaExecutionException.php b/src/Exceptions/LambdaExecutionException.php index c992726..1aa1620 100644 --- a/src/Exceptions/LambdaExecutionException.php +++ b/src/Exceptions/LambdaExecutionException.php @@ -5,6 +5,4 @@ namespace Hammerstone\Sidecar\Exceptions; -class LambdaExecutionException extends SidecarException -{ -} +class LambdaExecutionException extends SidecarException {} diff --git a/src/Exceptions/SidecarException.php b/src/Exceptions/SidecarException.php index 9d4c83f..0501f82 100644 --- a/src/Exceptions/SidecarException.php +++ b/src/Exceptions/SidecarException.php @@ -7,6 +7,4 @@ use Exception; -class SidecarException extends Exception -{ -} +class SidecarException extends Exception {} From 55031e46a32b1fcd36cab4231a9cda931633e06a Mon Sep 17 00:00:00 2001 From: Chris Morrell Date: Tue, 20 Aug 2024 12:12:05 -0400 Subject: [PATCH 2/4] Set default for `$numberOfBacktraces` --- src/Results/SettledResult.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Results/SettledResult.php b/src/Results/SettledResult.php index 0b824b1..fddc671 100644 --- a/src/Results/SettledResult.php +++ b/src/Results/SettledResult.php @@ -98,7 +98,7 @@ public function toResponse($request) * * @throws Exception */ - public function throw(?int $numberOfBacktraces) + public function throw(?int $numberOfBacktraces = null) { if (!$this->isError()) { return $this; From df055ff3c37a12435348847876116b98220faa50 Mon Sep 17 00:00:00 2001 From: Chris Morrell Date: Fri, 22 Aug 2025 10:51:41 -0400 Subject: [PATCH 3/4] Set default backtrace number in errorAsString call Ensures that the errorAsString method receives a default value of 2 for numberOfBacktraces if none is provided, preventing potential null value issues. --- src/Results/SettledResult.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Results/SettledResult.php b/src/Results/SettledResult.php index fddc671..426f91c 100644 --- a/src/Results/SettledResult.php +++ b/src/Results/SettledResult.php @@ -106,7 +106,7 @@ public function throw(?int $numberOfBacktraces = null) throw new LambdaExecutionException(sprintf('Lambda Execution Exception for %s: "%s".', ...[ get_class($this->function), - $this->errorAsString($numberOfBacktraces) + $this->errorAsString($numberOfBacktraces ?? 2) ])); } From 03884cdb66f2aecae4f2b20502ac10f1683f1b92 Mon Sep 17 00:00:00 2001 From: inxilpro Date: Fri, 22 Aug 2025 14:52:01 +0000 Subject: [PATCH 4/4] Fix code styling [ci skip] --- src/Clients/CloudWatchLogsClient.php | 1 + src/Clients/LambdaClient.php | 1 + src/Commands/Actions/BaseAction.php | 1 + src/Commands/Actions/CreateBucket.php | 1 + src/Commands/Actions/CreateDeploymentUser.php | 1 + src/Commands/Actions/CreateExecutionRole.php | 1 + src/Commands/Actions/DestroyAdminKeys.php | 1 + src/Commands/Actions/DetermineRegion.php | 1 + src/Commands/Activate.php | 1 + src/Commands/Configure.php | 1 + src/Commands/Deploy.php | 1 + src/Commands/EnvironmentAwareCommand.php | 1 + src/Commands/Install.php | 1 + src/Commands/Warm.php | 1 + src/Concerns/HandlesLogging.php | 1 + src/Concerns/ManagesEnvironments.php | 1 + src/Deployment.php | 1 + src/Events/AfterFunctionExecuted.php | 1 + src/Events/AfterFunctionsActivated.php | 1 + src/Events/AfterFunctionsDeployed.php | 1 + src/Events/BeforeFunctionExecuted.php | 1 + src/Events/BeforeFunctionsActivated.php | 1 + src/Events/BeforeFunctionsDeployed.php | 1 + src/Exceptions/ConfigurationException.php | 1 + src/Exceptions/FunctionNotFoundException.php | 1 + src/Exceptions/LambdaExecutionException.php | 1 + src/Exceptions/NoFunctionsRegisteredException.php | 1 + src/Exceptions/SidecarException.php | 1 + src/LambdaFunction.php | 1 + src/Manager.php | 1 + src/Package.php | 1 + src/Providers/SidecarServiceProvider.php | 1 + src/Region.php | 1 + src/Results/PendingResult.php | 1 + src/Results/ResultContract.php | 1 + src/Results/SettledResult.php | 1 + src/Sidecar.php | 1 + src/WarmingConfig.php | 1 + tests/Unit/Base.php | 1 + tests/Unit/Commands/ActivateTest.php | 1 + tests/Unit/Commands/ConfigureTest.php | 1 + tests/Unit/Commands/DeployTest.php | 1 + tests/Unit/DeploymentTest.php | 1 + tests/Unit/EnvironmentMismatchTest.php | 1 + tests/Unit/EnvironmentTest.php | 1 + tests/Unit/ExecuteMultipleTest.php | 1 + tests/Unit/ExecuteTest.php | 1 + tests/Unit/FunctionTest.php | 1 + tests/Unit/LambdaClientTest.php | 1 + tests/Unit/PackageTest.php | 1 + tests/Unit/Support/DeploymentTestFunction.php | 1 + tests/Unit/Support/DeploymentTestFunctionWithImage.php | 1 + tests/Unit/Support/DeploymentTestFunctionWithTags.php | 1 + tests/Unit/Support/DeploymentTestFunctionWithVariables.php | 1 + tests/Unit/Support/EmptyTestFunction.php | 1 + 55 files changed, 55 insertions(+) diff --git a/src/Clients/CloudWatchLogsClient.php b/src/Clients/CloudWatchLogsClient.php index e095cf0..cf034c4 100644 --- a/src/Clients/CloudWatchLogsClient.php +++ b/src/Clients/CloudWatchLogsClient.php @@ -1,4 +1,5 @@ */ diff --git a/src/Clients/LambdaClient.php b/src/Clients/LambdaClient.php index 4759c02..d8efe93 100644 --- a/src/Clients/LambdaClient.php +++ b/src/Clients/LambdaClient.php @@ -1,4 +1,5 @@ */ diff --git a/src/Commands/Actions/BaseAction.php b/src/Commands/Actions/BaseAction.php index 28e8c46..7651ae1 100644 --- a/src/Commands/Actions/BaseAction.php +++ b/src/Commands/Actions/BaseAction.php @@ -1,4 +1,5 @@ */ diff --git a/src/Commands/Actions/CreateBucket.php b/src/Commands/Actions/CreateBucket.php index 0b1100a..084f9f1 100644 --- a/src/Commands/Actions/CreateBucket.php +++ b/src/Commands/Actions/CreateBucket.php @@ -1,4 +1,5 @@ */ diff --git a/src/Commands/Actions/CreateDeploymentUser.php b/src/Commands/Actions/CreateDeploymentUser.php index 91898f8..2dbf386 100644 --- a/src/Commands/Actions/CreateDeploymentUser.php +++ b/src/Commands/Actions/CreateDeploymentUser.php @@ -1,4 +1,5 @@ */ diff --git a/src/Commands/Actions/CreateExecutionRole.php b/src/Commands/Actions/CreateExecutionRole.php index 1965986..710b853 100644 --- a/src/Commands/Actions/CreateExecutionRole.php +++ b/src/Commands/Actions/CreateExecutionRole.php @@ -1,4 +1,5 @@ */ diff --git a/src/Commands/Actions/DestroyAdminKeys.php b/src/Commands/Actions/DestroyAdminKeys.php index 7cf8cc8..ba265c5 100644 --- a/src/Commands/Actions/DestroyAdminKeys.php +++ b/src/Commands/Actions/DestroyAdminKeys.php @@ -1,4 +1,5 @@ */ diff --git a/src/Commands/Actions/DetermineRegion.php b/src/Commands/Actions/DetermineRegion.php index ff33f82..b7ccb56 100644 --- a/src/Commands/Actions/DetermineRegion.php +++ b/src/Commands/Actions/DetermineRegion.php @@ -1,4 +1,5 @@ */ diff --git a/src/Commands/Activate.php b/src/Commands/Activate.php index 28f1f88..c3012db 100644 --- a/src/Commands/Activate.php +++ b/src/Commands/Activate.php @@ -1,4 +1,5 @@ */ diff --git a/src/Commands/Configure.php b/src/Commands/Configure.php index 68b7e06..089bdb6 100644 --- a/src/Commands/Configure.php +++ b/src/Commands/Configure.php @@ -1,4 +1,5 @@ */ diff --git a/src/Commands/Deploy.php b/src/Commands/Deploy.php index cc723bb..7c2382e 100644 --- a/src/Commands/Deploy.php +++ b/src/Commands/Deploy.php @@ -1,4 +1,5 @@ */ diff --git a/src/Commands/EnvironmentAwareCommand.php b/src/Commands/EnvironmentAwareCommand.php index 0f45c9d..b943d75 100644 --- a/src/Commands/EnvironmentAwareCommand.php +++ b/src/Commands/EnvironmentAwareCommand.php @@ -1,4 +1,5 @@ */ diff --git a/src/Commands/Install.php b/src/Commands/Install.php index ae7c5ef..71cc09f 100644 --- a/src/Commands/Install.php +++ b/src/Commands/Install.php @@ -1,4 +1,5 @@ */ diff --git a/src/Commands/Warm.php b/src/Commands/Warm.php index 7a1a8cf..5946d11 100644 --- a/src/Commands/Warm.php +++ b/src/Commands/Warm.php @@ -1,4 +1,5 @@ */ diff --git a/src/Concerns/HandlesLogging.php b/src/Concerns/HandlesLogging.php index 38afba6..bc90921 100644 --- a/src/Concerns/HandlesLogging.php +++ b/src/Concerns/HandlesLogging.php @@ -1,4 +1,5 @@ */ diff --git a/src/Concerns/ManagesEnvironments.php b/src/Concerns/ManagesEnvironments.php index e2026d5..d832b1f 100644 --- a/src/Concerns/ManagesEnvironments.php +++ b/src/Concerns/ManagesEnvironments.php @@ -1,4 +1,5 @@ */ diff --git a/src/Deployment.php b/src/Deployment.php index 881ba77..bfa1b08 100644 --- a/src/Deployment.php +++ b/src/Deployment.php @@ -1,4 +1,5 @@ */ diff --git a/src/Events/AfterFunctionExecuted.php b/src/Events/AfterFunctionExecuted.php index a743ca6..ecee279 100644 --- a/src/Events/AfterFunctionExecuted.php +++ b/src/Events/AfterFunctionExecuted.php @@ -1,4 +1,5 @@ */ diff --git a/src/Events/AfterFunctionsActivated.php b/src/Events/AfterFunctionsActivated.php index 75c4f47..4cf0d8c 100644 --- a/src/Events/AfterFunctionsActivated.php +++ b/src/Events/AfterFunctionsActivated.php @@ -1,4 +1,5 @@ */ diff --git a/src/Events/AfterFunctionsDeployed.php b/src/Events/AfterFunctionsDeployed.php index fd0d891..2fef2f1 100644 --- a/src/Events/AfterFunctionsDeployed.php +++ b/src/Events/AfterFunctionsDeployed.php @@ -1,4 +1,5 @@ */ diff --git a/src/Events/BeforeFunctionExecuted.php b/src/Events/BeforeFunctionExecuted.php index 01c3155..28237e8 100644 --- a/src/Events/BeforeFunctionExecuted.php +++ b/src/Events/BeforeFunctionExecuted.php @@ -1,4 +1,5 @@ */ diff --git a/src/Events/BeforeFunctionsActivated.php b/src/Events/BeforeFunctionsActivated.php index 0b7e9e7..d7f5ff4 100644 --- a/src/Events/BeforeFunctionsActivated.php +++ b/src/Events/BeforeFunctionsActivated.php @@ -1,4 +1,5 @@ */ diff --git a/src/Events/BeforeFunctionsDeployed.php b/src/Events/BeforeFunctionsDeployed.php index e2776c7..187ad4e 100644 --- a/src/Events/BeforeFunctionsDeployed.php +++ b/src/Events/BeforeFunctionsDeployed.php @@ -1,4 +1,5 @@ */ diff --git a/src/Exceptions/ConfigurationException.php b/src/Exceptions/ConfigurationException.php index a76a6e7..19ee472 100644 --- a/src/Exceptions/ConfigurationException.php +++ b/src/Exceptions/ConfigurationException.php @@ -1,4 +1,5 @@ */ diff --git a/src/Exceptions/FunctionNotFoundException.php b/src/Exceptions/FunctionNotFoundException.php index 008dd44..5a84e56 100644 --- a/src/Exceptions/FunctionNotFoundException.php +++ b/src/Exceptions/FunctionNotFoundException.php @@ -1,4 +1,5 @@ */ diff --git a/src/Exceptions/LambdaExecutionException.php b/src/Exceptions/LambdaExecutionException.php index 1aa1620..c514928 100644 --- a/src/Exceptions/LambdaExecutionException.php +++ b/src/Exceptions/LambdaExecutionException.php @@ -1,4 +1,5 @@ */ diff --git a/src/Exceptions/NoFunctionsRegisteredException.php b/src/Exceptions/NoFunctionsRegisteredException.php index 6ad544d..896f40e 100644 --- a/src/Exceptions/NoFunctionsRegisteredException.php +++ b/src/Exceptions/NoFunctionsRegisteredException.php @@ -1,4 +1,5 @@ */ diff --git a/src/Exceptions/SidecarException.php b/src/Exceptions/SidecarException.php index 0501f82..82e2261 100644 --- a/src/Exceptions/SidecarException.php +++ b/src/Exceptions/SidecarException.php @@ -1,4 +1,5 @@ */ diff --git a/src/LambdaFunction.php b/src/LambdaFunction.php index 7524e54..3b766ce 100644 --- a/src/LambdaFunction.php +++ b/src/LambdaFunction.php @@ -1,4 +1,5 @@ */ diff --git a/src/Manager.php b/src/Manager.php index 674e283..303eaa6 100644 --- a/src/Manager.php +++ b/src/Manager.php @@ -1,4 +1,5 @@ */ diff --git a/src/Package.php b/src/Package.php index d959403..67920f8 100644 --- a/src/Package.php +++ b/src/Package.php @@ -1,4 +1,5 @@ */ diff --git a/src/Providers/SidecarServiceProvider.php b/src/Providers/SidecarServiceProvider.php index 9ef3679..4c9d635 100644 --- a/src/Providers/SidecarServiceProvider.php +++ b/src/Providers/SidecarServiceProvider.php @@ -1,4 +1,5 @@ */ diff --git a/src/Region.php b/src/Region.php index ec3e734..1b6ba93 100644 --- a/src/Region.php +++ b/src/Region.php @@ -1,4 +1,5 @@ */ diff --git a/src/Results/PendingResult.php b/src/Results/PendingResult.php index bcc8f5d..0a9dec2 100644 --- a/src/Results/PendingResult.php +++ b/src/Results/PendingResult.php @@ -1,4 +1,5 @@ */ diff --git a/src/Results/ResultContract.php b/src/Results/ResultContract.php index 11c6cb1..91628fe 100644 --- a/src/Results/ResultContract.php +++ b/src/Results/ResultContract.php @@ -1,4 +1,5 @@ */ diff --git a/src/Results/SettledResult.php b/src/Results/SettledResult.php index 426f91c..1999da2 100644 --- a/src/Results/SettledResult.php +++ b/src/Results/SettledResult.php @@ -1,4 +1,5 @@ */ diff --git a/src/Sidecar.php b/src/Sidecar.php index 39bd17e..ba0f2cf 100644 --- a/src/Sidecar.php +++ b/src/Sidecar.php @@ -1,4 +1,5 @@ */ diff --git a/src/WarmingConfig.php b/src/WarmingConfig.php index dcfcb82..ba8c066 100644 --- a/src/WarmingConfig.php +++ b/src/WarmingConfig.php @@ -1,4 +1,5 @@ */ diff --git a/tests/Unit/Base.php b/tests/Unit/Base.php index 8847fba..35e3001 100644 --- a/tests/Unit/Base.php +++ b/tests/Unit/Base.php @@ -1,4 +1,5 @@ */ diff --git a/tests/Unit/Commands/ActivateTest.php b/tests/Unit/Commands/ActivateTest.php index 9799a6e..a7d7524 100644 --- a/tests/Unit/Commands/ActivateTest.php +++ b/tests/Unit/Commands/ActivateTest.php @@ -1,4 +1,5 @@ */ diff --git a/tests/Unit/Commands/ConfigureTest.php b/tests/Unit/Commands/ConfigureTest.php index 087ee49..b7c12b2 100644 --- a/tests/Unit/Commands/ConfigureTest.php +++ b/tests/Unit/Commands/ConfigureTest.php @@ -1,4 +1,5 @@ */ diff --git a/tests/Unit/Commands/DeployTest.php b/tests/Unit/Commands/DeployTest.php index 34eaa43..beba15c 100644 --- a/tests/Unit/Commands/DeployTest.php +++ b/tests/Unit/Commands/DeployTest.php @@ -1,4 +1,5 @@ */ diff --git a/tests/Unit/DeploymentTest.php b/tests/Unit/DeploymentTest.php index 8bd35e7..163f485 100644 --- a/tests/Unit/DeploymentTest.php +++ b/tests/Unit/DeploymentTest.php @@ -1,4 +1,5 @@ */ diff --git a/tests/Unit/EnvironmentMismatchTest.php b/tests/Unit/EnvironmentMismatchTest.php index 54422cb..3f1ca60 100644 --- a/tests/Unit/EnvironmentMismatchTest.php +++ b/tests/Unit/EnvironmentMismatchTest.php @@ -1,4 +1,5 @@ */ diff --git a/tests/Unit/EnvironmentTest.php b/tests/Unit/EnvironmentTest.php index ad846bd..a8ab4be 100644 --- a/tests/Unit/EnvironmentTest.php +++ b/tests/Unit/EnvironmentTest.php @@ -1,4 +1,5 @@ */ diff --git a/tests/Unit/ExecuteMultipleTest.php b/tests/Unit/ExecuteMultipleTest.php index e5e7ac8..e7fcc0e 100644 --- a/tests/Unit/ExecuteMultipleTest.php +++ b/tests/Unit/ExecuteMultipleTest.php @@ -1,4 +1,5 @@ */ diff --git a/tests/Unit/ExecuteTest.php b/tests/Unit/ExecuteTest.php index 8aeebdd..6d67f87 100644 --- a/tests/Unit/ExecuteTest.php +++ b/tests/Unit/ExecuteTest.php @@ -1,4 +1,5 @@ */ diff --git a/tests/Unit/FunctionTest.php b/tests/Unit/FunctionTest.php index 54718b8..e852470 100644 --- a/tests/Unit/FunctionTest.php +++ b/tests/Unit/FunctionTest.php @@ -1,4 +1,5 @@ */ diff --git a/tests/Unit/LambdaClientTest.php b/tests/Unit/LambdaClientTest.php index dfc5743..f254abe 100644 --- a/tests/Unit/LambdaClientTest.php +++ b/tests/Unit/LambdaClientTest.php @@ -1,4 +1,5 @@ */ diff --git a/tests/Unit/PackageTest.php b/tests/Unit/PackageTest.php index 8aad7d1..76efabd 100644 --- a/tests/Unit/PackageTest.php +++ b/tests/Unit/PackageTest.php @@ -1,4 +1,5 @@ */ diff --git a/tests/Unit/Support/DeploymentTestFunction.php b/tests/Unit/Support/DeploymentTestFunction.php index e069602..6c88749 100644 --- a/tests/Unit/Support/DeploymentTestFunction.php +++ b/tests/Unit/Support/DeploymentTestFunction.php @@ -1,4 +1,5 @@ */ diff --git a/tests/Unit/Support/DeploymentTestFunctionWithImage.php b/tests/Unit/Support/DeploymentTestFunctionWithImage.php index 7c3136e..03db9a5 100644 --- a/tests/Unit/Support/DeploymentTestFunctionWithImage.php +++ b/tests/Unit/Support/DeploymentTestFunctionWithImage.php @@ -1,4 +1,5 @@ */ diff --git a/tests/Unit/Support/DeploymentTestFunctionWithTags.php b/tests/Unit/Support/DeploymentTestFunctionWithTags.php index fee7adf..1c3cf32 100644 --- a/tests/Unit/Support/DeploymentTestFunctionWithTags.php +++ b/tests/Unit/Support/DeploymentTestFunctionWithTags.php @@ -1,4 +1,5 @@ */ diff --git a/tests/Unit/Support/DeploymentTestFunctionWithVariables.php b/tests/Unit/Support/DeploymentTestFunctionWithVariables.php index e1ca99c..4783d81 100644 --- a/tests/Unit/Support/DeploymentTestFunctionWithVariables.php +++ b/tests/Unit/Support/DeploymentTestFunctionWithVariables.php @@ -1,4 +1,5 @@ */ diff --git a/tests/Unit/Support/EmptyTestFunction.php b/tests/Unit/Support/EmptyTestFunction.php index 215b334..35c7394 100644 --- a/tests/Unit/Support/EmptyTestFunction.php +++ b/tests/Unit/Support/EmptyTestFunction.php @@ -1,4 +1,5 @@ */