WordPress/Sniffs/Arrays/ArrayDeclarationSpacingSniff.php
public function process_token( $stackPtr ) {
		/*
		 * Determine the array opener & closer.
		 */
		$array_open_close = $this->find_array_open_close( $stackPtr );
		if ( false === $array_open_close ) {
			// Array open/close could not be determined.
			return;
		}

		$opener = $array_open_close['opener'];
		$closer = $array_open_close['closer'];
		unset( $array_open_close );

		/*
		 * Long arrays only: Check for space between the array keyword and the open parenthesis.
		 */
		if ( \T_ARRAY === $this->tokens[ $stackPtr ]['code'] ) {

			if ( ( $stackPtr + 1 ) !== $opener ) {
				$error      = 'There must be no space between the "array" keyword and the opening parenthesis';
				$error_code = 'SpaceAfterKeyword';

				$nextNonWhitespace = $this->phpcsFile->findNext( \T_WHITESPACE, ( $stackPtr + 1 ), ( $opener + 1 ), true );
				if ( $nextNonWhitespace !== $opener ) {
					// Don't auto-fix: Something other than whitespace found between keyword and open parenthesis.
					$this->phpcsFile->addError( $error, $stackPtr, $error_code );
				} else {

					$fix = $this->phpcsFile->addFixableError( $error, $stackPtr, $error_code );

					if ( true === $fix ) {
						$this->phpcsFile->fixer->beginChangeset();
						for ( $i = ( $stackPtr + 1 ); $i < $opener; $i++ ) {
							$this->phpcsFile->fixer->replaceToken( $i, '' );
						}
						$this->phpcsFile->fixer->endChangeset();
						unset( $i );
					}
				}
				unset( $error, $error_code, $nextNonWhitespace, $fix );
			}
		}

		/*
		 * Check for empty arrays.
		 */
		$nextNonWhitespace = $this->phpcsFile->findNext( \T_WHITESPACE, ( $opener + 1 ), ( $closer + 1 ), true );
		if ( $nextNonWhitespace === $closer ) {

			if ( ( $opener + 1 ) !== $closer ) {
				$fix = $this->phpcsFile->addFixableError(
					'Empty array declaration must have no space between the parentheses',
					$stackPtr,
					'SpaceInEmptyArray'
				);

				if ( true === $fix ) {
					$this->phpcsFile->fixer->beginChangeset();
					for ( $i = ( $opener + 1 ); $i < $closer; $i++ ) {
						$this->phpcsFile->fixer->replaceToken( $i, '' );
					}
					$this->phpcsFile->fixer->endChangeset();
					unset( $i );
				}
			}

			// This array is empty, so the below checks aren't necessary.
			return;
		}
		unset( $nextNonWhitespace );

		// Pass off to either the single line or multi-line array analysis.
		if ( $this->tokens[ $opener ]['line'] === $this->tokens[ $closer ]['line'] ) {
			$this->process_single_line_array( $stackPtr, $opener, $closer );
		} else {
			$this->process_multi_line_array( $stackPtr, $opener, $closer );
		}
	}
public function process_token( $stackPtr ) {
		/*
		 * Determine the array opener & closer.
		 */
		$array_open_close = $this->find_array_open_close( $stackPtr );
		if ( false === $array_open_close ) {
			// Array open/close could not be determined.
			return;
		}

		$opener = $array_open_close['opener'];
		$closer = $array_open_close['closer'];
		unset( $array_open_close );

		/*
		 * Long arrays only: Check for space between the array keyword and the open parenthesis.
		 */
		if ( \T_ARRAY === $this->tokens[ $stackPtr ]['code'] ) {

			if ( ( $stackPtr + 1 ) !== $opener ) {
				$error      = 'There must be no space between the "array" keyword and the opening parenthesis';
				$error_code = 'SpaceAfterKeyword';

				$nextNonWhitespace = $this->phpcsFile->findNext( \T_WHITESPACE, ( $stackPtr + 1 ), ( $opener + 1 ), true );
				if ( $nextNonWhitespace !== $opener ) {
					// Don't auto-fix: Something other than whitespace found between keyword and open parenthesis.
					$this->phpcsFile->addError( $error, $stackPtr, $error_code );
				} else {

					$fix = $this->phpcsFile->addFixableError( $error, $stackPtr, $error_code );

					if ( true === $fix ) {
						$this->phpcsFile->fixer->beginChangeset();
						for ( $i = ( $stackPtr + 1 ); $i < $opener; $i++ ) {
							$this->phpcsFile->fixer->replaceToken( $i, '' );
						}
						$this->phpcsFile->fixer->endChangeset();
						unset( $i );
					}
				}
				unset( $error, $error_code, $nextNonWhitespace, $fix );
			}
		}

		/*
		 * Check for empty arrays.
		 */
		$nextNonWhitespace = $this->phpcsFile->findNext( \T_WHITESPACE, ( $opener + 1 ), ( $closer + 1 ), true );
		if ( $nextNonWhitespace === $closer ) {

			if ( ( $opener + 1 ) !== $closer ) {
				$fix = $this->phpcsFile->addFixableError(
					'Empty array declaration must have no space between the parentheses',
					$stackPtr,
					'SpaceInEmptyArray'
				);

				if ( true === $fix ) {
					$this->phpcsFile->fixer->beginChangeset();
					for ( $i = ( $opener + 1 ); $i < $closer; $i++ ) {
						$this->phpcsFile->fixer->replaceToken( $i, '' );
					}
					$this->phpcsFile->fixer->endChangeset();
					unset( $i );
				}
			}

			// This array is empty, so the below checks aren't necessary.
			return;
		}
		unset( $nextNonWhitespace );

		// Pass off to either the single line or multi-line array analysis.
		if ( $this->tokens[ $opener ]['line'] === $this->tokens[ $closer ]['line'] ) {
			$this->process_single_line_array( $stackPtr, $opener, $closer );
		} else {
			$this->process_multi_line_array( $stackPtr, $opener, $closer );
		}
	}
Processes this test, when one of its tokens is encountered.

@since 0.12.0 The actual checks contained in this method used to
be in the `processSingleLineArray()` method.

@param int $stackPtr The position of the current token in the stack.

@return void