Fix method documentation

1.x 1.5.0
Julien Rosset 2 years ago
parent c72346dfab
commit 2901667111

@ -2,6 +2,16 @@
"name": "jrosset/singleton",
"description": "PHP Trait to implements the singleton design pattern",
"keywords": [ ],
"type": "library",
"config": {
"sort-packages": true
},
"extra": {
"branch-alias": {
"dev-master": "1.x-dev"
}
},
"minimum-stability": "stable",
"require": {

@ -35,8 +35,8 @@ trait TRegistry {
/**
* Register a new entry
*
* @param string $name The entry name
* @param array $args The instance constructor arguments
* @param string $name The entry name
* @param mixed ...$args The instance constructor arguments
*
* @return void
*

@ -4,12 +4,12 @@
/** @noinspection PhpIllegalPsrClassPathInspection */
use jrosset\Singleton\IRegistry;
use jrosset\Singleton\TRegistryExternal;
use jrosset\Singleton\TRegistry;
require_once __DIR__ . '/../vendor/autoload.php';
class RegistryTest implements IRegistry {
use TRegistryExternal;
use TRegistry;
private int $cpt;
@ -23,10 +23,15 @@ class RegistryTest implements IRegistry {
public function increment (): void {
$this->cpt++;
}
}
RegistryTest::addEntry('cpt_1', 0);
RegistryTest::addEntry('cpt_2', 5);
/**
* @inheritDoc
*/
protected static function initializeEntries (): void {
self::addEntry('cpt_1', 0);
self::addEntry('cpt_2', 5);
}
}
var_dump(RegistryTest::getInstance('cpt_1')->getCpt());
var_dump(RegistryTest::getInstance('cpt_2')->getCpt());

Loading…
Cancel
Save