Skip to content

Switch statement indention issue when returning function call with closure #859

@Tobion

Description

@Tobion

Allegedly the switch statement indention has been been fixed in 2.5 according to all those tickets like #786
But in 2.5 I still get wrong indention errors for the following code (maybe caused by closures):

        switch ($facetName) {
            case self::FACET_BRAND:
                return $this->getIdOrSlugFilter($facetName, function ($id) {
                    return BrandRepository::isSlug($id);
                }, $values);
            case self::FACET_LABEL:
                return $this->getIdOrSlugFilter($facetName, function ($id) {
                    return LabelRepository::isSlug($id);
                }, $values);
            case self::FACET_RETAILER:
                $values = $this->replaceSlugsWithIds($facetName, $values);
                break;
            case self::FACET_DISCOUNT:
                $values = $this->replaceSlugsWithIds($facetName, $values);

                return $this->getDiscountFilter($values);
        }

It reports that the following case statements are Line indented incorrectly; expected 16 spaces, found 12

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions