File tree 3 files changed +23
-14
lines changed
3 files changed +23
-14
lines changed Original file line number Diff line number Diff line change 2
2
3
3
## Unreleased
4
4
5
+ ### Changed
6
+ - Changed the signature for the Manager class. Remove the requirement for the container to be passed in.
7
+
5
8
## 0.4.6 - 2021-07-28
6
9
7
10
### Added
Original file line number Diff line number Diff line change 6
6
namespace Torchlight ;
7
7
8
8
use Illuminate \Contracts \Cache \Repository ;
9
- use Illuminate \Contracts \Container \Container ;
10
9
use Illuminate \Support \Arr ;
11
10
use Illuminate \Support \Facades \Cache ;
12
11
use Illuminate \Support \Str ;
@@ -27,38 +26,45 @@ class Manager
27
26
protected $ cache ;
28
27
29
28
/**
30
- * @var Container
29
+ * @var Client
31
30
*/
32
- protected $ app ;
31
+ protected $ client ;
33
32
34
33
/**
35
34
* @var null|string
36
35
*/
37
36
protected $ environment ;
38
37
39
38
/**
40
- * @param Container $app
39
+ * @param Client $client
40
+ * @return Manager
41
41
*/
42
- public function __construct ( Container $ app )
42
+ public function setClient ( Client $ client )
43
43
{
44
- $ this ->app = $ app ;
44
+ $ this ->client = $ client ;
45
+
46
+ return $ this ;
45
47
}
46
48
47
49
/**
48
- * @param $blocks
49
- * @return mixed
50
+ * @return Client
50
51
*/
51
- public function highlight ( $ blocks )
52
+ public function client ( )
52
53
{
53
- return $ this ->client ()->highlight ($ blocks );
54
+ if (!$ this ->client ) {
55
+ $ this ->client = new Client ;
56
+ }
57
+
58
+ return $ this ->client ;
54
59
}
55
60
56
61
/**
57
- * @return Client
62
+ * @param $blocks
63
+ * @return mixed
58
64
*/
59
- public function client ( )
65
+ public function highlight ( $ blocks )
60
66
{
61
- return $ this ->app -> make (Client::class );
67
+ return $ this ->client ()-> highlight ( $ blocks );
62
68
}
63
69
64
70
/**
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ public function boot()
23
23
public function bindManagerSingleton ()
24
24
{
25
25
$ this ->app ->singleton (Manager::class, function () {
26
- return new Manager ( $ this -> app ) ;
26
+ return new Manager ;
27
27
});
28
28
}
29
29
You can’t perform that action at this time.
0 commit comments