Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alireaza/singleton
Singleton
https://github.com/alireaza/singleton
composer php singleton
Last synced: about 2 months ago
JSON representation
Singleton
- Host: GitHub
- URL: https://github.com/alireaza/singleton
- Owner: alireaza
- License: mit
- Created: 2021-11-08T09:40:24.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-03-05T00:48:16.000Z (almost 3 years ago)
- Last Synced: 2024-11-14T10:30:39.963Z (2 months ago)
- Topics: composer, php, singleton
- Language: PHP
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.