Skip to content

Commit

Permalink
Fix HHVM compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
kylekatarnls committed Dec 5, 2017
1 parent 0a1a8bb commit 57970ea
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Phug/Partial/ExtensionsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ trait ExtensionsTrait
*/
private static $extensions = [];

private static function normalizeExtensionClassName($name)
{
return ltrim('\\', strtolower($name));
}

private static function getExtensionsGetters()
{
return [
Expand Down Expand Up @@ -83,6 +78,11 @@ private static function extractExtensionOptions(&$options, $extensionClassName,
}
}

protected static function normalizeExtensionClassName($name)
{
return ltrim('\\', strtolower($name));
}

/**
* Get options from extensions list and default options.
*
Expand Down Expand Up @@ -120,9 +120,9 @@ public static function getExtensionsOptions(array $extensions, array $options =
public static function hasExtension($extensionClassName)
{
return in_array(
self::normalizeExtensionClassName($extensionClassName),
static::normalizeExtensionClassName($extensionClassName),
array_map(
[self::class, 'normalizeExtensionClassName'],
[static::class, 'normalizeExtensionClassName'],
self::$extensions
)
);
Expand Down

0 comments on commit 57970ea

Please sign in to comment.