Commit c35c1cad authored by webchick's avatar webchick

Issue #1828616 by Berdir, tstoeckler: AnnotatedClassDiscovery is not finding...

Issue #1828616 by Berdir, tstoeckler: AnnotatedClassDiscovery is not finding plugins in Drupal\(Core|Component)\COMPONENT_NAME\Plugin directory.
parent 6de36231
......@@ -408,8 +408,16 @@ protected function buildContainer() {
// Get a list of namespaces and put it onto the container.
$namespaces = $this->getModuleNamespaces($this->getModuleFileNames());
$namespaces['Drupal\Core'] = DRUPAL_ROOT . '/core/lib';
$namespaces['Drupal\Component'] = DRUPAL_ROOT . '/core/lib';
// Add all components in \Drupal\Core and \Drupal\Component that have a
// Plugin directory.
foreach (array('Core', 'Component') as $parent_directory) {
$path = DRUPAL_ROOT . '/core/lib/Drupal/' . $parent_directory;
foreach (new \DirectoryIterator($path) as $component) {
if (!$component->isDot() && is_dir($component->getPathname() . '/Plugin')) {
$namespaces['Drupal\Core\\' . $component->getFilename()] = DRUPAL_ROOT . '/core/lib';
}
}
}
$container->setParameter('container.namespaces', $namespaces);
// Register synthetic services.
......
......@@ -5,7 +5,7 @@
* Contains \Drupal\Core\Validation\Constraint\BundleConstraint.
*/
namespace Drupal\Core\Plugin\Validation\Constraint;
namespace Drupal\Core\Validation\Plugin\Validation\Constraint;
use Symfony\Component\Validator\Constraint;
use Drupal\Component\Annotation\Plugin;
......
......@@ -2,10 +2,10 @@
/**
* @file
* Contains \Drupal\Core\Plugin\Validation\Constraint\BundleConstraintValidator.
* Contains \Drupal\Core\Validation\Plugin\Validation\Constraint\BundleConstraintValidator.
*/
namespace Drupal\Core\Plugin\Validation\Constraint;
namespace Drupal\Core\Validation\Plugin\Validation\Constraint;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;
......
......@@ -5,7 +5,7 @@
* Contains \Drupal\Core\Validation\Constraint\EntityTypeConstraint.
*/
namespace Drupal\Core\Plugin\Validation\Constraint;
namespace Drupal\Core\Validation\Plugin\Validation\Constraint;
use Symfony\Component\Validator\Constraint;
use Drupal\Component\Annotation\Plugin;
......
......@@ -2,10 +2,10 @@
/**
* @file
* Contains \Drupal\Core\Plugin\Validation\Constraint\EntityTypeConstraintValidator.
* Contains \Drupal\Core\Validation\Plugin\Validation\Constraint\EntityTypeConstraintValidator.
*/
namespace Drupal\Core\Plugin\Validation\Constraint;
namespace Drupal\Core\Validation\Plugin\Validation\Constraint;
use Drupal\Core\Entity\EntityInterface;
use Symfony\Component\Validator\Constraint;
......
......@@ -2,10 +2,10 @@
/**
* @file
* Contains \Drupal\Core\Plugin\Validation\Constraint\LengthConstraint.
* Contains \Drupal\Core\Validation\Plugin\Validation\Constraint\LengthConstraint.
*/
namespace Drupal\Core\Plugin\Validation\Constraint;
namespace Drupal\Core\Validation\Plugin\Validation\Constraint;
use Drupal\Component\Annotation\Plugin;
use Drupal\Core\Annotation\Translation;
......
......@@ -2,10 +2,10 @@
/**
* @file
* Contains \Drupal\Core\Plugin\Validation\Constraint\PrimitiveTypeConstraint.
* Contains \Drupal\Core\Validation\Plugin\Validation\Constraint\PrimitiveTypeConstraint.
*/
namespace Drupal\Core\Plugin\Validation\Constraint;
namespace Drupal\Core\Validation\Plugin\Validation\Constraint;
use Drupal\Component\Annotation\Plugin;
use Drupal\Core\Annotation\Translation;
......
......@@ -2,10 +2,10 @@
/**
* @file
* Contains \Drupal\Core\Plugin\Validation\Constraint\PrimitiveTypeConstraintValidator.
* Contains \Drupal\Core\Validation\Plugin\Validation\Constraint\PrimitiveTypeConstraintValidator.
*/
namespace Drupal\Core\Plugin\Validation\Constraint;
namespace Drupal\Core\Validation\Plugin\Validation\Constraint;
use DateInterval;
use Drupal\Core\TypedData\Primitive;
......
......@@ -2,10 +2,10 @@
/**
* @file
* Contains \Drupal\Core\Plugin\Validation\Constraint\RangeConstraint.
* Contains \Drupal\Core\Validation\Plugin\Validation\Constraint\RangeConstraint.
*/
namespace Drupal\Core\Plugin\Validation\Constraint;
namespace Drupal\Core\Validation\Plugin\Validation\Constraint;
use Drupal\Component\Annotation\Plugin;
use Drupal\Core\Annotation\Translation;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment