File tree Expand file tree Collapse file tree 5 files changed +0
-66
lines changed Expand file tree Collapse file tree 5 files changed +0
-66
lines changed Original file line number Diff line number Diff line change @@ -49,11 +49,6 @@ class CliMenu
49
49
*/
50
50
protected $ open = false ;
51
51
52
- /**
53
- * @var string
54
- */
55
- private $ allowedConsumer = 'PhpSchool\CliMenu\CliMenuBuilder ' ;
56
-
57
52
/**
58
53
* @var CliMenu|null
59
54
*/
@@ -73,12 +68,6 @@ public function __construct(
73
68
TerminalInterface $ terminal = null ,
74
69
MenuStyle $ style = null
75
70
) {
76
- $ builder = debug_backtrace ();
77
- if (count ($ builder ) < 2 || !isset ($ builder [1 ]['class ' ]) || $ builder [1 ]['class ' ] !== $ this ->allowedConsumer ) {
78
- throw new InvalidInstantiationException (
79
- sprintf ('The CliMenu must be instantiated by "%s" ' , $ this ->allowedConsumer )
80
- );
81
- }
82
71
83
72
$ this ->title = $ title ;
84
73
$ this ->items = $ items ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -76,11 +76,6 @@ class MenuStyle
76
76
*/
77
77
private $ titleSeparator ;
78
78
79
- /**
80
- * @var string
81
- */
82
- private $ allowedConsumer = 'PhpSchool\CliMenu\CliMenuBuilder ' ;
83
-
84
79
/**
85
80
* @var array
86
81
*/
@@ -152,13 +147,6 @@ public function __construct(
152
147
$ titleSeparator = '= ' ,
153
148
TerminalInterface $ terminal = null
154
149
) {
155
- $ builder = debug_backtrace ();
156
- if (count ($ builder ) < 2 || !isset ($ builder [1 ]['class ' ]) || $ builder [1 ]['class ' ] !== $ this ->allowedConsumer ) {
157
- throw new InvalidInstantiationException (
158
- sprintf ('The MenuStyle must be instantiated by "%s" ' , $ this ->allowedConsumer )
159
- );
160
- }
161
-
162
150
$ this ->terminal = $ terminal ?: TerminalFactory::fromSystem ();
163
151
$ this ->bg = $ bg ;
164
152
$ this ->fg = $ fg ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -55,16 +55,6 @@ private function getMockTerminal()
55
55
return $ terminal ;
56
56
}
57
57
58
- public function testMenuStyleCannotBeInstantiatedByDisallowedConsumers ()
59
- {
60
- $ this ->setExpectedException (
61
- InvalidInstantiationException::class,
62
- 'The MenuStyle must be instantiated by "PhpSchool\CliMenu\CliMenuBuilder" '
63
- );
64
-
65
- new MenuStyle ();
66
- }
67
-
68
58
public function testMenuStyleCanBeInstantiatedByCliMenuBuilder ()
69
59
{
70
60
$ builder = new CliMenuBuilder ();
You can’t perform that action at this time.
0 commit comments