src/Standards/BestIt/Sniffs/Formatting/AlphabeticClassContentSniff.php
private function checkAndRegisterSortingProblems(array $foundContentsOrg, array $foundContentsSorted): void
    {
        $checkIndex = 0;

        foreach ($foundContentsOrg as $foundContentPos => $foundContent) {
            if ($foundContentsSorted[$checkIndex++] !== $foundContent) {
                $this->file->getBaseFile()->addWarning(
                    self::MESSAGE_SORT_ALPHABETICALLY,
                    $foundContentPos,
                    static::CODE_SORT_ALPHABETICALLY
                );
            }
        }
    }
private function checkAndRegisterSortingProblems(array $foundContentsOrg, array $foundContentsSorted): void
    {
        $checkIndex = 0;

        foreach ($foundContentsOrg as $foundContentPos => $foundContent) {
            if ($foundContentsSorted[$checkIndex++] !== $foundContent) {
                $this->file->getBaseFile()->addWarning(
                    self::MESSAGE_SORT_ALPHABETICALLY,
                    $foundContentPos,
                    static::CODE_SORT_ALPHABETICALLY
                );
            }
        }
    }
private function checkAndRegisterSortingProblems ( array $ foundContentsOrg , array $ foundContentsSorted ) : void { $ checkIndex = 0 ; foreach ( $ foundContentsOrg as $ foundContentPos => $ foundContent ) { if ( $ foundContentsSorted [ $ checkIndex ++ ] !== $ foundContent ) { $ this -> file -> getBaseFile ( ) -> addWarning ( self :: MESSAGE_SORT_ALPHABETICALLY , $ foundContentPos , static :: CODE_SORT_ALPHABETICALLY ) ; } } }
Checks the sorting of both arrays and registered warnings, if a token is not on the correct position.

@param array $foundContentsOrg The original contents with their position.
@param array $foundContentsSorted The sorted contents without their position as array key.

@return void
Checks the sorting of both arrays and registered warnings if a token is not on the correct position .