/home/techb158/immovalet.com/platform/core/base/src/Supports
Edit: /home/techb158/immovalet.com/platform/core/base/src/Supports/BreadcrumbsGenerator.php (1729B)
breadcrumbs = new Collection;
$this->callbacks = $callbacks;
foreach ($before as $callback) {
$callback($this);
}
$this->call($name, $params);
foreach ($after as $callback) {
$callback($this);
}
return $this->breadcrumbs;
}
/**
* @param string $name
* @param array $params
* @throws Exception
*/
protected function call(string $name, array $params): void
{
if (!isset($this->callbacks[$name])) {
throw new Exception($name);
}
$this->callbacks[$name]($this, ...$params);
}
/**
* @param string $name
* @param mixed ...$params
* @throws Exception
*/
public function parent(string $name, ...$params): void
{
$this->call($name, $params);
}
/**
* @param string $title
* @param string|null $url
* @param array $data
*/
public function push(string $title, string $url = null, array $data = []): void
{
$this->breadcrumbs->push((object)array_merge($data, compact('title', 'url')));
}
}