File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change 14
14
[ ![ Scrutinizer Code Quality] ( https://scrutinizer-ci.com/g/byjg/SingletonPatternPHP/badges/quality-score.png?b=master )] ( https://scrutinizer-ci.com/g/byjg/SingletonPatternPHP/?branch=master )
15
15
[ ![ Code Climate] ( https://codeclimate.com/github/byjg/SingletonPatternPHP/badges/gpa.svg )] ( https://codeclimate.com/github/byjg/SingletonPatternPHP )
16
16
17
- ## Description
18
17
19
18
A lightweight PHP implementation of the Design Pattern Singleton using trait.
20
19
Just one class and no dependencies.
21
20
22
- ## Usage
21
+ # Usage
23
22
24
- ### Create your class
23
+ ## Create your class
25
24
26
25
``` php
27
26
require "vendor/autoload.php";
@@ -39,17 +38,20 @@ class Example
39
38
Singleton classes does not have arguments in the constructor;
40
39
41
40
42
- ### Use your class
41
+ ## Use your class
43
42
44
43
``` php
45
44
$example = Example::getInstance();
46
45
```
47
46
48
- ## Install
47
+ # Install
49
48
50
- Just type: ` composer require "byjg/singleton-pattern=~1.0" `
49
+ ```
50
+ composer require "byjg/singleton-pattern=~1.0"
51
+ ```
51
52
52
- ## References
53
+ # References
53
54
54
55
* https://en.wikipedia.org/wiki/Singleton_pattern
55
56
57
+
You can’t perform that action at this time.
0 commit comments