File tree Expand file tree Collapse file tree 3 files changed +23
-14
lines changed Expand file tree Collapse file tree 3 files changed +23
-14
lines changed Original file line number Diff line number Diff line change 22
33## Unreleased
44
5+ ### Changed
6+ - Changed the signature for the Manager class. Remove the requirement for the container to be passed in.
7+
58## 0.4.6 - 2021-07-28
69
710### Added
Original file line number Diff line number Diff line change 66namespace Torchlight ;
77
88use Illuminate \Contracts \Cache \Repository ;
9- use Illuminate \Contracts \Container \Container ;
109use Illuminate \Support \Arr ;
1110use Illuminate \Support \Facades \Cache ;
1211use Illuminate \Support \Str ;
@@ -27,38 +26,45 @@ class Manager
2726 protected $ cache ;
2827
2928 /**
30- * @var Container
29+ * @var Client
3130 */
32- protected $ app ;
31+ protected $ client ;
3332
3433 /**
3534 * @var null|string
3635 */
3736 protected $ environment ;
3837
3938 /**
40- * @param Container $app
39+ * @param Client $client
40+ * @return Manager
4141 */
42- public function __construct ( Container $ app )
42+ public function setClient ( Client $ client )
4343 {
44- $ this ->app = $ app ;
44+ $ this ->client = $ client ;
45+
46+ return $ this ;
4547 }
4648
4749 /**
48- * @param $blocks
49- * @return mixed
50+ * @return Client
5051 */
51- public function highlight ( $ blocks )
52+ public function client ( )
5253 {
53- return $ this ->client ()->highlight ($ blocks );
54+ if (!$ this ->client ) {
55+ $ this ->client = new Client ;
56+ }
57+
58+ return $ this ->client ;
5459 }
5560
5661 /**
57- * @return Client
62+ * @param $blocks
63+ * @return mixed
5864 */
59- public function client ( )
65+ public function highlight ( $ blocks )
6066 {
61- return $ this ->app -> make (Client::class );
67+ return $ this ->client ()-> highlight ( $ blocks );
6268 }
6369
6470 /**
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ public function boot()
2323 public function bindManagerSingleton ()
2424 {
2525 $ this ->app ->singleton (Manager::class, function () {
26- return new Manager ( $ this -> app ) ;
26+ return new Manager ;
2727 });
2828 }
2929
You can’t perform that action at this time.
0 commit comments