mirror of
https://github.com/jbcr/core.git
synced 2026-04-24 09:08:08 +02:00
Remove $type, and remove the initial '' for $template
This commit is contained in:
@@ -14,13 +14,12 @@ use Twig\Environment;
|
||||
class BaseWidget implements WidgetInterface
|
||||
{
|
||||
protected $name = 'Nameless widget';
|
||||
protected $type = 'widget';
|
||||
protected $target = Target::NOWHERE;
|
||||
protected $zone = RequestZone::EVERYWHERE;
|
||||
protected $priority = 0;
|
||||
|
||||
/** @var string */
|
||||
protected $template = '';
|
||||
protected $template;
|
||||
|
||||
/** @var Response */
|
||||
protected $response;
|
||||
@@ -47,18 +46,6 @@ class BaseWidget implements WidgetInterface
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function setType(string $type): WidgetInterface
|
||||
{
|
||||
$this->type = $type;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getType(): string
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
public function setTarget(string $target): WidgetInterface
|
||||
{
|
||||
$this->target = $target;
|
||||
@@ -110,7 +97,7 @@ class BaseWidget implements WidgetInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTemplate(): string
|
||||
public function getTemplate(): ?string
|
||||
{
|
||||
return $this->template;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ use Bolt\Snippet\Target;
|
||||
class BoltHeaderWidget extends BaseWidget implements ResponseAware
|
||||
{
|
||||
protected $name = 'Bolt Header Widget';
|
||||
protected $type = 'snippet';
|
||||
protected $target = Target::NOWHERE;
|
||||
protected $zone = RequestZone::FRONTEND;
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ use Bolt\Snippet\Target;
|
||||
class CanonicalLinkWidget extends BaseWidget
|
||||
{
|
||||
protected $name = 'Canonical Link';
|
||||
protected $type = 'widget';
|
||||
protected $target = Target::NOWHERE;
|
||||
protected $zone = RequestZone::NOWHERE;
|
||||
protected $priority = 200;
|
||||
|
||||
@@ -14,7 +14,6 @@ use GuzzleHttp\Exception\RequestException;
|
||||
class NewsWidget extends BaseWidget implements TwigAware, RequestAware
|
||||
{
|
||||
protected $name = 'News Widget';
|
||||
protected $type = 'widget';
|
||||
protected $target = Target::WIDGET_BACK_DASHBOARD_ASIDE_TOP;
|
||||
protected $priority = 150;
|
||||
protected $template = '@bolt/widgets/news.twig';
|
||||
|
||||
@@ -9,7 +9,6 @@ use Bolt\Snippet\Target;
|
||||
class WeatherWidget extends BaseWidget implements TwigAware
|
||||
{
|
||||
protected $name = 'Weather Widget';
|
||||
protected $type = 'widget';
|
||||
protected $target = Target::WIDGET_BACK_DASHBOARD_ASIDE_TOP;
|
||||
protected $priority = 200;
|
||||
protected $template = '@bolt/widgets/weather.twig';
|
||||
|
||||
@@ -8,8 +8,6 @@ interface WidgetInterface
|
||||
{
|
||||
public function getName(): string;
|
||||
|
||||
public function getType(): string;
|
||||
|
||||
/**
|
||||
* @return string from Bolt\Snippet\Target constants enum
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user