Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/alireaza/singleton

Singleton
https://github.com/alireaza/singleton

composer php singleton

Last synced: about 2 months ago
JSON representation

Singleton

Awesome Lists containing this project

README

        

# Singleton

## Install

Via Composer
```bash
$ composer require alireaza/singleton
```

## Usage

```php
use AliReaza\Singleton\Singleton;

class WhoAmI extends Singleton
{
public string $name = 'What\'s my name?';
}

$who = WhoAmI::getInstance();
$who->name = 'AliReaza';

$alireaza = WhoAmI::getInstance();
echo $alireaza->name; // AliReaza
```

## License

The MIT License (MIT). Please see [License File](LICENSE) for more information.