Skip to content

InnerFunctionsSniff should flag functions defined inside closures #3806

@Daimona

Description

@Daimona

InnerFunctionsSniff detects functions defined inside other functions, but not inside closures, meaning it won't report any violations for the following snippet:

$myFunc = function () {
	function test(): int {
		return 54;
	}
};

For consistency, this should be treated the same as:

function myFunc() {
	function test(): int {
		return 54;
	}
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions