Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Mar 8, 2023
1 parent 1ccb0ad commit 031ee2e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/Latte/Engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ public function getTemplateClass(string $name): string
];
foreach ($this->extensions as $extension) {
$key[] = [
preg_replace('~\$.*~', '', $extension::class), // remove id from anonymous class
get_debug_type($extension),
$extension->getCacheKey($this),
];
}
Expand Down Expand Up @@ -550,8 +550,6 @@ private function processParams(object|array $params): array
{
if (is_array($params)) {
return $params;
} elseif (!is_object($params)) {
throw new \InvalidArgumentException(sprintf('Engine::render() expects array|object, %s given.', gettype($params)));
}

$methods = (new \ReflectionClass($params))->getMethods(\ReflectionMethod::IS_PUBLIC);
Expand Down
2 changes: 1 addition & 1 deletion src/Latte/Essential/CachingIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function __construct(mixed $iterator, ?self $parent = null)
$iterator = new \IteratorIterator($iterator);
}
} else {
throw new \InvalidArgumentException(sprintf('Invalid argument passed to foreach; array or Traversable expected, %s given.', is_object($iterator) ? $iterator::class : gettype($iterator)));
throw new \InvalidArgumentException(sprintf('Invalid argument passed to foreach; array or Traversable expected, %s given.', get_debug_type($iterator)));
}

parent::__construct($iterator, 0);
Expand Down

0 comments on commit 031ee2e

Please sign in to comment.