-
Notifications
You must be signed in to change notification settings - Fork 3
Fix major errors found by PHPStan #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -100,7 +100,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int | |
| $region = $this->selectAwsRegion(); | ||
| IO::spin('deploying'); | ||
| $config['region'] = $region; | ||
| $deployment = $brefCloud->createDeployment($environment, $config, $gitRef, $gitMessage, $awsAccountName, $region); | ||
| $deployment = $brefCloud->createDeployment($environment, $config, $gitRef, $gitMessage, $awsAccountName); | ||
| } else { | ||
| IO::spinError(); | ||
| throw $e; | ||
|
|
@@ -253,7 +253,7 @@ private function getGitDetails(): array | |
| $gitMessage = explode("\n", $gitMessage)[0]; | ||
|
|
||
| IO::verbose('Git ref: ' . $gitRef); | ||
| $gitMessageLog = explode("\n", $gitMessage)[0] ?? ''; | ||
| $gitMessageLog = explode("\n", $gitMessage)[0]; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. gitMessage comes from the previous explode(), so it is always a string |
||
| IO::verbose(sprintf( | ||
| 'Git commit message: "%s%s"', | ||
| substr($gitMessageLog, 0, 80), | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -185,23 +185,26 @@ private function retrieveOutputs(string $environment, array $awsCredentials, ?st | |
| // If plugins add extra output afterward, it should be ignored. | ||
| $outputsResults = preg_match('/Stack Outputs:\n(( {2}[ \S]+\n)+)/', $infoOutput, $matches); | ||
| // Also try to extract the stack name and region | ||
| $stackResults = preg_match('/stack: (.*)\n/', $infoOutput, $matches); | ||
| $regionResults = preg_match('/region: (.*)\n/', $infoOutput, $matches); | ||
| $stackResults = preg_match('/stack: (.*)\n/', $infoOutput, $stackMatches); | ||
| $regionResults = preg_match('/region: (.*)\n/', $infoOutput, $regionMatches); | ||
|
Comment on lines
-188
to
+189
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there were 3
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you! I think this happened after a refactor the code makes no sense indeed |
||
| if ($outputsResults && $stackResults && $regionResults) { | ||
| try { | ||
| $stackOutputs = Yaml::parse($matches[1]); | ||
| if (! is_array($stackOutputs)) { | ||
| throw new Exception('Invalid stack outputs in the "serverless info" output'); | ||
| } | ||
| $stackOutputs = $this->cleanupCfOutputs($stackOutputs); | ||
| $stackName = $matches[2]; | ||
|
|
||
| $stackName = $stackMatches[1]; | ||
| if (! is_string($stackName)) { | ||
| throw new Exception('Invalid stack name in the "serverless info" output'); | ||
| } | ||
| $region = $matches[3]; | ||
|
|
||
| $region = $regionMatches[1]; | ||
| if (! is_string($region)) { | ||
| throw new Exception('Invalid region in the "serverless info" output'); | ||
| } | ||
|
|
||
| return array_merge([ | ||
| 'stack' => $stackName, | ||
| 'region' => $region, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
createDeployment has no region parameter