X-Git-Url: https://git.rapsys.eu/packbundle/blobdiff_plain/b365fc709c3a552386ee3c03d26aa7c5a3c285fe..b69214e3aa8c18b333a58b160aa22fa2c356065f:/Package/PathPackage.php diff --git a/Package/PathPackage.php b/Package/PathPackage.php index 4746fe9..c202b19 100644 --- a/Package/PathPackage.php +++ b/Package/PathPackage.php @@ -21,21 +21,20 @@ use Rapsys\PackBundle\Context\NullContext; * {@inheritdoc} */ class PathPackage extends Package { - //The base path - protected $basePath; - - //The base url - protected $baseUrl; + /** + * The base url + */ + protected string $baseUrl; /** * {@inheritdoc} */ - public function __construct(string $basePath, VersionStrategyInterface $versionStrategy, ContextInterface $context = null) { + public function __construct(protected string $basePath, protected VersionStrategyInterface $versionStrategy, protected ?ContextInterface $context = null) { //Without context use a null context - $context = $context ?? new NullContext(); + $this->context = $this->context ?? new NullContext(); //Call parent constructor - parent::__construct($versionStrategy, $context); + parent::__construct($this->versionStrategy, $this->context); //Without base path if (empty($basePath)) { @@ -54,7 +53,7 @@ class PathPackage extends Package { } //Set base url - $this->baseUrl = $context->getBaseUrl(); + $this->baseUrl = $this->context->getBaseUrl(); } /**