* {@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)) {
}
//Set base url
- $this->baseUrl = $context->getBaseUrl();
+ $this->baseUrl = $this->context->getBaseUrl();
}
/**