Minor coding style fixes and more docblock removal
This commit is contained in:
parent
b7ae5b4afb
commit
ec3eed68ca
@ -46,7 +46,7 @@ class AnnotationExporter extends AbstractExporter
|
||||
*/
|
||||
public function exportClassMetadata(ClassMetadataInfo $metadata): string
|
||||
{
|
||||
if ( ! $this->_entityGenerator) {
|
||||
if (!$this->_entityGenerator) {
|
||||
throw new \RuntimeException('For the AnnotationExporter you must set an EntityGenerator instance with the setEntityGenerator() method.');
|
||||
}
|
||||
|
||||
@ -58,21 +58,11 @@ class AnnotationExporter extends AbstractExporter
|
||||
return $this->_entityGenerator->generateEntityClass($metadata);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Doctrine\ORM\Mapping\ClassMetadataInfo $metadata
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _generateOutputPath(ClassMetadataInfo $metadata): string
|
||||
{
|
||||
return $this->_outputDir . '/' . str_replace('\\', '/', $metadata->name) . $this->_extension;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Doctrine\ORM\Tools\EntityGenerator $entityGenerator
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setEntityGenerator(EntityGenerator $entityGenerator): void
|
||||
{
|
||||
$this->_entityGenerator = $entityGenerator;
|
||||
|
@ -161,11 +161,6 @@ class PhpExporter extends AbstractExporter
|
||||
return implode("\n", $lines);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $var
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _varExport($var): string
|
||||
{
|
||||
$export = var_export($var, true);
|
||||
@ -190,11 +185,11 @@ class PhpExporter extends AbstractExporter
|
||||
|
||||
foreach ($metadata->entityListeners as $event => $entityListenerConfig) {
|
||||
foreach ($entityListenerConfig as $entityListener) {
|
||||
$lines[] = sprintf(
|
||||
$lines[] = \sprintf(
|
||||
'$metadata->addEntityListener(%s, %s, %s);',
|
||||
var_export($event, true),
|
||||
var_export($entityListener['class'], true),
|
||||
var_export($entityListener['method'], true)
|
||||
\var_export($event, true),
|
||||
\var_export($entityListener['class'], true),
|
||||
\var_export($entityListener['method'], true)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -41,10 +41,10 @@ class XmlExporter extends AbstractExporter
|
||||
*/
|
||||
public function exportClassMetadata(ClassMetadataInfo $metadata): string
|
||||
{
|
||||
$xml = new SimpleXmlElement("<?xml version=\"1.0\" encoding=\"utf-8\"?><doctrine-mapping ".
|
||||
"xmlns=\"http://doctrine-project.org/schemas/orm/doctrine-mapping\" " .
|
||||
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ".
|
||||
"xsi:schemaLocation=\"http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd\" />");
|
||||
$xml = new SimpleXmlElement('<?xml version="1.0" encoding="utf-8"?><doctrine-mapping ' .
|
||||
'xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" ' .
|
||||
'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' .
|
||||
'xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd" />');
|
||||
|
||||
if ($metadata->isMappedSuperclass) {
|
||||
$root = $xml->addChild('mapped-superclass');
|
||||
@ -98,7 +98,7 @@ class XmlExporter extends AbstractExporter
|
||||
|
||||
$trackingPolicy = $this->_getChangeTrackingPolicyString($metadata->changeTrackingPolicy);
|
||||
|
||||
if ( $trackingPolicy != 'DEFERRED_IMPLICIT') {
|
||||
if ($trackingPolicy != 'DEFERRED_IMPLICIT') {
|
||||
$root->addChild('change-tracking-policy', $trackingPolicy);
|
||||
}
|
||||
|
||||
@ -144,7 +144,7 @@ class XmlExporter extends AbstractExporter
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $metadata->isIdentifierComposite && $idGeneratorType = $this->_getIdGeneratorTypeString($metadata->generatorType)) {
|
||||
if (!$metadata->isIdentifierComposite && $idGeneratorType = $this->_getIdGeneratorTypeString($metadata->generatorType)) {
|
||||
$id[$metadata->getSingleIdentifierFieldName()]['generator']['strategy'] = $idGeneratorType;
|
||||
}
|
||||
|
||||
@ -430,7 +430,7 @@ class XmlExporter extends AbstractExporter
|
||||
{
|
||||
$sequenceDefinition = $metadata->sequenceGeneratorDefinition;
|
||||
|
||||
if (! ($metadata->generatorType === ClassMetadataInfo::GENERATOR_TYPE_SEQUENCE && $sequenceDefinition)) {
|
||||
if (!($metadata->generatorType === ClassMetadataInfo::GENERATOR_TYPE_SEQUENCE && $sequenceDefinition)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user