Skip to content
Snippets Groups Projects
Commit 4762102d authored by Ant Brown's avatar Ant Brown Committed by Andrii Podanenko
Browse files

Issue #3067813 by code_brown, jonathan_hunt, ravi.shankar,...

Issue #3067813 by code_brown, jonathan_hunt, ravi.shankar, saurabh.tripathi.cs: Deprecated function assert message on PHP 7.2
parent 0b4cc064
No related branches found
No related tags found
No related merge requests found
...@@ -92,8 +92,8 @@ trait LocalLibraryTrait { ...@@ -92,8 +92,8 @@ trait LocalLibraryTrait {
$this->installed = TRUE; $this->installed = TRUE;
$this->localPath = (string) $path; $this->localPath = (string) $path;
assert('$this->localPath !== ""'); assert($this->localPath !== "");
assert('$this->localPath[0] !== "/"'); assert($this->localPath[0] !== "/");
} }
} }
...@@ -73,7 +73,7 @@ class UriLocator implements LocatorInterface, ContainerFactoryPluginInterface { ...@@ -73,7 +73,7 @@ class UriLocator implements LocatorInterface, ContainerFactoryPluginInterface {
public function locate(LocalLibraryInterface $library) { public function locate(LocalLibraryInterface $library) {
/** @var \Drupal\Core\StreamWrapper\LocalStream $stream_wrapper */ /** @var \Drupal\Core\StreamWrapper\LocalStream $stream_wrapper */
$stream_wrapper = $this->streamWrapperManager->getViaUri($this->uri); $stream_wrapper = $this->streamWrapperManager->getViaUri($this->uri);
assert('$stream_wrapper instanceof \Drupal\Core\StreamWrapper\LocalStream'); assert($stream_wrapper instanceof \Drupal\Core\StreamWrapper\LocalStream);
// Calling LocalStream::getDirectoryPath() explicitly avoids the realpath() // Calling LocalStream::getDirectoryPath() explicitly avoids the realpath()
// usage in LocalStream::getLocalPath(), which breaks if Libraries API is // usage in LocalStream::getLocalPath(), which breaks if Libraries API is
// symbolically linked into the Drupal installation. // symbolically linked into the Drupal installation.
......
...@@ -24,7 +24,7 @@ class AssetLibraryType extends LibraryTypeBase implements AttachableAssetLibrary ...@@ -24,7 +24,7 @@ class AssetLibraryType extends LibraryTypeBase implements AttachableAssetLibrary
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getAttachableAssetLibraries(LibraryInterface $library, LibraryManagerInterface $library_manager) { public function getAttachableAssetLibraries(LibraryInterface $library, LibraryManagerInterface $library_manager) {
assert('$library instanceof \Drupal\libraries\ExternalLibrary\Asset\AssetLibraryInterface'); assert($library instanceof \Drupal\libraries\ExternalLibrary\Asset\AssetLibraryInterface);
/** @var \Drupal\libraries\ExternalLibrary\Asset\AssetLibraryInterface $library */ /** @var \Drupal\libraries\ExternalLibrary\Asset\AssetLibraryInterface $library */
return [$library->getId() => $library->getAttachableAssetLibrary($library_manager)]; return [$library->getId() => $library->getAttachableAssetLibrary($library_manager)];
} }
......
...@@ -25,7 +25,7 @@ class MultipleAssetLibraryType extends LibraryTypeBase implements AttachableAsse ...@@ -25,7 +25,7 @@ class MultipleAssetLibraryType extends LibraryTypeBase implements AttachableAsse
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getAttachableAssetLibraries(LibraryInterface $external_library, LibraryManagerInterface $library_manager) { public function getAttachableAssetLibraries(LibraryInterface $external_library, LibraryManagerInterface $library_manager) {
assert('$external_library instanceof \Drupal\libraries\ExternalLibrary\Asset\MultipleAssetLibraryInterface'); assert($external_library instanceof \Drupal\libraries\ExternalLibrary\Asset\MultipleAssetLibraryInterface);
/** @var \Drupal\libraries\ExternalLibrary\Asset\MultipleAssetLibraryInterface $external_library */ /** @var \Drupal\libraries\ExternalLibrary\Asset\MultipleAssetLibraryInterface $external_library */
$attachable_libraries = []; $attachable_libraries = [];
foreach ($external_library->getAttachableAssetLibraries($library_manager) as $component_name => $attachable_library) { foreach ($external_library->getAttachableAssetLibraries($library_manager) as $component_name => $attachable_library) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment