Skip to content

Commit

Permalink
👔 up: move some text class to extlib package
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Mar 20, 2024
1 parent b83e1b8 commit dee1567
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 217 deletions.
169 changes: 0 additions & 169 deletions src/Ext/TextScanner.php

This file was deleted.

4 changes: 3 additions & 1 deletion src/Obj/Traits/SingletonPoolTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
trait SingletonPoolTrait
{
/**
* @var array
* @var array<string, object>
*/
private static array $singletons = [];

/**
* Get singleton instance of the class.
*
* @param string $class
*
* @return mixed
Expand Down
17 changes: 14 additions & 3 deletions src/Obj/Traits/SingletonTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,25 @@

/**
* Trait SingletonTrait
*
*/
trait SingletonTrait
{
/**
* @return mixed
* Alias of instance.
*
* @return static
*/
public static function new(): static
{
return Obj::singleton(static::class);
}

/**
* Get singleton instance of the class.
*
* @return static
*/
public static function new(): mixed
public static function instance(): static
{
return Obj::singleton(static::class);
}
Expand Down
44 changes: 0 additions & 44 deletions test/Ext/TextScannerTest.php

This file was deleted.

0 comments on commit dee1567

Please sign in to comment.