/** * @param Bundle $bundle * @param $property * @return bool */ public function saveFileBased(Bundle $bundle, $property) { $xml = $bundle->exportFileBased($property); $xmlFile = $bundle->getPropertyFilePath($property); $emptyXml = '<config> <bundle/> </config>'; if ($xml == $emptyXml) { if ($this->localFilesystem->has($xmlFile)) { return $this->localFilesystem->delete($xmlFile); } else { return true; } } else { return $this->localFilesystem->write($xmlFile, $xml); } }