Skip to content

Commit

Permalink
Rename ModificationAwareInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
GromNaN committed Dec 26, 2023
1 parent 5011791 commit 5bfb738
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Extension/AttributeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*
* @author Jérôme Tamarelle <[email protected]>
*/
final class AttributeExtension extends AbstractExtension implements WithLastModified
final class AttributeExtension extends AbstractExtension implements ModificationAwareInterface
{
private array $filters;
private array $functions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

/**
* Freshness of templates use the last modification date of each extension class.
* Implement this interface to provide a different last modification date.
* Implement this interface to provide a different modification date for the extension.
*/
interface WithLastModified
interface ModificationAwareInterface
{
/**
* @return int A UNIX timestamp
Expand Down
4 changes: 2 additions & 2 deletions src/ExtensionSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use Twig\Extension\ExtensionInterface;
use Twig\Extension\GlobalsInterface;
use Twig\Extension\StagingExtension;
use Twig\Extension\WithLastModified;
use Twig\Extension\ModificationAwareInterface;
use Twig\Node\Expression\Binary\AbstractBinary;
use Twig\Node\Expression\Unary\AbstractUnary;
use Twig\NodeVisitor\NodeVisitorInterface;
Expand Down Expand Up @@ -116,7 +116,7 @@ public function getLastModified(): int
if (is_file($r->getFileName()) && $this->lastModified < $extensionTime = filemtime($r->getFileName())) {
$this->lastModified = $extensionTime;
}
if ($extension instanceof WithLastModified && $this->lastModified < $extensionTime = $extension->getLastModified()) {
if ($extension instanceof ModificationAwareInterface && $this->lastModified < $extensionTime = $extension->getLastModified()) {
$this->lastModified = $extensionTime;
}
}
Expand Down

0 comments on commit 5bfb738

Please sign in to comment.