File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -104,15 +104,15 @@ public function moveTo($targetPath): void
104104 {
105105 $ targetPath = \Swoft::getAlias ($ targetPath );
106106 $ this ->validateActive ();
107- if (! $ this ->isStringNotEmpty ($ targetPath )) {
107+ if (!$ this ->isStringNotEmpty ($ targetPath )) {
108108 throw new \InvalidArgumentException ('Invalid path provided for move operation ' );
109109 }
110110
111111 if ($ this ->file ) {
112112 $ this ->validateSavePath ($ targetPath );
113113 $ this ->moved = move_uploaded_file ($ this ->file , $ targetPath );
114114 }
115- if (! $ this ->moved ) {
115+ if (!$ this ->moved ) {
116116 throw new \RuntimeException (sprintf ('Uploaded file could not be move to %s ' , $ targetPath ));
117117 }
118118 }
@@ -278,10 +278,11 @@ public function validateActive()
278278 * check file savePath
279279 * @param $targetPath
280280 */
281- public function validateSavePath ($ targetPath ){
281+ public function validateSavePath ($ targetPath )
282+ {
282283 $ dir = dirname ($ targetPath );
283- if (!is_dir ($ dir )&& !file_exists ($ dir )){
284- if (!mkdir ($ dir ,0777 ,true )){
284+ if (!is_dir ($ dir ) && !file_exists ($ dir )) {
285+ if (!mkdir ($ dir , 0777 , true )) {
285286 throw new \RuntimeException ("Cannot create directory " );
286287 }
287288 }
You can’t perform that action at this time.
0 commit comments