Skip to content

InputFilter constructor returning self in Admin projects #21

@Jurj-Bogdan

Description

@Jurj-Bogdan

Bug Report

Q A
Version(s) 1.0.1

Summary

When generating InputFilters in a Dotkernel Admin project, the constructor method is set to return self.

Current behavior

class CreateMagazineInputFilter extends AbstractInputFilter
{
    public function __construct()
    {
        // chain inputs below

        return $this
            ->add(new CsrfInput('CreateMagazineCsrf', true));
    }
}

Expected behavior

This might be a minor issue within the "headless platform" projects themselves, as API and Admin both use
inputFilters in slightly different ways (construct in API, init in Admin)

As for dot-maker:

  • replacing the constructor method with an init() method and keeping the return, to match the existing codebase,
  • dropping the return from the __construct, to match the InputFilter structure in Dotkernel API, but that would mean updating the Admin codebase.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions