@@ -12,15 +12,16 @@ class DownloadAssetsCommand extends Command
1212
1313 public function handle (): void
1414 {
15- $ this ->downloadFileFromCDN (GraphiQLAsset::REACT_JS_LOCAL_PATH , GraphiQLAsset::REACT_JS_SOURCE_URL );
16- $ this ->downloadFileFromCDN (GraphiQLAsset::REACT_DOM_JS_LOCAL_PATH , GraphiQLAsset::REACT_DOM_JS_SOURCE_URL );
17- $ this ->downloadFileFromCDN (GraphiQLAsset::GRAPHIQL_CSS_LOCAL_PATH , GraphiQLAsset::GRAPHIQL_CSS_SOURCE_URL );
18- $ this ->downloadFileFromCDN (GraphiQLAsset::GRAPHIQL_JS_LOCAL_PATH , GraphiQLAsset::GRAPHIQL_JS_SOURCE_URL );
19- $ this ->downloadFileFromCDN (GraphiQLAsset::PLUGIN_EXPLORER_JS_LOCAL_PATH , GraphiQLAsset::PLUGIN_EXPLORER_JS_SOURCE_URL );
20- $ this ->downloadFileFromCDN (GraphiQLAsset::FAVICON_LOCAL_PATH , GraphiQLAsset::FAVICON_SOURCE_URL );
15+ $ this ->downloadFile (GraphiQLAsset::REACT_JS_LOCAL_PATH , GraphiQLAsset::REACT_JS_SOURCE_URL );
16+ $ this ->downloadFile (GraphiQLAsset::REACT_DOM_JS_LOCAL_PATH , GraphiQLAsset::REACT_DOM_JS_SOURCE_URL );
17+ $ this ->downloadFile (GraphiQLAsset::GRAPHIQL_CSS_LOCAL_PATH , GraphiQLAsset::GRAPHIQL_CSS_SOURCE_URL );
18+ $ this ->downloadFile (GraphiQLAsset::PLUGIN_EXPLORER_CSS_LOCAL_PATH , GraphiQLAsset::PLUGIN_EXPLORER_CSS_SOURCE_URL );
19+ $ this ->downloadFile (GraphiQLAsset::GRAPHIQL_JS_LOCAL_PATH , GraphiQLAsset::GRAPHIQL_JS_SOURCE_URL );
20+ $ this ->downloadFile (GraphiQLAsset::PLUGIN_EXPLORER_JS_LOCAL_PATH , GraphiQLAsset::PLUGIN_EXPLORER_JS_SOURCE_URL );
21+ $ this ->downloadFile (GraphiQLAsset::FAVICON_LOCAL_PATH , GraphiQLAsset::FAVICON_SOURCE_URL );
2122 }
2223
23- protected function downloadFileFromCDN (string $ localPath , string $ cdnPath ): void
24+ protected function downloadFile (string $ localPath , string $ sourceURL ): void
2425 {
2526 $ publicPath = GraphiQLAsset::publicPath ($ localPath );
2627
@@ -30,48 +31,12 @@ protected function downloadFileFromCDN(string $localPath, string $cdnPath): void
3031 mkdir ($ directory , 0777 , true );
3132 }
3233
33- $ contents = file_get_contents ($ cdnPath );
34+ $ contents = file_get_contents ($ sourceURL );
3435 if ($ contents === false ) {
3536 $ error = error_get_last ();
3637 throw new \ErrorException ($ error ['message ' ] ?? 'An error occurred ' , 0 , $ error ['type ' ] ?? 1 );
3738 }
3839
3940 file_put_contents ($ publicPath , $ contents );
4041 }
41-
42- /** @deprecated use GraphiQLAsset::reactJS, this alias will be removed in the next major version */
43- public static function reactPath (): string
44- {
45- return GraphiQLAsset::reactJS ();
46- }
47-
48- /** @deprecated use GraphiQLAsset::reactDOMJS, this alias will be removed in the next major version */
49- public static function reactDOMPath (): string
50- {
51- return GraphiQLAsset::reactDOMJS ();
52- }
53-
54- /** @deprecated use GraphiQLAsset::graphiQLJS, this alias will be removed in the next major version */
55- public static function jsPath (): string
56- {
57- return GraphiQLAsset::graphiQLJS ();
58- }
59-
60- /** @deprecated use GraphiQLAsset::pluginExplorerJS, this alias will be removed in the next major version */
61- public static function pluginExplorerPath (): string
62- {
63- return GraphiQLAsset::pluginExplorerJS ();
64- }
65-
66- /** @deprecated use GraphiQLAsset::graphiQLCSS, this alias will be removed in the next major version */
67- public static function cssPath (): string
68- {
69- return GraphiQLAsset::graphiQLCSS ();
70- }
71-
72- /** @deprecated use GraphiQLAsset::favicon, this alias will be removed in the next major version */
73- public static function faviconPath (): string
74- {
75- return GraphiQLAsset::favicon ();
76- }
7742}
0 commit comments