Skip to content

Helper classes should not have static methods #106

Open
@dantleech

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

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