Skip to content

Commit

Permalink
Customize CXML
Browse files Browse the repository at this point in the history
  • Loading branch information
mathielen committed Jan 30, 2025
1 parent 55ba59a commit 23abfea
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/CXml/Jms/ModelClassMapping.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace CXml\Jms;

use CXml\Model\Exception\CXmlModelNotFoundException;
Expand All @@ -19,7 +21,7 @@ class ModelClassMapping
public static function fromDefaultModelPath(): self
{
return new self(
realpath(__DIR__ . '/../Model'),
__DIR__ . '/../Model',
);
}

Expand Down Expand Up @@ -49,8 +51,10 @@ private function loadModelClasses(): void
$subNamespace = substr($file->getPath(), strlen($this->pathToModelFiles));
$subNamespace = str_replace('/', '\\', $subNamespace);

/** @var class-string $className */
$className = 'CXml\Model' . $subNamespace . '\\' . $file->getBasename('.php');
$class = new ReflectionClass($className);

$class = new \ReflectionClass($className);
if ($class->isAbstract() || $class->isInterface() || $class->isTrait() || $class->isAnonymous()) {
continue;
}
Expand Down

0 comments on commit 23abfea

Please sign in to comment.