Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit dee1567

Browse files
committed
👔 up: move some text class to extlib package
1 parent b83e1b8 commit dee1567

File tree

4 files changed

+17
-217
lines changed

4 files changed

+17
-217
lines changed

‎src/Ext/TextScanner.php

Lines changed: 0 additions & 169 deletions
This file was deleted.

‎src/Obj/Traits/SingletonPoolTrait.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@
1616
trait SingletonPoolTrait
1717
{
1818
/**
19-
* @var array
19+
* @var array<string, object>
2020
*/
2121
private static array $singletons = [];
2222

2323
/**
24+
* Get singleton instance of the class.
25+
*
2426
* @param string $class
2527
*
2628
* @return mixed

‎src/Obj/Traits/SingletonTrait.php

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,25 @@
1313

1414
/**
1515
* Trait SingletonTrait
16-
*
1716
*/
1817
trait SingletonTrait
1918
{
2019
/**
21-
* @return mixed
20+
* Alias of instance.
21+
*
22+
* @return static
23+
*/
24+
public static function new(): static
25+
{
26+
return Obj::singleton(static::class);
27+
}
28+
29+
/**
30+
* Get singleton instance of the class.
31+
*
32+
* @return static
2233
*/
23-
public static function new(): mixed
34+
public static function instance(): static
2435
{
2536
return Obj::singleton(static::class);
2637
}

‎test/Ext/TextScannerTest.php

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /