summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorarshad2017-05-01 15:19:34 +0200
committerMateu Aguiló Bosch2017-05-01 15:19:34 +0200
commit31bef9c89bc5c11077c20b00386f67a527c98cb3 (patch)
treeb505e2990e8087e8e746a4b7b61ce64d7c8bce8a
parent67417178940fea840adfdb51aca3e4dd5142f6ae (diff)
feat(DX): Move field enhancers under a Plugin\jsonapi\FieldEnhancer namespace (#2874324 by arshadcn, e0ipso)
-rw-r--r--src/Plugin/ResourceFieldEnhancerManager.php9
-rw-r--r--src/Plugin/jsonapi/FieldEnhancer/DateTimeEnhancer.php (renamed from src/Plugin/resourceFieldEnhancer/DateTimeEnhancer.php)3
-rw-r--r--src/Plugin/jsonapi/FieldEnhancer/SingleNestedEnhancer.php (renamed from src/Plugin/resourceFieldEnhancer/SingleNestedEnhancer.php)2
3 files changed, 8 insertions, 6 deletions
diff --git a/src/Plugin/ResourceFieldEnhancerManager.php b/src/Plugin/ResourceFieldEnhancerManager.php
index b01ca03..91287c6 100644
--- a/src/Plugin/ResourceFieldEnhancerManager.php
+++ b/src/Plugin/ResourceFieldEnhancerManager.php
@@ -6,14 +6,17 @@ use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Plugin\DefaultPluginManager;
+/**
+ * Manages discovery and instantiation of resourceFieldEnhancer plugins.
+ */
class ResourceFieldEnhancerManager extends DefaultPluginManager {
/**
- * Constructs a new TipPluginManager.
+ * Constructs a new ResourceFieldEnhancerManager.
*
* @param \Traversable $namespaces
* An object that implements \Traversable which contains the root paths
- * keyed by the corresponding namespace to look for plugin implementations,
+ * keyed by the corresponding namespace to look for plugin implementations.
* @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
* Cache backend instance to use.
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
@@ -21,7 +24,7 @@ class ResourceFieldEnhancerManager extends DefaultPluginManager {
*/
public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
parent::__construct(
- 'Plugin/resourceFieldEnhancer',
+ 'Plugin/jsonapi/FieldEnhancer',
$namespaces,
$module_handler,
'Drupal\jsonapi_extras\Plugin\ResourceFieldEnhancerInterface',
diff --git a/src/Plugin/resourceFieldEnhancer/DateTimeEnhancer.php b/src/Plugin/jsonapi/FieldEnhancer/DateTimeEnhancer.php
index e9b171b..4f5aee2 100644
--- a/src/Plugin/resourceFieldEnhancer/DateTimeEnhancer.php
+++ b/src/Plugin/jsonapi/FieldEnhancer/DateTimeEnhancer.php
@@ -1,7 +1,6 @@
<?php
-
-namespace Drupal\jsonapi_extras\Plugin\resourceFieldEnhancer;
+namespace Drupal\jsonapi_extras\Plugin\jsonapi\FieldEnhancer;
use Drupal\Core\Annotation\Translation;
use Drupal\Core\Plugin\PluginBase;
diff --git a/src/Plugin/resourceFieldEnhancer/SingleNestedEnhancer.php b/src/Plugin/jsonapi/FieldEnhancer/SingleNestedEnhancer.php
index 174652f..094f9a5 100644
--- a/src/Plugin/resourceFieldEnhancer/SingleNestedEnhancer.php
+++ b/src/Plugin/jsonapi/FieldEnhancer/SingleNestedEnhancer.php
@@ -1,7 +1,7 @@
<?php
-namespace Drupal\jsonapi_extras\Plugin\resourceFieldEnhancer;
+namespace Drupal\jsonapi_extras\Plugin\jsonapi\FieldEnhancer;
use Drupal\Core\Annotation\Translation;
use Drupal\Core\Plugin\PluginBase;