src/CheckCommand.php
protected function loadConfig( $path ) {
		$confPath = $path . '/.minus-x.json';
		if ( !file_exists( $confPath ) ) {
			return;
		}

		$config = json_decode( file_get_contents( $confPath ), true );
		if ( !is_array( $config ) ) {
			$this->output->writeln( 'Error: .minus-x.json is not valid JSON' );
			return 1;
		}

		if ( isset( $config['ignore'] ) ) {
			$this->ignoredFiles = array_map( function ( $a ) use ( $path ) {
				return realpath( $path . '/' . $a );
			}, $config['ignore'] );
		}

		if ( isset( $config['ignoreDirectories'] ) ) {
			$this->ignoredDirs = array_map( function ( $a ) use ( $path ) {
				return realpath( $path . '/' . $a );
			}, $config['ignoreDirectories'] );
		}

		if ( strtoupper( substr( PHP_OS, 0, 3 ) ) === 'WIN' ) {
			// On Windows, is_executable() always returns true, so whitelist those
			// files
			$this->whitelist[] = 'application/x-dosexec';
		}
	}
protected function loadConfig( $path ) {
		$confPath = $path . '/.minus-x.json';
		if ( !file_exists( $confPath ) ) {
			return;
		}

		$config = json_decode( file_get_contents( $confPath ), true );
		if ( !is_array( $config ) ) {
			$this->output->writeln( 'Error: .minus-x.json is not valid JSON' );
			return 1;
		}

		if ( isset( $config['ignore'] ) ) {
			$this->ignoredFiles = array_map( function ( $a ) use ( $path ) {
				return realpath( $path . '/' . $a );
			}, $config['ignore'] );
		}

		if ( isset( $config['ignoreDirectories'] ) ) {
			$this->ignoredDirs = array_map( function ( $a ) use ( $path ) {
				return realpath( $path . '/' . $a );
			}, $config['ignoreDirectories'] );
		}

		if ( strtoupper( substr( PHP_OS, 0, 3 ) ) === 'WIN' ) {
			// On Windows, is_executable() always returns true, so whitelist those
			// files
			$this->whitelist[] = 'application/x-dosexec';
		}
	}
protected function loadConfig ( $ path ) { $ confPath = $ path . '/.minus-x.json' ; if ( ! file_exists ( $ confPath ) ) { return ; } $ config = json_decode ( file_get_contents ( $ confPath ) , true ) ; if ( ! is_array ( $ config ) ) { $ this -> output -> writeln ( 'Error: .minus-x.json is not valid JSON' ) ; return 1 ; } if ( isset ( $ config [ 'ignore' ] ) ) { $ this -> ignoredFiles = array_map ( function ( $ a ) use ( $ path ) { return realpath ( $ path . '/' . $ a ) ; } , $ config [ 'ignore' ] ) ; } if ( isset ( $ config [ 'ignoreDirectories' ] ) ) { $ this -> ignoredDirs = array_map ( function ( $ a ) use ( $ path ) { return realpath ( $ path . '/' . $ a ) ; } , $ config [ 'ignoreDirectories' ] ) ; } if ( strtoupper ( substr ( PHP_OS , 0 , 3 ) ) === 'WIN' ) { // On Windows, is_executable() always returns true, so whitelist those // files $ this -> whitelist [ ] = 'application/x-dosexec' ; } }
Load configuration from .minus-x.json

@param string $path Root directory that JSON file should be in
@return int|null If an int, status code to exit with
Load configuration from . minus - x . json