joomla / coding-standards

Joomla Coding Standards Definition
https://developer.joomla.org/coding-standards/basic-guidelines.html
GNU General Public License v2.0
128 stars 129 forks source link

Indentation Confusion #240

Closed Skeeve closed 5 years ago

Skeeve commented 5 years ago

There is an indentation confusion. Please see below code (completely meaningless code!).

In line 14 (Line after "// HERE") phpcs with Joomla CS is complaining that it finds 6 tabs instead of the expected 4.

When I remove 2 tabs it complains that it expects 6 tabs but found 4.

<?php
$a = preg_replace_callback(
    '/./',
    function ($matches) use ($a) {
        switch ("a")
        {
            case "a":
                return;
            default:
                return preg_replace_callback(
                    '/./',
                    function ($matches) use ($a) {
                        switch ("a") // HERE
                        {
                            case "a":
                                return;
                            default:
                                return;
                        }

                        return;
                    }, "..."
                );
        }

        return;
    }, "..."
);
mbabker commented 5 years ago

Duplicate of #230