Code Duplication    Length = 9-10 lines in 3 locations

php/elFinder.class.php 3 locations

@@ 878-886 (lines=9) @@
875
	 * @return array
876
	 * @author Dmitry (dio) Levashov
877
	 **/
878
	protected function ls($args) {
879
		$target = $args['target'];
880
		
881
		if (($volume = $this->volume($target)) == false
882
		|| ($list = $volume->ls($target)) === false) {
883
			return array('error' => $this->error(self::ERROR_OPEN, '#'.$target));
884
		}
885
		return array('list' => $list);
886
	}
887
	
888
	/**
889
	 * Return subdirs for required directory
@@ 895-904 (lines=10) @@
892
	 * @return array
893
	 * @author Dmitry (dio) Levashov
894
	 **/
895
	protected function tree($args) {
896
		$target = $args['target'];
897
		
898
		if (($volume = $this->volume($target)) == false
899
		|| ($tree = $volume->tree($target)) == false) {
900
			return array('error' => $this->error(self::ERROR_OPEN, '#'.$target));
901
		}
902
903
		return array('tree' => $tree);
904
	}
905
	
906
	/**
907
	 * Return parents dir for required directory
@@ 913-922 (lines=10) @@
910
	 * @return array
911
	 * @author Dmitry (dio) Levashov
912
	 **/
913
	protected function parents($args) {
914
		$target = $args['target'];
915
		
916
		if (($volume = $this->volume($target)) == false
917
		|| ($tree = $volume->parents($target)) == false) {
918
			return array('error' => $this->error(self::ERROR_OPEN, '#'.$target));
919
		}
920
921
		return array('tree' => $tree);
922
	}
923
	
924
	/**
925
	 * Return new created thumbnails list