public function configure(array $configuration = null)
{
if (null === $configuration) {
$this->configuration = self::$defaultConfiguration;
return;
}
foreach ($configuration as $functionName => $replacement) {
if (!array_key_exists($functionName, self::$defaultConfiguration)) {
throw new InvalidFixerConfigurationException($this->getName(), sprintf('"%s" is not handled by the fixer.', $functionName));
}
if (!is_string($replacement)) {
throw new InvalidFixerConfigurationException($this->getName(), sprintf('Expected string got "%s".', is_object($replacement) ? get_class($replacement) : gettype($replacement)));
}
$configuration[$functionName] = array('alternativeName' => $replacement, 'argumentCount' => self::$defaultConfiguration[$functionName]['argumentCount']);
}
$this->configuration = $configuration;
}