phug-php/phug

View on GitHub
src/Phug/Util/Util/Partial/HashPrintTrait.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
<?php

namespace Phug\Util\Partial;

use Phug\Util\Hasher;

/**
 * Class HashPrintTrait.
 *
 * Provides a protected method hashPrint to get an hashed blueprint for an input file or content.
 */
trait HashPrintTrait
{
    /**
     * Return a hashed print from input file or content.
     *
     * @param string $input
     *
     * @return string
     */
    protected function hashPrint($input)
    {
        $hasher = new Hasher($input);

        return $hasher->hash();
    }
}