1: <?php
2:
3: namespace Deimos\Helper;
4:
5: use Deimos\Builder\Builder;
6:
7: class Helper extends Builder
8: {
9:
10: /***
11: * @var Builder
12: */
13: protected $builder;
14:
15: /**
16: * Helper constructor.
17: *
18: * @param Builder $builder
19: *
20: * @throws \InvalidArgumentException
21: */
22: public function __construct(Builder $builder)
23: {
24: if ($builder instanceof self)
25: {
26: throw new \InvalidArgumentException('Instanceof SELF');
27: }
28:
29: $this->builder = $builder;
30: }
31:
32: /**
33: * @return Helpers\Arr\Arr
34: */
35: public function arr()
36: {
37: return $this->once(function ()
38: {
39: return new Helpers\Arr\Arr($this);
40: }, __METHOD__);
41: }
42:
43: /**
44: * @return Helpers\Str\Str
45: */
46: public function str()
47: {
48: return $this->once(function ()
49: {
50: return new Helpers\Str\Str($this);
51: }, __METHOD__);
52: }
53:
54: /**
55: * @return Helpers\Json
56: */
57: public function json()
58: {
59: return $this->once(function ()
60: {
61: return new Helpers\Json($this);
62: }, __METHOD__);
63: }
64:
65: /**
66: * @return Helpers\File
67: */
68: public function file()
69: {
70: return $this->once(function ()
71: {
72: return new Helpers\File($this);
73: }, __METHOD__);
74: }
75:
76: /**
77: * @return Helpers\Dir
78: */
79: public function dir()
80: {
81: return $this->once(function ()
82: {
83: return new Helpers\Dir($this);
84: }, __METHOD__);
85: }
86:
87: /**
88: * @return Helpers\Money
89: */
90: public function money()
91: {
92: return $this->once(function ()
93: {
94: return new Helpers\Money($this);
95: }, __METHOD__);
96: }
97:
98: /**
99: * @return Helpers\Math
100: */
101: public function math()
102: {
103: return $this->once(function ()
104: {
105: return new Helpers\Math($this);
106: }, __METHOD__);
107: }
108:
109: }