Please check if the PR fulfills these requirements
[x] The commit message follows our guidelines
[x] Tests for the changes have been added (for bug fixes/features)
[x] Docs have been added/updated (for bug fixes/features)
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Feature.
What is the current behavior? (You can also link to an open issue here)
LibraryProperties always has a null base URL, with no way to set the URL. If it makes sense because normally one does not know the URL of a library from the library itself, it is possble that the URL is known at a later time.
For example, when using WP App Container, thanks to $config->locations()->vendorUrl() it is possible to know the vendor URL and so also determine the library full URL.
What is the new behavior (if this is a feature change)?
The PR introduces:
a new $baseUrl parameter, which defaults to null for LibraryProperties::new() in the case the base URL is known when the instanxce is created
a LibraryProperties::withBaseUrl() method wich enables to set the URL after the instance is created. Please note that to keep the idea of"immutable properties", the metod will throw an exception if the URL was already set.
Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
Please check if the PR fulfills these requirements
[x] The commit message follows our guidelines
[x] Tests for the changes have been added (for bug fixes/features)
[x] Docs have been added/updated (for bug fixes/features)
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Feature.
LibraryProperties
always has anull
base URL, with no way to set the URL. If it makes sense because normally one does not know the URL of a library from the library itself, it is possble that the URL is known at a later time.For example, when using WP App Container, thanks to
$config->locations()->vendorUrl()
it is possible to know the vendor URL and so also determine the library full URL.The PR introduces:
a new
$baseUrl
parameter, which defaults tonull
forLibraryProperties::new()
in the case the base URL is known when the instanxce is createda
LibraryProperties::withBaseUrl()
method wich enables to set the URL after the instance is created. Please note that to keep the idea of"immutable properties", the metod will throw an exception if the URL was already set.Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
No.
--