Skip to content

Commit

Permalink
Using attributes for setting alias name
Browse files Browse the repository at this point in the history
  • Loading branch information
m3m0r7 committed Sep 29, 2023
1 parent 0858298 commit 17c7089
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ parameters:
- '#[^:]+::__debugInfo\(\) return type has no value type specified in iterable type array#'
- '#Class [^\s]+ has an uninitialized readonly property \$.+?\. Assign it in the constructor#'
- '#Readonly property [^\s]+ is assigned outside of the constructor#'
- '#Class [^\s]+ is not an Attribute class#'
- '#Attribute class [^\s]+ does not have a constructor and must be instantiated without any parameters#'
1 change: 1 addition & 0 deletions src/VM/Core/Runtime/Attribute/BindAliasAs.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@

namespace RubyVM\VM\Core\Runtime\Attribute;

#[\Attribute]
class BindAliasAs {}
4 changes: 2 additions & 2 deletions src/VM/Core/YARV/Essential/Symbol/RegExpSymbol.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class RegExpSymbol implements SymbolInterface, \Stringable
{
public function __construct(
private readonly StringSymbol $source,
private readonly int $option,
private readonly int|null $option,
) {}

public function valueOf(): StringSymbol
Expand All @@ -21,7 +21,7 @@ public function __toString(): string
return (string) $this->source;
}

public function option(): int
public function option(): int|null
{
return $this->option;
}
Expand Down

0 comments on commit 17c7089

Please sign in to comment.