Skip to content

Commit

Permalink
Merge pull request #455 from symfony-cli/cs
Browse files Browse the repository at this point in the history
Fix CS
  • Loading branch information
fabpot committed Mar 23, 2024
2 parents 9359e0e + 8a653da commit 4d3e823
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 32 deletions.
16 changes: 4 additions & 12 deletions commands/init_templating_php.go
Expand Up @@ -60,12 +60,8 @@ func hasComposerPackage(directory, pkg string) bool {
return false
}

if err != nil {
terminal.Logger.Warn().Msg(err.Error())
}
if err2 != nil {
terminal.Logger.Warn().Msg(err2.Error())
}
terminal.Logger.Warn().Msg(err.Error())
terminal.Logger.Warn().Msg(err2.Error())

return false
}
Expand Down Expand Up @@ -136,12 +132,8 @@ func hasPHPExtension(directory, ext string) bool {
return false
}

if err != nil {
terminal.Logger.Warn().Msg(err.Error())
}
if err2 != nil {
terminal.Logger.Warn().Msg(err2.Error())
}
terminal.Logger.Warn().Msg(err.Error())
terminal.Logger.Warn().Msg(err2.Error())

return false
}
Expand Down
10 changes: 5 additions & 5 deletions commands/local_new.go
Expand Up @@ -153,15 +153,15 @@ var localNewCmd = &console.Command{
return err
}

if "" != c.String("php") && !withCloud {
if c.String("php") != "" && !withCloud {
if err := createPhpVersionFile(c.String("php"), dir); err != nil {
return err
}
}

if !c.Bool("no-git") {
if _, err := exec.LookPath("git"); err == nil {
if err := initProjectGit(c, s, dir); err != nil {
if err := initProjectGit(c, dir); err != nil {
return err
}
}
Expand Down Expand Up @@ -197,7 +197,7 @@ var localNewCmd = &console.Command{
if c.Bool("upsun") {
brand = platformsh.UpsunBrand
}
if err := initCloud(c, brand, s, minorPHPVersion, dir); err != nil {
if err := initCloud(c, brand, minorPHPVersion, dir); err != nil {
return err
}
}
Expand Down Expand Up @@ -226,7 +226,7 @@ func isEmpty(dir string) (bool, error) {
return false, err
}

func initCloud(c *console.Context, brand platformsh.CloudBrand, s *terminal.Spinner, minorPHPVersion, dir string) error {
func initCloud(c *console.Context, brand platformsh.CloudBrand, minorPHPVersion, dir string) error {
terminal.Printfln("* Adding %s configuration", brand)

cloudServices, err := parseCloudServices(dir, c.StringSlice("service"))
Expand Down Expand Up @@ -335,7 +335,7 @@ func parseDockerComposeServices(dir string) []*CloudService {
return cloudServices
}

func initProjectGit(c *console.Context, s *terminal.Spinner, dir string) error {
func initProjectGit(c *console.Context, dir string) error {
terminal.Println("* Setting up the project under Git version control")
terminal.Printfln(" (running git init %s)\n", dir)
// Only force the branch to be "main" when running a Cloud context to make
Expand Down
2 changes: 1 addition & 1 deletion commands/local_proxy_url.go
Expand Up @@ -45,7 +45,7 @@ e.g. with Cypress:
Action: func(c *console.Context) error {
pidFile := pid.New("__proxy__", nil)
if !pidFile.IsRunning() {
return errors.New("The proxy server is not running")
return errors.New("the proxy server is not running")
}

url := fmt.Sprintf("%s://127.0.0.1:%d", pidFile.Scheme, pidFile.Port)
Expand Down
10 changes: 0 additions & 10 deletions commands/openers.go
Expand Up @@ -32,16 +32,6 @@ import (
"github.com/symfony-cli/terminal"
)

var openDocCmd = &console.Command{
Category: "open",
Name: "docs",
Usage: "Open the online Web documentation",
Action: func(c *console.Context) error {
abstractOpenCmd("https://symfony.com/doc/cloud")
return nil
},
}

var projectLocalOpenCmd = &console.Command{
Category: "open",
Name: "local",
Expand Down
4 changes: 0 additions & 4 deletions commands/testdata/project/.upsun/config.yaml
Expand Up @@ -21,10 +21,6 @@ applications:

type: php:8.0

dependencies:
php:
composer/composer: "^2"

runtime:
extensions:
- apcu
Expand Down

0 comments on commit 4d3e823

Please sign in to comment.