Skip to content

Commit

Permalink
Fix static create methods
Browse files Browse the repository at this point in the history
Fix `phootwork\lang\Text:create()` and `phootwork\file\FileoprationTrait::create()`
to return the correct class, when extend them.
  • Loading branch information
cristianoc72 committed Oct 3, 2021
1 parent 03fb6f9 commit 761fb32
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Text.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ public function __construct(string|Stringable $string = '', ?string $encoding =
* @param string|Stringable $string
* @param string|null $encoding
*
* @return Text
* @return static
*
* @see Text::__construct()
*
* @psalm-suppress UnsafeInstantiation
*/
public static function create(string|Stringable $string, ?string $encoding = null) {
return new self($string, $encoding);
public static function create(string|Stringable $string, ?string $encoding = null): static {
return new static($string, $encoding);
}

/**
Expand Down

0 comments on commit 761fb32

Please sign in to comment.