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: 4 months 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 (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2012-09-22T10:49:31.000Z (almost 13 years ago)
- Last Synced: 2025-01-16T23:06:17.248Z (6 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.