Skip to content

Commit

Permalink
Align option name between adapter and renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
kylekatarnls committed Sep 17, 2017
1 parent e7910f1 commit 76c0ef3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Phug/Renderer/Adapter/FileAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function __construct(Renderer $renderer, $options)
'cache_dir' => null,
'tmp_dir' => sys_get_temp_dir(),
'tmp_name_function' => 'tempnam',
'modified_check' => true,
'up_to_date_check' => true,
'keep_base_name' => false,
]);

Expand Down Expand Up @@ -209,7 +209,7 @@ private function isCacheUpToDate(&$path, $input = null)
);

// Do not re-parse file if original is older
return !$this->getOption('modified_check') ||
return !$this->getOption('up_to_date_check') ||
(file_exists($path) && filemtime($input) < filemtime($path));
}

Expand Down
4 changes: 2 additions & 2 deletions tests/Phug/Adapter/FileAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ public function testCache()
'message' => 'Hi',
]));

$renderer->getAdapter()->setOption('modified_check', false);
$renderer->getAdapter()->setOption('up_to_date_check', false);
file_put_contents($path, 'div=$message');

self::assertSame('<p>Hi</p>', $renderer->renderFile($path, [
'message' => 'Hi',
]));

$renderer->getAdapter()->setOption('modified_check', true);
$renderer->getAdapter()->setOption('up_to_date_check', true);

self::assertSame('<div>Hi</div>', $renderer->renderFile($path, [
'message' => 'Hi',
Expand Down

0 comments on commit 76c0ef3

Please sign in to comment.