@@ -68,7 +68,12 @@ public static function name(): string
6868 return static ::$ displayName ?? Str::afterLast (static ::class, '\\' );
6969 }
7070
71- public function enable (bool $ useDefaults = false , array $ passthroughOptions = [], string $ runOptions = null ): void
71+ public static function category (): string
72+ {
73+ return static ::$ category ?? 'Other ' ;
74+ }
75+
76+ public function enable (bool $ useDefaults = false , array $ passthroughOptions = [], ?string $ runOptions = null ): void
7277 {
7378 $ this ->useDefaults = $ useDefaults ;
7479
@@ -80,9 +85,9 @@ public function enable(bool $useDefaults = false, array $passthroughOptions = []
8085
8186 try {
8287 $ this ->docker ->bootContainer (
83- join (' ' , array_filter ([
88+ implode (' ' , array_filter ([
8489 $ runOptions ,
85- $ this ->sanitizeDockerRunTemplate ($ this ->dockerRunTemplate ),
90+ $ this ->sanitizeDockerRunTemplate ($ this ->dockerRunTemplate () ),
8691 $ this ->buildPassthroughOptionsString ($ passthroughOptions ),
8792 ])),
8893 $ this ->buildParameters (),
@@ -111,11 +116,6 @@ public function forwardShell(): void
111116 $ this ->docker ->forwardShell ($ service ['container_id ' ], $ this ->shellCommand ());
112117 }
113118
114- protected function shellCommand (): string
115- {
116- return 'bash ' ;
117- }
118-
119119 public function organization (): string
120120 {
121121 return $ this ->organization ;
@@ -126,11 +126,6 @@ public function imageName(): string
126126 return $ this ->imageName ;
127127 }
128128
129- public static function category (): string
130- {
131- return static ::$ category ?? 'Other ' ;
132- }
133-
134129 public function shortName (): string
135130 {
136131 return strtolower (class_basename (static ::class));
@@ -146,6 +141,29 @@ public function defaultPort(): int
146141 return $ this ->defaultPort ;
147142 }
148143
144+ public function sanitizeDockerRunTemplate ($ dockerRunTemplate ): string
145+ {
146+ if ($ this ->environment ->isWindowsOs ()) {
147+ return stripslashes ($ dockerRunTemplate );
148+ }
149+
150+ return $ dockerRunTemplate ;
151+ }
152+
153+ public function buildPassthroughOptionsString (array $ passthroughOptions ): string
154+ {
155+ if (empty ($ passthroughOptions )) {
156+ return '' ;
157+ }
158+
159+ return implode (' ' , $ passthroughOptions );
160+ }
161+
162+ protected function shellCommand (): string
163+ {
164+ return 'bash ' ;
165+ }
166+
149167 protected function ensureImageIsDownloaded (): void
150168 {
151169 if ($ this ->docker ->imageIsDownloaded ($ this ->organization , $ this ->imageName , $ this ->tag )) {
@@ -244,22 +262,4 @@ protected function containerName(): string
244262
245263 return 'TO-- ' . $ this ->shortName () . '-- ' . $ this ->tag . $ portTag ;
246264 }
247-
248- public function sanitizeDockerRunTemplate ($ dockerRunTemplate ): string
249- {
250- if ($ this ->environment ->isWindowsOs ()) {
251- return stripslashes ($ dockerRunTemplate );
252- }
253-
254- return $ dockerRunTemplate ;
255- }
256-
257- public function buildPassthroughOptionsString (array $ passthroughOptions ): string
258- {
259- if (empty ($ passthroughOptions )) {
260- return '' ;
261- }
262-
263- return join (' ' , $ passthroughOptions );
264- }
265265}
0 commit comments