@@ -43,15 +43,15 @@ public function __invoke(): int
4343
4444 $ pluginPath = Plugin::PLUGIN_PATH . '/ ' . $ path ;
4545 if (file_exists ($ pluginPath )) {
46- $ this ->output ->error (sprintf ('Plugin directory %s already exists ' , $ path ));
46+ $ this ->output ->error (\ sprintf ('Plugin directory %s already exists ' , $ path ));
4747 return AbstractCommand::FAILURE ;
4848 }
4949 $ createDirectors = [
5050 $ pluginPath , $ pluginPath . '/src ' , $ pluginPath . '/Database ' , $ pluginPath . '/Database/Migrations ' , $ pluginPath . '/Database/Seeder ' , $ pluginPath . '/web ' ,
5151 ];
5252 foreach ($ createDirectors as $ directory ) {
53- if (! mkdir ($ directory , 0755 , true ) && ! is_dir ($ directory )) {
54- throw new \RuntimeException (sprintf ('Directory "%s" was not created ' , $ directory ));
53+ if (! mkdir ($ directory , 0o755 , true ) && ! is_dir ($ directory )) {
54+ throw new \RuntimeException (\ sprintf ('Directory "%s" was not created ' , $ directory ));
5555 }
5656 }
5757
@@ -97,24 +97,24 @@ public function createMineJson(string $path, string $name, PluginTypeEnum $plugi
9797 ];
9898 }
9999
100- $ output = json_encode ($ output , JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE , 512 );
100+ $ output = json_encode ($ output , \ JSON_THROW_ON_ERROR | \ JSON_PRETTY_PRINT | \ JSON_UNESCAPED_UNICODE , 512 );
101101 file_put_contents ($ path . '/mine.json ' , $ output );
102- $ this ->output ->success (sprintf ('%s 创建成功 ' , $ path . '/mine.json ' ));
102+ $ this ->output ->success (\ sprintf ('%s 创建成功 ' , $ path . '/mine.json ' ));
103103 }
104104
105105 public function createInstallScript (string $ namespace , string $ path ): void
106106 {
107107 $ installScript = $ this ->buildStub ('InstallScript ' , compact ('namespace ' ));
108108 $ installScriptPath = $ path . '/src/InstallScript.php ' ;
109109 file_put_contents ($ installScriptPath , $ installScript );
110- $ this ->output ->success (sprintf ('%s Created Successfully ' , $ installScriptPath ));
110+ $ this ->output ->success (\ sprintf ('%s Created Successfully ' , $ installScriptPath ));
111111 }
112112
113113 public function buildStub (string $ stub , array $ replace ): string
114114 {
115115 $ stubPath = $ this ->getStubDirectory () . '/ ' . $ stub . '.stub ' ;
116116 if (! file_exists ($ stubPath )) {
117- throw new \RuntimeException (sprintf ('File %s does not exist ' , $ stubPath ));
117+ throw new \RuntimeException (\ sprintf ('File %s does not exist ' , $ stubPath ));
118118 }
119119 $ stubBody = file_get_contents ($ stubPath );
120120 foreach ($ replace as $ key => $ value ) {
@@ -133,15 +133,15 @@ public function createUninstallScript(string $namespace, string $path): void
133133 $ installScript = $ this ->buildStub ('UninstallScript ' , compact ('namespace ' ));
134134 $ installScriptPath = $ path . '/src/UninstallScript.php ' ;
135135 file_put_contents ($ installScriptPath , $ installScript );
136- $ this ->output ->success (sprintf ('%s Created Successfully ' , $ installScriptPath ));
136+ $ this ->output ->success (\ sprintf ('%s Created Successfully ' , $ installScriptPath ));
137137 }
138138
139139 public function createConfigProvider (string $ namespace , string $ path ): void
140140 {
141141 $ installScript = $ this ->buildStub ('ConfigProvider ' , compact ('namespace ' ));
142142 $ installScriptPath = $ path . '/src/ConfigProvider.php ' ;
143143 file_put_contents ($ installScriptPath , $ installScript );
144- $ this ->output ->success (sprintf ('%s Created Successfully ' , $ installScriptPath ));
144+ $ this ->output ->success (\ sprintf ('%s Created Successfully ' , $ installScriptPath ));
145145 }
146146
147147 protected function configure (): void
@@ -155,6 +155,6 @@ protected function configure(): void
155155
156156 private function createViewScript (string $ namespace , string $ path ): void
157157 {
158- ! is_dir ($ path . '/web ' ) && mkdir ($ path . '/web ' , 0775 );
158+ ! is_dir ($ path . '/web ' ) && mkdir ($ path . '/web ' , 0o775 );
159159 }
160160}
0 commit comments