@@ -43,7 +43,7 @@ |
||
| 43 | 43 | { |
| 44 | 44 | $attributes = $classMembers; |
| 45 | 45 | foreach ($this->filters as $filter) { |
| 46 | - $attributes = array_filter($attributes, static function (Stmt $member) use ($filter): bool { |
|
| 46 | + $attributes = array_filter($attributes, static function(Stmt $member) use ($filter): bool { |
|
| 47 | 47 | return $filter->accept($member); |
| 48 | 48 | }); |
| 49 | 49 | } |
@@ -44,13 +44,13 @@ |
||
| 44 | 44 | */ |
| 45 | 45 | public function build(array $classAttributes): array |
| 46 | 46 | { |
| 47 | - $constants = array_filter($classAttributes, static function ($attribute): bool { |
|
| 47 | + $constants = array_filter($classAttributes, static function($attribute): bool { |
|
| 48 | 48 | return $attribute instanceof ClassConst; |
| 49 | 49 | }); |
| 50 | 50 | |
| 51 | - return array_map(function (ClassConst $constant): Constant { |
|
| 51 | + return array_map(function(ClassConst $constant): Constant { |
|
| 52 | 52 | return new Constant( |
| 53 | - (string) $constant->consts[0]->name, |
|
| 53 | + (string)$constant->consts[0]->name, |
|
| 54 | 54 | TypeDeclaration::from($this->determineType($constant->consts[0])), |
| 55 | 55 | $this->visibilityBuilder->build($constant) |
| 56 | 56 | ); |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | public function build(Trait_ $trait): TraitDefinition |
| 34 | 34 | { |
| 35 | 35 | return new TraitDefinition( |
| 36 | - Name::from((string) $trait->name), |
|
| 36 | + Name::from((string)$trait->name), |
|
| 37 | 37 | $this->membersBuilder->methods($trait->getMethods()), |
| 38 | 38 | $this->membersBuilder->attributes($trait->stmts), |
| 39 | 39 | $this->buildTraits($trait->stmts) |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | public function build(Interface_ $interface): InterfaceDefinition |
| 34 | 34 | { |
| 35 | 35 | return new InterfaceDefinition( |
| 36 | - InterfaceDefinitionName::from((string) $interface->name), |
|
| 36 | + InterfaceDefinitionName::from((string)$interface->name), |
|
| 37 | 37 | $this->membersBuilder->methods($interface->getMethods()), |
| 38 | 38 | $this->membersBuilder->constants($interface->stmts), |
| 39 | 39 | $this->buildInterfaces($interface->extends) |
@@ -36,10 +36,10 @@ |
||
| 36 | 36 | public function build(Class_ $class): ClassDefinition |
| 37 | 37 | { |
| 38 | 38 | return new ClassDefinition( |
| 39 | - ClassDefinitionName::from((string) $class->name), |
|
| 39 | + ClassDefinitionName::from((string)$class->name), |
|
| 40 | 40 | $this->membersBuilder->methods($class->getMethods()), |
| 41 | 41 | $this->membersBuilder->constants($class->stmts), |
| 42 | - $class->extends !== null ? ClassDefinitionName::from((string) end($class->extends->parts)) : null, |
|
| 42 | + $class->extends !== null ? ClassDefinitionName::from((string)end($class->extends->parts)) : null, |
|
| 43 | 43 | $this->membersBuilder->attributes($class->stmts), |
| 44 | 44 | $this->buildInterfaces($class->implements), |
| 45 | 45 | $this->buildTraits($class->stmts) |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | |
| 33 | 33 | public function leaveNode(Node $node) |
| 34 | 34 | { |
| 35 | - if ($node instanceof Class_ && ! $node->isAnonymous()) { |
|
| 35 | + if ($node instanceof Class_ && !$node->isAnonymous()) { |
|
| 36 | 36 | $this->codebase->add($this->builder->build($node)); |
| 37 | 37 | } |
| 38 | 38 | return null; |
@@ -32,8 +32,8 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | private function resolveExternalAttributes(ClassDefinition $definition, Codebase $codebase): void |
| 34 | 34 | { |
| 35 | - array_map(function (Attribute $attribute) use ($codebase): void { |
|
| 36 | - if ($attribute->isAReference() && ! $codebase->has($attribute->referenceName())) { |
|
| 35 | + array_map(function(Attribute $attribute) use ($codebase): void { |
|
| 36 | + if ($attribute->isAReference() && !$codebase->has($attribute->referenceName())) { |
|
| 37 | 37 | $codebase->add($this->externalClass($attribute->referenceName())); |
| 38 | 38 | } |
| 39 | 39 | }, $definition->attributes()); |
@@ -41,8 +41,8 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | private function resolveExternalConstructorParameters(ClassDefinition $definition, Codebase $codebase): void |
| 43 | 43 | { |
| 44 | - array_map(function (Parameter $parameter) use ($codebase): void { |
|
| 45 | - if ($parameter->isAReference() && ! $codebase->has($parameter->referenceName())) { |
|
| 44 | + array_map(function(Parameter $parameter) use ($codebase): void { |
|
| 45 | + if ($parameter->isAReference() && !$codebase->has($parameter->referenceName())) { |
|
| 46 | 46 | $codebase->add($this->externalClass($parameter->referenceName())); |
| 47 | 47 | } |
| 48 | 48 | }, $definition->constructorParameters()); |
@@ -64,8 +64,8 @@ discard block |
||
| 64 | 64 | /** @param \PhUml\Code\Name[] $interfaces */ |
| 65 | 65 | private function resolveExternalInterfaces(array $interfaces, Codebase $codebase): void |
| 66 | 66 | { |
| 67 | - array_map(function (Name $interface) use ($codebase): void { |
|
| 68 | - if (! $codebase->has($interface)) { |
|
| 67 | + array_map(function(Name $interface) use ($codebase): void { |
|
| 68 | + if (!$codebase->has($interface)) { |
|
| 69 | 69 | $codebase->add($this->externalInterface($interface)); |
| 70 | 70 | } |
| 71 | 71 | }, $interfaces); |
@@ -74,8 +74,8 @@ discard block |
||
| 74 | 74 | /** @param \PhUml\Code\Name[] $traits */ |
| 75 | 75 | private function resolveExternalTraits(array $traits, Codebase $codebase): void |
| 76 | 76 | { |
| 77 | - array_map(function (Name $trait) use ($codebase): void { |
|
| 78 | - if (! $codebase->has($trait)) { |
|
| 77 | + array_map(function(Name $trait) use ($codebase): void { |
|
| 78 | + if (!$codebase->has($trait)) { |
|
| 79 | 79 | $codebase->add($this->externalTrait($trait)); |
| 80 | 80 | } |
| 81 | 81 | }, $traits); |
@@ -83,11 +83,11 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | private function resolveExternalParentClass(ClassDefinition $definition, Codebase $codebase): void |
| 85 | 85 | { |
| 86 | - if (! $definition->hasParent()) { |
|
| 86 | + if (!$definition->hasParent()) { |
|
| 87 | 87 | return; |
| 88 | 88 | } |
| 89 | 89 | $parent = $definition->parent(); |
| 90 | - if (! $codebase->has($parent)) { |
|
| 90 | + if (!$codebase->has($parent)) { |
|
| 91 | 91 | $codebase->add($this->externalClass($parent)); |
| 92 | 92 | } |
| 93 | 93 | } |