for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace League\Plates\HydrateTemplate;
use League\Plates;
/** Wraps a callable into the HydrateTemplate interface */
class CallableHydrateTemplate implements Plates\HydrateTemplate
{
private $hydrate_template;
public function __construct(callable $hydrate_template) {
$this->hydrate_template = $hydrate_template;
}
public function hydrateTemplate(Plates\Template $template) {
return ($this->hydrate_template)($template);
public static function stub() {
return new self(function(Plates\Template $template) {});
$template
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
public static function resolvePath(callable $resolvePath) {
return new self(function($template) use ($resolvePath) {
Plates\Template\setPath(
$template,
$resolvePath(Plates\Template\ResolvePathArgs::fromTemplate($template))
);
});
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.