Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MtHaml Twig Loader is not compatible with Twig 2.x #100

Open
ZaDarkSide opened this issue Feb 2, 2017 · 0 comments
Open

MtHaml Twig Loader is not compatible with Twig 2.x #100

ZaDarkSide opened this issue Feb 2, 2017 · 0 comments

Comments

@ZaDarkSide
Copy link

ZaDarkSide commented Feb 2, 2017

Class MtHaml\Support\Twig\Loader.php

Has method public function getSource($name) but should be named public function getSourceContext($name) actually

or PHP will throw an error:

Class MtHaml\Support\Twig\Loader contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Twig_LoaderInterface::getSourceContext)

class Loader implements \Twig_LoaderInterface, \Twig_ExistsLoaderInterface
{
    ...

    public function getSource($name)  // <------ SHOULD BE getSourceContext
    {
        ...
    }

    ...

But Twig class expects in Twig\LoaderInterface.php:

interface Twig_LoaderInterface
{
    ...

    /**
     * Returns the source context for a given template logical name.
     *
     * @param string $name The template logical name
     *
     * @return Twig_Source
     *
     * @throws Twig_Error_Loader When $name is not found
     */
    public function getSourceContext($name); // <------ NEEDS THIS NAME
    {
        ...
    }

    ...
@ZaDarkSide ZaDarkSide changed the title MtHaml is not compatible with Twig 2.x MtHaml Twig Loader is not compatible with Twig 2.x Feb 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant