File "SpreadOperatorSpacingAfterUnitTest.inc.fixed"

Full Path: /home/warrior1/public_html/wp-content/themes/storefront/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/SpreadOperatorSpacingAfterUnitTest.inc.fixed
File size: 1.29 KB
MIME-type: text/x-php
Charset: utf-8

<?php

function foo( &...$spread ) {
    bar( ...$spread );

    bar(
        [ ...$foo ],
        ...array_values($keyedArray)
    );
}

function bar( &   ...$spread ) {
    bar(...$spread
    );

    bar(
        [...$foo ],.../*comment*/array_values($keyedArray)
    );
}

// phpcs:set Generic.WhiteSpace.SpreadOperatorSpacingAfter ignoreNewlines true
    bar(...
        $spread
    );
// phpcs:set Generic.WhiteSpace.SpreadOperatorSpacingAfter ignoreNewlines false

// phpcs:set Generic.WhiteSpace.SpreadOperatorSpacingAfter spacing 1
function foo( &... $spread ) {
    bar( ... $spread );

    bar(
        [ ... $foo ],
        ... array_values($keyedArray)
    );
}

function bar( &   ... $spread ) {
    bar(... $spread
    );

    bar(
        [... $foo ],.../*comment*/array_values($keyedArray)
    );
}

// phpcs:set Generic.WhiteSpace.SpreadOperatorSpacingAfter spacing 2
function foo( &...  $spread ) {
    bar( ...  $spread );

    bar(
        [ ...  $foo ],
        ...  array_values($keyedArray)
    );
}

function bar( &   ...  $spread ) {
    bar(...  $spread
    );

    bar(
        [...  $foo ],.../*comment*/array_values($keyedArray)
    );
}

// phpcs:set Generic.WhiteSpace.SpreadOperatorSpacingAfter spacing 0

// Intentional parse error. This has to be the last test in the file.
function bar( ...