Skip to content

Commit 8ac28eb

Browse files
committed
consistent variable naming
1 parent dc3b65c commit 8ac28eb

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

php-templates/models.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,25 +53,23 @@ function getBuilderMethod($method, $factory)
5353
];
5454
}
5555

56-
function getCastReturnType($classname)
56+
function getCastReturnType($className)
5757
{
58-
if ($classname === null) {
58+
if ($className === null) {
5959
return null;
6060
}
6161

62-
$returnType = $classname;
63-
6462
try {
65-
$class = new \ReflectionClass($classname);
63+
$class = new \ReflectionClass($className);
6664
$method = $class->getMethod('get');
6765

6866
if ($method->hasReturnType()) {
69-
$returnType = $method->getReturnType()->getName();
67+
return $method->getReturnType()->getName();
7068
}
7169

72-
return $returnType;
70+
return $className;
7371
} catch (\Exception | \Throwable $e) {
74-
return $returnType;
72+
return $className;
7573
}
7674
}
7775

src/templates/models.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,25 +53,25 @@ function getBuilderMethod($method, $factory)
5353
];
5454
}
5555
56-
function getCastReturnType($classname)
56+
function getCastReturnType($className)
5757
{
58-
if ($classname === null) {
58+
return $className;
59+
60+
if ($className === null) {
5961
return null;
6062
}
6163
62-
$returnType = $classname;
63-
6464
try {
65-
$class = new \\ReflectionClass($classname);
65+
$class = new \\ReflectionClass($className);
6666
$method = $class->getMethod('get');
6767
6868
if ($method->hasReturnType()) {
69-
$returnType = $method->getReturnType()->getName();
69+
return $method->getReturnType()->getName();
7070
}
7171
72-
return $returnType;
72+
return $className;
7373
} catch (\\Exception | \\Throwable $e) {
74-
return $returnType;
74+
return $className;
7575
}
7676
}
7777

0 commit comments

Comments
 (0)