Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
romalytvynenko authored and github-actions[bot] committed Sep 27, 2023
1 parent 3aed7a7 commit a1541cf
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
5 changes: 2 additions & 3 deletions src/Infer/Services/ReferenceTypeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
use Dedoc\Scramble\Support\Type\Union;
use Dedoc\Scramble\Support\Type\UnknownType;
use Illuminate\Support\Str;
use function Pest\Laravel\instance;

class ReferenceTypeResolver
{
Expand Down Expand Up @@ -341,7 +340,7 @@ private function resolveNewCallReferenceType(Scope $scope, NewCallReferenceType
}

$propertyDefaultTemplateTypes = collect($classDefinition->properties)
->filter(fn (ClassPropertyDefinition $definition) => $definition->type instanceof TemplateType && !! $definition->defaultType)
->filter(fn (ClassPropertyDefinition $definition) => $definition->type instanceof TemplateType && (bool) $definition->defaultType)
->mapWithKeys(fn (ClassPropertyDefinition $definition) => [
$definition->type->name => $definition->defaultType,
]);
Expand Down Expand Up @@ -549,7 +548,7 @@ private function resolveTypesTemplatesFromArguments($templates, $templatedArgume

private function resolveClassName(Scope $scope, string $name): ?string
{
if (!in_array($name, StaticReference::KEYWORDS)) {
if (! in_array($name, StaticReference::KEYWORDS)) {
return $name;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ public function extract(RouteInfo $routeInfo)

if ($validationRules) {
$type = $routeInfo->getMethodScopeTypeResolver()->getType($validationRules);
// dump([
// $routeInfo->className().'@'.$routeInfo->methodName() => $type->toString(),
// ]);
// dump([
// $routeInfo->className().'@'.$routeInfo->methodName() => $type->toString(),
// ]);
}

if ($validationRules) {
Expand Down
3 changes: 2 additions & 1 deletion tests/Infer/Services/ConstFetchTypeGetterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

expect($type->toString())->toBe('array{0: string(foo), 1: string(bar)}');
});
class ConstFetchTypeGetterTest_Foo {
class ConstFetchTypeGetterTest_Foo
{
const ARRAY = ['foo', 'bar'];
}
1 change: 0 additions & 1 deletion tests/Infer/Services/ReferenceTypeResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
['newParentCall', 'Dedoc\Scramble\Tests\Infer\Services\StaticCallsClasses\Foo'],
]);


it('complex static call and property fetch', function () {
$type = getStatementType('Dedoc\Scramble\Tests\Infer\Services\StaticCallsClasses\Bar::wow()');

Expand Down

0 comments on commit a1541cf

Please sign in to comment.