Conditions | 2 |
Paths | 2 |
Total Lines | 23 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
75 | public function code(string $language) : Mailcode_Commands_Command_Code |
||
76 | { |
||
77 | $cmd = Mailcode::create()->getCommands()->createCommand( |
||
78 | 'Code', |
||
79 | '', |
||
80 | sprintf( |
||
81 | '"%s"', |
||
82 | $language |
||
83 | ), |
||
84 | sprintf( |
||
85 | '{code: "%s"}', |
||
86 | $language |
||
87 | ) |
||
88 | ); |
||
89 | |||
90 | $this->instantiator->checkCommand($cmd); |
||
91 | |||
92 | if($cmd instanceof Mailcode_Commands_Command_Code) |
||
93 | { |
||
94 | return $cmd; |
||
95 | } |
||
96 | |||
97 | throw $this->instantiator->exceptionUnexpectedType('Code', $cmd); |
||
98 | } |
||
100 |