diff --git a/commands/init_templating_php.go b/commands/init_templating_php.go index 595449cc..6e43494a 100644 --- a/commands/init_templating_php.go +++ b/commands/init_templating_php.go @@ -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 } @@ -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 } diff --git a/commands/local_new.go b/commands/local_new.go index a187a462..200c193f 100644 --- a/commands/local_new.go +++ b/commands/local_new.go @@ -153,7 +153,7 @@ 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 } @@ -161,7 +161,7 @@ var localNewCmd = &console.Command{ 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 } } @@ -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 } } @@ -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")) @@ -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 diff --git a/commands/local_proxy_url.go b/commands/local_proxy_url.go index c89f0233..3da02596 100644 --- a/commands/local_proxy_url.go +++ b/commands/local_proxy_url.go @@ -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) diff --git a/commands/openers.go b/commands/openers.go index 7e51e8a3..3607e5d1 100644 --- a/commands/openers.go +++ b/commands/openers.go @@ -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", diff --git a/commands/testdata/project/.upsun/config.yaml b/commands/testdata/project/.upsun/config.yaml index b88a2e09..d29f4321 100644 --- a/commands/testdata/project/.upsun/config.yaml +++ b/commands/testdata/project/.upsun/config.yaml @@ -21,10 +21,6 @@ applications: type: php:8.0 - dependencies: - php: - composer/composer: "^2" - runtime: extensions: - apcu