Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chrisnharvey/php-singleton-trait
A quick way to turn any class into a singleton using this trait.
https://github.com/chrisnharvey/php-singleton-trait
Last synced: about 4 hours ago
JSON representation
A quick way to turn any class into a singleton using this trait.
- Host: GitHub
- URL: https://github.com/chrisnharvey/php-singleton-trait
- Owner: chrisnharvey
- Created: 2012-09-20T17:59:06.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2012-09-22T10:49:31.000Z (about 12 years ago)
- Last Synced: 2024-05-01T23:30:05.467Z (7 months ago)
- Language: PHP
- Size: 94.7 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
PHP Singleton Trait
===================A quick way to turn any class into a singleton using this trait.
## Usage
You can easily turn your classes into singletons. See the following example.Hello again';
}
}You can then call any of these functions statically and method chain them as if they were instantiated.
MySingletonClass::helloWorld()->helloAgain();
This would output:
Hello World
Hello againIf you would like to submit changes or pull requests then please feel free.