Skip to content

Commit

Permalink
Fix coding standard
Browse files Browse the repository at this point in the history
  • Loading branch information
jankonas committed Jul 7, 2024
1 parent 08aa13d commit b7e4b8d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/DI/Helpers/MappingHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public function addXml(string $namespace, string $path, bool $simple = false): s

/** @var ServiceDefinition $xmlDriver */
$xmlDriver = $this->getService(OrmXmlExtension::DRIVER_TAG, 'XmlDriver');

if ($simple) {
$xmlDriver->addSetup(new Statement('$service->getLocator()->addNamespacePrefixes([? => ?])', [$path, $namespace]));
} else {
Expand All @@ -87,6 +88,7 @@ private function getService(string $tag, string $name): Definition
$builder = $this->extension->getContainerBuilder();

$service = $builder->findByTag($tag);

if ($service === []) {
throw new InvalidStateException(sprintf('Service "%s" not found by tag "%s"', $name, $tag));
}
Expand Down
2 changes: 2 additions & 0 deletions src/DI/OrmAnnotationsExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public function loadConfiguration(): void
$config = $this->config;

$reader = $builder->getByType(Reader::class);

if ($reader === null) {
throw new ServiceCreationException(sprintf('Missing "%s" service', Reader::class));
}
Expand All @@ -50,6 +51,7 @@ public function loadConfiguration(): void
->setAutowired(false);

$mappingDriverDef = $this->getMappingDriverDef();

foreach ($config->mapping as $namespace => $path) {
if (!is_dir($path)) {
throw new InvalidStateException(sprintf('Given mapping path "%s" does not exist', $path));
Expand Down
1 change: 1 addition & 0 deletions src/DI/OrmAttributesExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public function loadConfiguration(): void
->setAutowired(false);

$mappingDriverDef = $this->getMappingDriverDef();

foreach ($config->mapping as $namespace => $path) {
if (!is_dir($path)) {
throw new InvalidStateException(sprintf('Given mapping path "%s" does not exist', $path));
Expand Down
2 changes: 2 additions & 0 deletions src/DI/OrmExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public function loadDoctrineConfiguration(): void
// @validate configuration class is subclass of origin one
$configurationClass = $globalConfig->configurationClass;
assert(is_string($configurationClass));

if (!is_a($configurationClass, Configuration::class, true)) {
throw new InvalidArgumentException('Configuration class must be subclass of ' . Configuration::class . ', ' . $configurationClass . ' given.');
}
Expand Down Expand Up @@ -179,6 +180,7 @@ public function loadEntityManagerConfiguration(): void

// @validate entity manager decorator has a real class
$entityManagerDecoratorClass = $config->entityManagerDecoratorClass;

if (!class_exists($entityManagerDecoratorClass)) {
throw new InvalidStateException(sprintf('EntityManagerDecorator class "%s" not found', $entityManagerDecoratorClass));
}
Expand Down
2 changes: 2 additions & 0 deletions src/DI/OrmXmlExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ protected function loadStandardConfiguration(): void
->setAutowired(false);

$mappingDriverDef = $this->getMappingDriverDef();

foreach ($config->mapping as $namespace => $path) {
if (!is_dir($path)) {
throw new InvalidStateException(sprintf('Given mapping path "%s" does not exist', $path));
Expand All @@ -82,6 +83,7 @@ protected function loadSimpleConfiguration(): void
->setAutowired(false);

$mappingDriverDef = $this->getMappingDriverDef();

foreach ($config->mapping as $namespace => $path) {
if (!is_dir($path)) {
throw new InvalidStateException(sprintf('Given mapping path "%s" does not exist', $path));
Expand Down

0 comments on commit b7e4b8d

Please sign in to comment.