Skip to content

Commit

Permalink
Make generic controllers use commonGLPI instead of DBTM
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierstoval committed Oct 15, 2024
1 parent dba6fa3 commit 4f720f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/Glpi/Controller/GenericFormController.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function __invoke(Request $request): Response
}

/**
* @return class-string<\CommonDBTM>|null
* @return class-string<\CommonGLPI>|null
*/
private function getClassFromType(string $type): ?string
{
Expand All @@ -70,7 +70,7 @@ private function getClassFromType(string $type): ?string
if (
$class
&& \class_exists($class)
&& \is_subclass_of($class, \CommonDBTM::class)
&& \is_subclass_of($class, \CommonGLPI::class)
) {
return $this->normalizeClass($class);
}
Expand All @@ -80,7 +80,7 @@ private function getClassFromType(string $type): ?string
if (
$namespacedClass
&& \class_exists($namespacedClass)
&& \is_subclass_of($namespacedClass, \CommonDBTM::class)
&& \is_subclass_of($namespacedClass, \CommonGLPI::class)
) {
return $this->normalizeClass($namespacedClass);
}
Expand Down
6 changes: 3 additions & 3 deletions src/Glpi/Controller/GenericListController.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function __invoke(Request $request): Response
}

/**
* @return class-string<\CommonDBTM>|null
* @return class-string<\CommonGLPI>|null
*/
private function getClassFromType(string $type): ?string
{
Expand All @@ -72,7 +72,7 @@ private function getClassFromType(string $type): ?string
if (
$class
&& \class_exists($class)
&& \is_subclass_of($class, \CommonDBTM::class)
&& \is_subclass_of($class, \CommonGLPI::class)
) {
return $this->normalizeClass($class);
}
Expand All @@ -82,7 +82,7 @@ private function getClassFromType(string $type): ?string
if (
$namespacedClass
&& \class_exists($namespacedClass)
&& \is_subclass_of($namespacedClass, \CommonDBTM::class)
&& \is_subclass_of($namespacedClass, \CommonGLPI::class)
) {
return $this->normalizeClass($namespacedClass);
}
Expand Down

0 comments on commit 4f720f0

Please sign in to comment.