8000 Fix typo > Prefered > Preferred · symfony-cli/symfony-cli@503c5ef · GitHub
[go: up one dir, main page]

Skip to content

Commit 503c5ef

Browse files
committed
Fix typo > Prefered > Preferred
1 parent d96ec9f commit 503c5ef

File tree

4 files changed

+34
-34
lines changed

4 files changed

+34
-34
lines changed

local/http/http.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ type ServerCallback func(w http.ResponseWriter, r *http.Request, env map[string]
4343

4444
// Server represents a server
4545
type Server struct {
46-
DocumentRoot string
47-
Callback ServerCallback
48-
PreferedPort int
49-
PKCS12 string
50-
AllowHTTP bool
51-
Logger zerolog.Logger
52-
Appversion string
46+
DocumentRoot string
47+
Callback ServerCallback
48+
PreferredPort int
49+
PKCS12 string
50+
AllowHTTP bool
51+
Logger zerolog.Logger
52+
Appversion string
5353

5454
httpserver *http.Server
5555
httpsserver *http.Server
@@ -59,7 +59,7 @@ type Server struct {
5959

6060
// Start starts the server
6161
func (s *Server) Start(errChan chan error) (int, error) {
62-
ln, port, err := process.CreateListener(s.PreferedPort)
62+
ln, port, err := process.CreateListener(s.PreferredPort)
6363
if err != nil {
6464
return port, errors.WithStack(err)
6565
}

local/process/listener.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ import (
2727
)
2828

2929
// CreateListener creates a listener on a port
30-
// Pass a prefered port (will increment by 1 if port is not available)
30+
// Pass a preferred port (will increment by 1 if port is not available)
3131
// or pass 0 to auto-find any available port
32-
func CreateListener(preferedPort int) (net.Listener, int, error) {
32+
func CreateListener(preferredPort int) (net.Listener, int, error) {
3333
var ln net.Listener
3434
var err error
35-
port := preferedPort
35+
port := preferredPort
3636
max := 50
3737
for {
3838
// we really want to test availability on 127.0.0.1
@@ -45,16 +45,16 @@ func CreateListener(preferedPort int) (net.Listener, int, error) {
4545
break
4646
}
4747
}
48-
if preferedPort == 0 {
48+
if preferredPort == 0 {
4949
return nil, 0, errors.Wrap(err, "unable to find an available port")
5050
}
5151
max--
5252
if max == 0 {
53-
return nil, 0, errors.Wrapf(err, "unable to find an available port (from %d to %d)", preferedPort, port)
53+
return nil, 0, errors.Wrapf(err, "unable to find an available port (from %d to %d)", preferredPort, port)
5454
}
5555
port++
5656
}
57-
if preferedPort == 0 {
57+
if preferredPort == 0 {
5858
port = ln.Addr().(*net.TCPAddr).Port
5959
}
6060
return ln, port, nil

local/project/config.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@ import (
3232

3333
// Config is the struct taken by New (should not be used for anything else)
3434
type Config struct {
35-
HomeDir string
36-
ProjectDir string
37-
DocumentRoot string `yaml:"document_root"`
38-
Passthru string `yaml:"passthru"`
39-
PreferedPort int `yaml:"prefered_port"`
40-
PKCS12 string `yaml:"p12"`
41-
Logger zerolog.Logger
42-
AppVersion string
43-
AllowHTTP bool `yaml:"allow_http"`
44-
NoTLS bool `yaml:"no_tls"`
45-
Daemon bool `yaml:"daemon"`
35+
HomeDir string
36+
ProjectDir string
37+
DocumentRoot string `yaml:"document_root"`
38+
Passthru string `yaml:"passthru"`
39+
PreferredPort int `yaml:"preferred_port"`
40+
PKCS12 string `yaml:"p12"`
41+
Logger zerolog.Logger
42+
AppVersion string
43+
AllowHTTP bool `yaml:"allow_http"`
44+
NoTLS bool `yaml:"no_tls"`
45+
Daemon bool `yaml:"daemon"`
4646
}
4747

4848
type FileConfig struct {
@@ -85,10 +85,10 @@ func NewConfigFromContext(c *console.Context, projectDir string) (*Config, *File
8585
config.Passthru = c.String("passthru")
8686
}
8787
if c.IsSet("port") {
88-
config.PreferedPort = c.Int("port")
88+
config.PreferredPort = c.Int("port")
8989
}
90-
if config.PreferedPort == 0 {
91-
config.PreferedPort = 8000
90+
if config.PreferredPort == 0 {
91+
config.PreferredPort = 8000
9292
}
9393
if c.IsSet("allow-http") {
9494
config.AllowHTTP = c.Bool("allow-http")

local/project/project.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ func New(c *Config) (*Project, error) {
5454
homeDir: c.HomeDir,
5555
projectDir: c.ProjectDir,
5656
HTTP: &lhttp.Server{
57-
DocumentRoot: documentRoot,
58-
PreferedPort: c.PreferedPort,
59-
Logger: c.Logger,
60-
PKCS12: c.PKCS12,
61-
AllowHTTP: c.AllowHTTP,
62-
Appversion: c.AppVersion,
57+
DocumentRoot: documentRoot,
58+
PreferredPort: c.PreferredPort,
59+
Logger: c.Logger,
60+
PKCS12: c.PKCS12,
61+
AllowHTTP: c.AllowHTTP,
62+
Appversion: c.AppVersion,
6363
},
6464
}
6565
if err != nil {

0 commit comments

Comments
 (0)
0