@@ -72,7 +72,7 @@ public function __construct(
72
72
73
73
public function getFileDestPath (DocumentTypeInterface $ documentType , string $ filePath ): string
74
74
{
75
- return $ this ->resolveDestFilePath ($ documentType , $ filePath , $ this ->resolvePath ($ documentType, ' file ' ));
75
+ return $ this ->resolveDestFilePath ($ documentType , $ filePath , $ this ->resolvePath ($ documentType ));
76
76
}
77
77
78
78
public function getImageDestPath (DocumentTypeInterface $ documentType , string $ filePath ): string
@@ -88,7 +88,8 @@ public function getFilePath(DocumentInterface $document): string
88
88
89
89
public function getImagePath (DocumentInterface $ document ): string
90
90
{
91
- return $ this ->filesystem ->getDirectoryRead (DirectoryList::MEDIA )->getAbsolutePath ($ document ->getImageFileName ());
91
+ return $ this ->filesystem ->getDirectoryRead (DirectoryList::MEDIA )
92
+ ->getAbsolutePath ($ document ->getImageFileName ());
92
93
}
93
94
94
95
public function getRelativeFilePath (string $ filePath ): string
@@ -99,7 +100,7 @@ public function getRelativeFilePath(string $filePath): string
99
100
public function lookupFiles (DocumentTypeInterface $ documentType , ?int $ flags = null ): array
100
101
{
101
102
$ sourcePath = rtrim ($ this ->filesystem ->getDirectoryRead (DirectoryList::MEDIA )->getAbsolutePath (
102
- $ this ->resolvePath ($ documentType, ' file ' ) . ltrim ($ documentType ->getFileSourcePath (), DIRECTORY_SEPARATOR )
103
+ $ this ->resolvePath ($ documentType ) . ltrim ($ documentType ->getFileSourcePath (), DIRECTORY_SEPARATOR )
103
104
), DIRECTORY_SEPARATOR );
104
105
105
106
return Glob::glob (
@@ -129,21 +130,21 @@ public function deleteFile(string $filePath): bool
129
130
return false ;
130
131
}
131
132
132
- private function resolvePath (DocumentTypeInterface $ documentType, string $ fileType ): string
133
+ private function resolvePath (DocumentTypeInterface $ documentType ): string
133
134
{
134
- return $ this ->pathResolver ->resolvePath ($ documentType ) . DIRECTORY_SEPARATOR . $ fileType . DIRECTORY_SEPARATOR ;
135
+ return $ this ->pathResolver ->resolvePath ($ documentType );
135
136
}
136
137
137
138
private function resolveFileSubPath (DocumentTypeInterface $ documentType , string $ fileName ): string
138
139
{
139
140
return implode (
140
- DIRECTORY_SEPARATOR ,
141
- array_slice (
142
- (array ) mb_str_split (strtolower (preg_replace ('/\W+/ ' , '' , pathinfo ($ fileName , PATHINFO_FILENAME )))),
143
- 0 ,
144
- $ documentType ->getSubPathLength ()
145
- )
146
- ) . DIRECTORY_SEPARATOR . $ fileName ;
141
+ DIRECTORY_SEPARATOR ,
142
+ array_slice (
143
+ (array ) mb_str_split (strtolower (preg_replace ('/\W+/ ' , '' , pathinfo ($ fileName , PATHINFO_FILENAME )))),
144
+ 0 ,
145
+ $ documentType ->getSubPathLength ()
146
+ )
147
+ ) . DIRECTORY_SEPARATOR . $ fileName ;
147
148
}
148
149
149
150
private function resolveDestFilePath (
0 commit comments