Skip to content

Helper classes should not have static methods #106

Description

@dantleech

NodeHelper class is a utility class which implements a set of static methods. This is a problem because the Session object is passed to some of the methods, which makes really widens the scope of unit tests.

e.g.

NodeHelper::createPath($session, '/foo/bar');

Ultimately we should be able to use the NodeHelper::createPath method from an injected class, e.g.

$this->nodeHelper->createPath('/foobar');

This would make unit testing classes which need to create paths much cleaner. https://github.com/symfony-cmf/RoutingAutoBundle/pull/73/files#r10602618

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions