public function fix($content, StateBag $stateBag = null)
{
if (!$this->opening || !$this->closing) {
throw new BadFixerConfigurationException();
}
// Fix complex siblings cases
if ($stateBag) {
$content = $this->fixViaState($content, $stateBag, 'SmartQuotesOpenSolo', '@(^|\\s|\\()"([^"]*)$@im', '@(^|[^"]+)"@im', $this->opening . $this->openingSuffix, $this->closingPrefix . $this->closing);
}
// Fix simple cases
$content = preg_replace('@(^|\\s|\\()"([^"]+)"@im', '$1' . $this->opening . $this->openingSuffix . '$2' . $this->closingPrefix . $this->closing, $content);
return $content;
}