Skip to content

Commit 8408a29

Browse files
committed
Remove compilePartial static method
1 parent 4f52480 commit 8408a29

File tree

2 files changed

+0
-36
lines changed

2 files changed

+0
-36
lines changed

src/LightnCandy.php

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -55,36 +55,6 @@ public static function compile($template, $options = array('flags' => 0))
5555
return Compiler::composePHPRender($context, $code);
5656
}
5757

58-
/**
59-
* Compile handlebars partial into PHP function code.
60-
*
61-
* @param string $template handlebars template string
62-
* @param array<string,array|string|integer> $options LightnCandy compile time and run time options
63-
*
64-
* @return string|false Compiled PHP code when successful. If error happened and compile failed, return false.
65-
*
66-
* @expect false when input '{{"}}', array()
67-
*/
68-
public static function compilePartial($template, array $options = [])
69-
{
70-
$context = Context::create($options);
71-
72-
if (static::handleError($context)) {
73-
return false;
74-
}
75-
76-
$code = Partial::compile($context, SafeString::escapeTemplate($template));
77-
78-
static::$lastParsed = Compiler::$lastParsed;
79-
80-
// return false when fatal error
81-
if (static::handleError($context)) {
82-
return false;
83-
}
84-
85-
return $code;
86-
}
87-
8858
/**
8959
* Handle exists error and return error status.
9060
*

tests/LightnCandyTest.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@
1111

1212
class LightnCandyTest extends TestCase
1313
{
14-
public function testOn_compilePartial() {
15-
$method = new \ReflectionMethod('LightnCandy\LightnCandy', 'compilePartial');
16-
$this->assertEquals(false, $method->invokeArgs(null, array_by_ref(array(
17-
'{{"}}', array()
18-
))));
19-
}
2014
public function testOn_handleError() {
2115
$method = new \ReflectionMethod('LightnCandy\LightnCandy', 'handleError');
2216
$method->setAccessible(true);

0 commit comments

Comments
 (0)