Code Duplication    Length = 13-14 lines in 2 locations

Ajax/semantic/html/collections/HtmlBreadcrumb.php 1 location

@@ 95-108 (lines=14) @@
92
	 * @param Dispatcher $dispatcher the request dispatcher
93
	 * @return \Ajax\bootstrap\html\HtmlBreadcrumbs
94
	 */
95
	public function fromDispatcher($dispatcher, $startIndex=0) {
96
		$this->startIndex=$startIndex;
97
		$params=$dispatcher->getParams();
98
		$action=$dispatcher->getActionName();
99
		$items=array ($dispatcher->getControllerName() );
100
		if (\sizeof($params) > 0 || \strtolower($action) != "index") {
101
			$items[]=$action;
102
			foreach ( $params as $p ) {
103
				if (\is_object($p) === false)
104
					$items[]=$p;
105
			}
106
		}
107
		return $this->addItems($items);
108
	}
109
110
	/**
111
	 * Return the url of the element at $index or the breadcrumbs url if $index is ommited

Ajax/php/phalcon/JsUtils.php 1 location

@@ 52-64 (lines=13) @@
49
		return $template;
50
	}
51
52
	public function fromDispatcher($dispatcher){
53
		$params=$dispatcher->getParams();
54
		$action=$dispatcher->getActionName();
55
		$items=array($dispatcher->getControllerName());
56
		if(\sizeof($params)>0 || \strtolower($action)!="index" ){
57
			$items[]=$action;
58
			foreach ($params as $p){
59
				if(\is_object($p)===false)
60
					$items[]=$p;
61
			}
62
		}
63
		return $items;
64
	}
65
}