mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-06-05 22:09:38 +02:00
Aggiornamento della documentazione integrata
Miglioramento della documentazione integrata delle classi principali.
This commit is contained in:
@ -3,13 +3,18 @@
|
||||
namespace Util;
|
||||
|
||||
/**
|
||||
* Classe astratta per la generazione di oggetti istanziabili una singola volta.
|
||||
*
|
||||
* @since 2.3
|
||||
*/
|
||||
abstract class Singleton
|
||||
{
|
||||
/** @var \Util\Singleton Oggetti istanziati */
|
||||
/** @var Util\Singleton Oggetti istanziati */
|
||||
protected static $instance = [];
|
||||
|
||||
/**
|
||||
* Protected constructor to prevent creating a new instance of the <b>Singleton</b> via the `new` operator from outside of this class.
|
||||
*/
|
||||
protected function __construct()
|
||||
{
|
||||
}
|
||||
@ -21,7 +26,7 @@ abstract class Singleton
|
||||
*/
|
||||
public static function getInstance()
|
||||
{
|
||||
$class = get_called_class(); // late-static-bound class name
|
||||
$class = get_called_class();
|
||||
|
||||
if (!isset(self::$instance[$class])) {
|
||||
self::$instance[$class] = new static();
|
||||
@ -30,10 +35,16 @@ abstract class Singleton
|
||||
return self::$instance[$class];
|
||||
}
|
||||
|
||||
/**
|
||||
* Private clone method to prevent cloning of the instance of the <b>Singleton</b> instance.
|
||||
*/
|
||||
private function __clone()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Private unserialize method to prevent unserializing of the <b>Singleton</b> instance.
|
||||
*/
|
||||
private function __wakeup()
|
||||
{
|
||||
}
|
||||
|
Reference in New Issue
Block a user