Skip to content

Youwe/Global/Common standard conflicts with Magento Coding standards #6

Closed
magento/magento-coding-standard
#416
@boldhedgehog

Description

Youwe Common/Global ruleset is based on PSR-12, and Magento's https://github.com/magento/magento-coding-standard ruleset is still based on PSR2: https://github.com/magento/magento-coding-standard/blob/develop/Magento2/ruleset.xml
There are conflicting rules in PSR2 and PSR12:

  • PSR12.ControlStructures.ControlStructureSpacing.FirstExpressionLine
  • PSR2.ControlStructures.ControlStructureSpacing.SpacingAfterOpenBrace

A code like this cannot properly formatted to be valid for both rules:

if ($qty->getSku() != $orderItem->getSku() ||
    $qtyCount === 0 ||
    isset($data['qtys'][$orderItem->getItemId()]) ||
    $orderItem->getQtyRefunded() > 0
) {
    continue;
}

I would suggest to suppress PSR-12 rules and rely on Magento's ruleset.

UPD: Magento's coding standard seem to follow the PSR-2 rule:

if ($this->isCanceled() ||
            $this->isPaymentReview() ||
            $state === self::STATE_COMPLETE ||
            $state === self::STATE_CLOSED
        ) {
            return false;
        }

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions