Skip to content

Commit fdd2409

Browse files
committed
fix(Middleware): log deprecation when annotation was actually used
Signed-off-by: Arthur Schiwon <[email protected]>
1 parent de1c175 commit fdd2409

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/private/AppFramework/Middleware/Security/CORSMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,12 @@ public function beforeController($controller, $methodName) {
102102
*/
103103
protected function hasAnnotationOrAttribute(ReflectionMethod $reflectionMethod, string $annotationName, string $attributeClass): bool {
104104
if ($this->reflector->hasAnnotation($annotationName)) {
105+
$this->logger->debug($reflectionMethod->getDeclaringClass()->getName() . '::' . $reflectionMethod->getName() . ' uses the @' . $annotationName . ' annotation and should use the #[' . $attributeClass . '] attribute instead');
105106
return true;
106107
}
107108

108109

109110
if (!empty($reflectionMethod->getAttributes($attributeClass))) {
110-
$this->logger->debug($reflectionMethod->getDeclaringClass()->getName() . '::' . $reflectionMethod->getName() . ' uses the @' . $annotationName . ' annotation and should use the #[' . $attributeClass . '] attribute instead');
111111
return true;
112112
}
113113

0 commit comments

Comments
 (0)