Skip to content
Snippets Groups Projects
Commit 833a0267 authored by Tobias Zimmermann's avatar Tobias Zimmermann
Browse files

by tstoeckler: Remove verbosity of class names

parent 8b4d973c
No related branches found
No related tags found
No related merge requests found
Showing
with 49 additions and 56 deletions
......@@ -13,7 +13,7 @@ use Drupal\libraries\ExternalLibrary\Asset\AssetLibraryInterface;
* Implements hook_library_info_build().
*/
function libraries_library_info_build() {
/** @var \Drupal\libraries\ExternalLibrary\ExternalLibraryManagerInterface $library_manager */
/** @var \Drupal\libraries\ExternalLibrary\LibraryManagerInterface $library_manager */
$library_manager = \Drupal::service('libraries.manager');
$core_libraries = [];
......
......@@ -11,7 +11,6 @@ use Drupal\Core\Extension\Extension as CoreExtension;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Extension\ThemeHandlerInterface;
/**
* @todo
*/
......@@ -89,6 +88,4 @@ class ExtensionHandler implements ExtensionHandlerInterface {
);
}
}
......@@ -7,7 +7,7 @@
namespace Drupal\libraries\ExternalLibrary\Asset;
use Drupal\libraries\ExternalLibrary\ExternalLibraryTrait;
use Drupal\libraries\ExternalLibrary\LibraryTrait;
use Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface;
use Drupal\libraries\ExternalLibrary\Local\LocalLibraryTrait;
use Drupal\libraries\ExternalLibrary\Remote\RemoteLibraryInterface;
......@@ -19,7 +19,7 @@ use Drupal\libraries\ExternalLibrary\Remote\RemoteLibraryTrait;
class AssetLibrary implements AssetLibraryInterface, LocalLibraryInterface, RemoteLibraryInterface {
use
ExternalLibraryTrait,
LibraryTrait,
LocalLibraryTrait,
RemoteLibraryTrait,
SingleAssetLibraryTrait,
......
......@@ -7,7 +7,7 @@
namespace Drupal\libraries\ExternalLibrary\Asset;
use Drupal\libraries\ExternalLibrary\ExternalLibraryInterface;
use Drupal\libraries\ExternalLibrary\LibraryInterface;
/**
* Provides an interface for library with assets.
......@@ -16,7 +16,7 @@ use Drupal\libraries\ExternalLibrary\ExternalLibraryInterface;
*
* @todo Explain
*/
interface AssetLibraryInterface extends ExternalLibraryInterface {
interface AssetLibraryInterface extends LibraryInterface {
/**
* Returns a core asset library array structure for this library.
......
......@@ -47,7 +47,7 @@ trait SingleAssetLibraryTrait {
/**
* Processes a list of dependencies into a list of attachable library IDs.
*
* @param \Drupal\libraries\ExternalLibrary\ExternalLibraryInterface[] $dependencies
* @param \Drupal\libraries\ExternalLibrary\LibraryInterface[] $dependencies
* An list of external libraries.
*
* @return string[]
......@@ -60,7 +60,7 @@ trait SingleAssetLibraryTrait {
foreach ($dependencies as $dependency) {
if (!$dependency instanceof AssetLibraryInterface) {
// @todo Somehow integrate this with canBeAttached().
/** @var \Drupal\libraries\ExternalLibrary\ExternalLibraryInterface $this */
/** @var \Drupal\libraries\ExternalLibrary\LibraryInterface $this */
throw new InvalidLibraryDependencyException($this, $dependency);
}
......
......@@ -7,7 +7,7 @@
namespace Drupal\libraries\ExternalLibrary\Exception;
use Drupal\libraries\ExternalLibrary\Utility\DependencyAccessorTrait;
use Drupal\libraries\ExternalLibrary\ExternalLibraryInterface;
use Drupal\libraries\ExternalLibrary\LibraryInterface;
use Drupal\libraries\ExternalLibrary\Utility\LibraryAccessorTrait;
/**
......@@ -21,9 +21,9 @@ class InvalidLibraryDependencyException extends \UnexpectedValueException {
/**
* Constructs a library exception.
*
* @param \Drupal\libraries\ExternalLibrary\ExternalLibraryInterface $library
* @param \Drupal\libraries\ExternalLibrary\LibraryInterface $library
* The library with the invalid dependency.
* @param \Drupal\libraries\ExternalLibrary\ExternalLibraryInterface $dependency
* @param \Drupal\libraries\ExternalLibrary\LibraryInterface $dependency
* The dependency.
* @param string $message
* (optional) The exception message.
......@@ -33,8 +33,8 @@ class InvalidLibraryDependencyException extends \UnexpectedValueException {
* (optional) The previous exception.
*/
public function __construct(
ExternalLibraryInterface $library,
ExternalLibraryInterface $dependency,
LibraryInterface $library,
LibraryInterface $dependency,
$message = '',
$code = 0,
\Exception $previous = NULL
......
......@@ -2,7 +2,7 @@
/**
* @file
* Contains \Drupal\libraries\ExternalLibrary\ExternalLibraryInterface.
* Contains \Drupal\libraries\ExternalLibrary\LibraryInterface.
*/
namespace Drupal\libraries\ExternalLibrary;
......@@ -11,7 +11,7 @@ namespace Drupal\libraries\ExternalLibrary;
/**
* Provides an interface for different types of external libraries.
*/
interface ExternalLibraryInterface {
interface LibraryInterface {
/**
* Returns the ID of the library.
......
......@@ -2,26 +2,24 @@
/**
* @file
* Contains \Drupal\libraries\ExternalLibrary\ExternalLibraryManager.
* Contains \Drupal\libraries\ExternalLibrary\LibraryManager.
*/
namespace Drupal\libraries\ExternalLibrary;
use Drupal\Component\Plugin\Factory\FactoryInterface;
use Drupal\libraries\Extension\ExtensionHandlerInterface;
use Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface;
use Drupal\libraries\ExternalLibrary\PhpFile\PhpFileLibraryInterface;
use Drupal\libraries\ExternalLibrary\PhpFile\PhpFileLoaderInterface;
use Drupal\libraries\ExternalLibrary\Registry\ExternalLibraryRegistryInterface;
use Drupal\libraries\ExternalLibrary\Registry\LibraryRegistryInterface;
/**
* Provides a manager for external libraries.
*/
class ExternalLibraryManager implements ExternalLibraryManagerInterface {
class LibraryManager implements LibraryManagerInterface {
/**
* The library registry.
*
* @var \Drupal\libraries\ExternalLibrary\Registry\ExternalLibraryRegistryInterface
* @var \Drupal\libraries\ExternalLibrary\Registry\LibraryRegistryInterface
*/
protected $registry;
......@@ -42,7 +40,7 @@ class ExternalLibraryManager implements ExternalLibraryManagerInterface {
/**
* Constructs an external library manager.
*
* @param \Drupal\libraries\ExternalLibrary\Registry\ExternalLibraryRegistryInterface $registry
* @param \Drupal\libraries\ExternalLibrary\Registry\LibraryRegistryInterface $registry
* The library registry.
* @param \Drupal\libraries\Extension\ExtensionHandlerInterface $extension_handler
* The extension handler.
......@@ -50,7 +48,7 @@ class ExternalLibraryManager implements ExternalLibraryManagerInterface {
* The PHP file loader.
*/
public function __construct(
ExternalLibraryRegistryInterface $registry,
LibraryRegistryInterface $registry,
ExtensionHandlerInterface $extension_handler,
PhpFileLoaderInterface $php_file_loader
) {
......
......@@ -2,7 +2,7 @@
/**
* @file
* Contains \Drupal\libraries\ExternalLibrary\ExternalLibraryManagerInterface.
* Contains \Drupal\libraries\ExternalLibrary\LibraryManagerInterface.
*/
namespace Drupal\libraries\ExternalLibrary;
......@@ -11,7 +11,7 @@ namespace Drupal\libraries\ExternalLibrary;
/**
* Provides an interface for external library managers.
*/
interface ExternalLibraryManagerInterface {
interface LibraryManagerInterface {
/**
* Gets the list of libraries that are required by enabled extensions.
......@@ -19,7 +19,7 @@ interface ExternalLibraryManagerInterface {
* Modules, themes, and installation profiles can declare library dependencies
* in their info files.
*
* @return \Drupal\libraries\ExternalLibrary\ExternalLibraryInterface[]|\Generator
* @return \Drupal\libraries\ExternalLibrary\LibraryInterface[]|\Generator
* An array of libraries keyed by their ID.
*
* @todo Expand the documentation.
......
......@@ -2,7 +2,7 @@
/**
* @file
* Contains \Drupal\libraries\ExternalLibrary\ExternalLibraryTrait.
* Contains \Drupal\libraries\ExternalLibrary\LibraryTrait.
*/
namespace Drupal\libraries\ExternalLibrary;
......@@ -10,7 +10,7 @@ namespace Drupal\libraries\ExternalLibrary;
/**
* Provides a base external library implementation.
*/
trait ExternalLibraryTrait {
trait LibraryTrait {
/**
* The library ID.
......@@ -25,7 +25,7 @@ trait ExternalLibraryTrait {
* @return string
* The library ID. This must be unique among all known libraries.
*
* @see \Drupal\libraries\ExternalLibrary\ExternalLibraryInterface::getId()
* @see \Drupal\libraries\ExternalLibrary\LibraryInterface::getId()
*/
public function getId() {
return $this->id;
......@@ -37,7 +37,7 @@ trait ExternalLibraryTrait {
* @return string
* The version string, for example 1.0, 2.1.4, or 3.0.0-alpha5.
*
* @see \Drupal\libraries\ExternalLibrary\ExternalLibraryInterface::getVersion()
* @see \Drupal\libraries\ExternalLibrary\LibraryInterface::getVersion()
*/
public function getVersion() {
// @todo Turn into something useful and split into some other trait.
......@@ -50,7 +50,7 @@ trait ExternalLibraryTrait {
* @return array
* An array of library IDs of libraries that the library depends on.
*
* @see \Drupal\libraries\ExternalLibrary\ExternalLibraryInterface::getDependencies()
* @see \Drupal\libraries\ExternalLibrary\LibraryInterface::getDependencies()
*/
public function getDependencies() {
// @todo Turn into something useful and split into some other trait.
......
......@@ -8,7 +8,7 @@
namespace Drupal\libraries\ExternalLibrary\Local;
use Drupal\Component\Plugin\Factory\FactoryInterface;
use Drupal\libraries\ExternalLibrary\ExternalLibraryInterface;
use Drupal\libraries\ExternalLibrary\LibraryInterface;
/**
* Provides an interface for local libraries.
......@@ -23,7 +23,7 @@ use Drupal\libraries\ExternalLibrary\ExternalLibraryInterface;
*
* @see \Drupal\libraries\ExternalLibrary\Local\LocatorInterface
*/
interface LocalLibraryInterface extends ExternalLibraryInterface {
interface LocalLibraryInterface extends LibraryInterface {
/**
* Checks whether the library is installed.
......
......@@ -7,8 +7,6 @@
namespace Drupal\libraries\ExternalLibrary\Local;
use Drupal\libraries\ExternalLibrary\ExternalLibraryInterface;
/**
* Provides an interface for library locators.
*
......
......@@ -9,7 +9,7 @@ namespace Drupal\libraries\ExternalLibrary\PhpFile;
use Drupal\Component\Plugin\Factory\FactoryInterface;
use Drupal\libraries\ExternalLibrary\Exception\LibraryNotInstalledException;
use Drupal\libraries\ExternalLibrary\ExternalLibraryTrait;
use Drupal\libraries\ExternalLibrary\LibraryTrait;
use Drupal\libraries\ExternalLibrary\Local\LocalLibraryTrait;
/**
......@@ -17,7 +17,7 @@ use Drupal\libraries\ExternalLibrary\Local\LocalLibraryTrait;
*/
class PhpFileLibrary implements PhpFileLibraryInterface {
use ExternalLibraryTrait;
use LibraryTrait;
use LocalLibraryTrait;
/**
......
......@@ -2,7 +2,7 @@
/**
* @file
* Contains \Drupal\libraries\ExternalLibrary\Registry\ExternalLibraryRegistry.
* Contains \Drupal\libraries\ExternalLibrary\Registry\LibraryRegistry.
*/
namespace Drupal\libraries\ExternalLibrary\Registry;
......@@ -19,7 +19,7 @@ use Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface;
* @todo Allow for JavaScript CDN's, Packagist, etc. to act as library
* registries.
*/
class ExternalLibraryRegistry implements ExternalLibraryRegistryInterface {
class LibraryRegistry implements LibraryRegistryInterface {
/**
* The serializer for the library definition files.
......@@ -118,7 +118,7 @@ class ExternalLibraryRegistry implements ExternalLibraryRegistryInterface {
* @param array $definition
* The library definition array parsed from the definition JSON file.
*
* @return string|\Drupal\libraries\ExternalLibrary\ExternalLibraryInterface
* @return string|\Drupal\libraries\ExternalLibrary\LibraryInterface
* The library class.
*
* @throws \Drupal\libraries\ExternalLibrary\Exception\LibraryClassNotFoundException
......
......@@ -2,7 +2,7 @@
/**
* @file
* Contains \Drupal\libraries\ExternalLibrary\Registry\ExternalLibraryRegistryInterface.
* Contains \Drupal\libraries\ExternalLibrary\Registry\LibraryRegistryInterface.
*/
namespace Drupal\libraries\ExternalLibrary\Registry;
......@@ -11,7 +11,7 @@ namespace Drupal\libraries\ExternalLibrary\Registry;
/**
* Provides an interface for library registries.
*/
interface ExternalLibraryRegistryInterface {
interface LibraryRegistryInterface {
/**
* Gets a library by its ID.
......@@ -19,7 +19,7 @@ interface ExternalLibraryRegistryInterface {
* @param string $id
* The library ID.
*
* @return \Drupal\libraries\ExternalLibrary\ExternalLibraryInterface
* @return \Drupal\libraries\ExternalLibrary\LibraryInterface
* The library.
*
* @throws \Drupal\libraries\ExternalLibrary\Exception\LibraryClassNotFoundException
......
......@@ -7,7 +7,7 @@
namespace Drupal\libraries\ExternalLibrary\Remote;
use Drupal\libraries\ExternalLibrary\ExternalLibraryInterface;
use Drupal\libraries\ExternalLibrary\LibraryInterface;
/**
* Provides an interface for remote libraries.
......@@ -16,7 +16,7 @@ use Drupal\libraries\ExternalLibrary\ExternalLibraryInterface;
* not checked whether or not the Drupal site has network access or the remote
* resource is available.
*/
interface RemoteLibraryInterface extends ExternalLibraryInterface {
interface RemoteLibraryInterface extends LibraryInterface {
/**
* Checks whether the library has a remote URL.
......
......@@ -15,14 +15,14 @@ trait DependencyAccessorTrait {
/**
* The dependency.
*
* @var \Drupal\libraries\ExternalLibrary\ExternalLibraryInterface
* @var \Drupal\libraries\ExternalLibrary\LibraryInterface
*/
protected $dependency;
/**
* Returns the dependency.
*
* @return \Drupal\libraries\ExternalLibrary\ExternalLibraryInterface
* @return \Drupal\libraries\ExternalLibrary\LibraryInterface
* The library.
*/
public function getLibrary() {
......
......@@ -15,14 +15,14 @@ trait LibraryAccessorTrait {
/**
* The library.
*
* @var \Drupal\libraries\ExternalLibrary\ExternalLibraryInterface
* @var \Drupal\libraries\ExternalLibrary\LibraryInterface
*/
protected $library;
/**
* Returns the library.
*
* @return \Drupal\libraries\ExternalLibrary\ExternalLibraryInterface
* @return \Drupal\libraries\ExternalLibrary\LibraryInterface
* The library.
*/
public function getLibrary() {
......
......@@ -11,14 +11,14 @@ use Drupal\libraries\ExternalLibrary\Asset\AssetLibrary;
use Drupal\libraries\ExternalLibrary\Exception\LibraryClassNotFoundException;
use Drupal\libraries\ExternalLibrary\Exception\LibraryDefinitionNotFoundException;
use Drupal\Tests\libraries\Kernel\ExternalLibrary\TestLibraryFilesStream;
use Drupal\Tests\libraries\Kernel\ExternalLibraryKernelTestBase;
use Drupal\Tests\libraries\Kernel\LibraryKernelTestBase;
/**
* Tests that external asset libraries are registered as core asset libraries.
*
* @group libraries
*/
class AssetLibraryTest extends ExternalLibraryKernelTestBase {
class AssetLibraryTest extends LibraryKernelTestBase {
/**
* {@inheritdoc}
......
......@@ -11,14 +11,14 @@ use Drupal\libraries\ExternalLibrary\Exception\LibraryClassNotFoundException;
use Drupal\libraries\ExternalLibrary\Exception\LibraryDefinitionNotFoundException;
use Drupal\libraries\ExternalLibrary\PhpFile\PhpFileLibrary;
use Drupal\Tests\libraries\Kernel\ExternalLibrary\TestLibraryFilesStream;
use Drupal\Tests\libraries\Kernel\ExternalLibraryKernelTestBase;
use Drupal\Tests\libraries\Kernel\LibraryKernelTestBase;
/**
* Tests that the external library manager properly loads PHP file libraries.
*
* @group libraries
*/
class PhpFileLibraryTest extends ExternalLibraryKernelTestBase {
class PhpFileLibraryTest extends LibraryKernelTestBase {
/**
* {@inheritdoc}
......@@ -28,7 +28,7 @@ class PhpFileLibraryTest extends ExternalLibraryKernelTestBase {
/**
* The external library manager.
*
* @var \Drupal\libraries\ExternalLibrary\ExternalLibraryManagerInterface
* @var \Drupal\libraries\ExternalLibrary\LibraryManagerInterface
*/
protected $externalLibraryManager;
......
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