src/Shell/FixtureCheckShell.php
public function _compareFields($fixtureFields, $liveFields) {
		// Warn only about relevant fields
		$list = [
			'autoIncrement',
			'default',
			'length',
			'null',
			'precision',
			'type',
			'unsigned',
		];

		$errors = [];
		foreach ($fixtureFields as $fieldName => $fixtureField) {
			if (!isset($liveFields[$fieldName])) {
				$this->out('Field ' . $fieldName . ' is missing from the live DB!');
				continue;
			}

			$liveField = $liveFields[$fieldName];

			foreach ($fixtureField as $key => $value) {
				if (!in_array($key, $list)) {
					continue;
				}

				if (!isset($liveField[$key]) && $value !== null) {
					$errors[] = ' * ' . sprintf('Field attribute `%s` is missing from the live DB!', $fieldName . ':' . $key);
					continue;
				}
				if ($liveField[$key] !== $value) {
					$errors[] = ' * ' . sprintf(
						'Field attribute `%s` differs from live DB! (`%s` vs `%s` live)',
						$fieldName . ':' . $key,
						Debugger::exportVar($value, true),
						Debugger::exportVar($liveField[$key], true)
					);
				}
			}
		}

		if (!$errors) {
			return;
		}

		$this->warn('The following field attributes mismatch:');

		$this->out($errors);
		$this->_issuesFound = true;
		$this->out($this->nl(0));
	}
public function _compareFields($fixtureFields, $liveFields) {
		// Warn only about relevant fields
		$list = [
			'autoIncrement',
			'default',
			'length',
			'null',
			'precision',
			'type',
			'unsigned',
		];

		$errors = [];
		foreach ($fixtureFields as $fieldName => $fixtureField) {
			if (!isset($liveFields[$fieldName])) {
				$this->out('Field ' . $fieldName . ' is missing from the live DB!');
				continue;
			}

			$liveField = $liveFields[$fieldName];

			foreach ($fixtureField as $key => $value) {
				if (!in_array($key, $list)) {
					continue;
				}

				if (!isset($liveField[$key]) && $value !== null) {
					$errors[] = ' * ' . sprintf('Field attribute `%s` is missing from the live DB!', $fieldName . ':' . $key);
					continue;
				}
				if ($liveField[$key] !== $value) {
					$errors[] = ' * ' . sprintf(
						'Field attribute `%s` differs from live DB! (`%s` vs `%s` live)',
						$fieldName . ':' . $key,
						Debugger::exportVar($value, true),
						Debugger::exportVar($liveField[$key], true)
					);
				}
			}
		}

		if (!$errors) {
			return;
		}

		$this->warn('The following field attributes mismatch:');

		$this->out($errors);
		$this->_issuesFound = true;
		$this->out($this->nl(0));
	}
public function _compareFields ( $ fixtureFields , $ liveFields ) { // Warn only about relevant fields $ list = [ 'autoIncrement' , 'default' , 'length' , 'null' , 'precision' , 'type' , 'unsigned' , ] ; $ errors = [ ] ; foreach ( $ fixtureFields as $ fieldName => $ fixtureField ) { if ( ! isset ( $ liveFields [ $ fieldName ] ) ) { $ this -> out ( 'Field ' . $ fieldName . ' is missing from the live DB!' ) ; continue ; } $ liveField = $ liveFields [ $ fieldName ] ; foreach ( $ fixtureField as $ key => $ value ) { if ( ! in_array ( $ key , $ list ) ) { continue ; } if ( ! isset ( $ liveField [ $ key ] ) && $ value !== null ) { $ errors [ ] = ' * ' . sprintf ( 'Field attribute `%s` is missing from the live DB!' , $ fieldName . ':' . $ key ) ; continue ; } if ( $ liveField [ $ key ] !== $ value ) { $ errors [ ] = ' * ' . sprintf ( 'Field attribute `%s` differs from live DB! (`%s` vs `%s` live)' , $ fieldName . ':' . $ key , Debugger :: exportVar ( $ value , true ) , Debugger :: exportVar ( $ liveField [ $ key ] , true ) ) ; } } } if ( ! $ errors ) { return ; } $ this -> warn ( 'The following field attributes mismatch:' ) ; $ this -> out ( $ errors ) ; $ this -> _issuesFound = true ; $ this -> out ( $ this -> nl ( 0 ) ) ; }
Compare the fields present.

@param array $fixtureFields The fixtures fields array.
@param array $liveFields The live DB fields
@return void
Compare the fields present .