@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $jsVersion = $this->getVersion($js); |
70 | 70 | $output[] = '<script type="text/javascript" src="' . $this->getUrl($js) . '?v=' . $jsVersion . '"></script>'; |
71 | 71 | } else { |
72 | - $bundleJsMap[ 'sources' ][] = $js; |
|
72 | + $bundleJsMap['sources'][] = $js; |
|
73 | 73 | $bundleJsContents[] = file_get_contents($js); |
74 | 74 | } |
75 | 75 | } |
@@ -78,20 +78,20 @@ discard block |
||
78 | 78 | $bundleJsVersion = $this->getVersion(serialize($bundleJsContents)); |
79 | 79 | $bundleJsFilename = modules()->current()->getParameter(); |
80 | 80 | |
81 | - if(presenter()->page->file instanceof \SplFileInfo) { |
|
82 | - if(presenter()->page->file->getFilename() === 'index') { |
|
83 | - $bundleJsFilename.= '-body-' . presenter()->page->file->getDirectoryInfo()->getDirName(); |
|
81 | + if (presenter()->page->file instanceof \SplFileInfo) { |
|
82 | + if (presenter()->page->file->getFilename() === 'index') { |
|
83 | + $bundleJsFilename .= '-body-' . presenter()->page->file->getDirectoryInfo()->getDirName(); |
|
84 | 84 | } else { |
85 | - $bundleJsFilename.= '-body-' . presenter()->page->file->getDirectoryInfo()->getDirName() . '-' . presenter()->page->file->getFilename(); |
|
85 | + $bundleJsFilename .= '-body-' . presenter()->page->file->getDirectoryInfo()->getDirName() . '-' . presenter()->page->file->getFilename(); |
|
86 | 86 | } |
87 | - } elseif(services()->has('controller')) { |
|
88 | - $bundleJsFilename.= '-body-' . controller()->getParameter(); |
|
87 | + } elseif (services()->has('controller')) { |
|
88 | + $bundleJsFilename .= '-body-' . controller()->getParameter(); |
|
89 | 89 | |
90 | - if(controller()->getRequestMethod() !== 'index') { |
|
91 | - $bundleJsFilename.= '-' . router()->getRequestMethod(); |
|
90 | + if (controller()->getRequestMethod() !== 'index') { |
|
91 | + $bundleJsFilename .= '-' . router()->getRequestMethod(); |
|
92 | 92 | } |
93 | 93 | } else { |
94 | - $bundleJsFilename.= '-body-' . md5($bundleJsVersion); |
|
94 | + $bundleJsFilename .= '-body-' . md5($bundleJsVersion); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | $bundlePublicDir = modules()->current()->getPublicDir() . 'assets' . DIRECTORY_SEPARATOR; |
@@ -101,14 +101,14 @@ discard block |
||
101 | 101 | if (is_file($bundleJsFilePath . '.map')) { |
102 | 102 | $bundleJsMap = json_decode(file_get_contents($bundleJsFilePath . '.map'), true); |
103 | 103 | // if the file version is changed delete it first |
104 | - if ( ! hash_equals($bundleJsVersion, $bundleJsMap[ 'version' ])) { |
|
104 | + if ( ! hash_equals($bundleJsVersion, $bundleJsMap['version'])) { |
|
105 | 105 | unlink($bundleJsFilePath); |
106 | 106 | unlink($bundleJsFilePath . '.map'); |
107 | 107 | } |
108 | 108 | } |
109 | 109 | |
110 | 110 | if ( ! is_file($bundleJsFilePath)) { |
111 | - $bundleJsMap[ 'version' ] = $bundleJsVersion; |
|
111 | + $bundleJsMap['version'] = $bundleJsVersion; |
|
112 | 112 | |
113 | 113 | // Create css file |
114 | 114 | if (count($bundleJsContents)) { |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | } |
136 | 136 | } |
137 | 137 | |
138 | - if(is_file($bundleJsFilePath)) { |
|
138 | + if (is_file($bundleJsFilePath)) { |
|
139 | 139 | if (input()->env('DEBUG_STAGE') === 'PRODUCTION') { |
140 | 140 | $output[] = '<script type="text/javascript" src="' . $this->getUrl($bundleJsMinifyFilePath) . '?v=' . $bundleJsVersion . '"></script>'; |
141 | 141 | } else { |