Next major version 2 with PHP 8.1, Symfony 6, Tabler UI, 2FA ... (#2902)

This commit is contained in:
Kevin Papst
2022-12-31 21:19:55 +01:00
committed by GitHub
parent 95e06746bd
commit 90a0fd8a22
2164 changed files with 83700 additions and 86426 deletions

View File

@@ -9,70 +9,44 @@
namespace App\Plugin;
class Plugin
final class Plugin
{
/**
* @var string
*/
private $id;
/**
* @var string
*/
private $name;
/**
* @var string
*/
private $path;
/**
* @var PluginMetadata
*/
private $metadata;
private string $id;
private string $path;
private ?PluginMetadata $metadata = null;
public function __construct(PluginInterface $bundle)
{
$this->id = $bundle->getName();
$this->path = $bundle->getPath();
}
public function getMetadata(): ?PluginMetadata
{
return $this->metadata;
}
public function setMetadata(PluginMetadata $metadata): Plugin
public function setMetadata(PluginMetadata $metadata): void
{
$this->metadata = $metadata;
return $this;
}
public function getPath(): ?string
public function getPath(): string
{
return $this->path;
}
public function setPath(string $path): Plugin
public function getName(): string
{
$this->path = $path;
if ($this->metadata !== null && $this->metadata->getName() !== null) {
return $this->metadata->getName();
}
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): Plugin
{
$this->name = $name;
return $this;
}
public function getId(): ?string
{
return $this->id;
}
public function setId(string $id): Plugin
public function getId(): string
{
$this->id = $id;
return $this;
return $this->id;
}
}