@@ -118,10 +118,10 @@ public function files()
118
118
119
119
public function pretty ($ item_path )
120
120
{
121
- $ lfm_path = clone $ this ;
122
- $ lfm_path = $ lfm_path ->setName ($ this ->helper ->getNameFromPath ($ item_path ));
123
-
124
- return Container:: getInstance ()-> makeWith (LfmItem::class, [ ' lfm ' => $ lfm_path , ' helper ' => $ this -> helper ]);
121
+ return Container:: getInstance ()-> makeWith (LfmItem::class, [
122
+ ' lfm ' => ( clone $ this ) ->setName ($ this ->helper ->getNameFromPath ($ item_path )),
123
+ ' helper ' => $ this -> helper
124
+ ]);
125
125
}
126
126
127
127
public function delete ()
@@ -153,18 +153,11 @@ public function isDirectory()
153
153
$ working_dir = $ this ->path ('working_dir ' );
154
154
$ parent_dir = substr ($ working_dir , 0 , strrpos ($ working_dir , '/ ' ));
155
155
156
- $ parent_path = app (static ::class);
157
- $ parent_path ->dir ($ parent_dir )->setName (null );
158
-
159
- $ directories = $ parent_path ->directories ();
160
-
161
- $ that = $ this ;
162
-
163
- $ directories = array_map (function ($ directory_path ) use ($ that ) {
164
- return $ this ->translateToLfmPath ($ directory_path );
165
- }, $ directories );
156
+ $ parent_directories = array_map (function ($ directory_path ) {
157
+ return app (static ::class)->translateToLfmPath ($ directory_path );
158
+ }, app (static ::class)->dir ($ parent_dir )->directories ());
166
159
167
- return in_array ($ this ->path ('url ' ), $ directories );
160
+ return in_array ($ this ->path ('url ' ), $ parent_directories );
168
161
}
169
162
170
163
/**
0 commit comments