Remove $type, and remove the initial '' for $template

This commit is contained in:
Bob den Otter
2019-04-21 16:54:20 +02:00
parent 9bdd3bc94b
commit bc0b59db0f
6 changed files with 2 additions and 21 deletions
+2 -15
View File
@@ -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;
}
-1
View File
@@ -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;
-1
View File
@@ -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;
-1
View File
@@ -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';
-1
View File
@@ -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';
-2
View File
@@ -8,8 +8,6 @@ interface WidgetInterface
{
public function getName(): string;
public function getType(): string;
/**
* @return string from Bolt\Snippet\Target constants enum
*/