From 229690c1027c66a98cbc2c9e10e0a273e6811e44 Mon Sep 17 00:00:00 2001 From: "Nathanael d. Noblet" Date: Wed, 29 Jul 2015 14:54:05 -0600 Subject: [PATCH] Simplify getNewInstance No need to call a getClassName when we've already done it and stored it as a class variable --- src/Writer/DoctrineWriter.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Writer/DoctrineWriter.php b/src/Writer/DoctrineWriter.php index fca7cc38..a56d0248 100644 --- a/src/Writer/DoctrineWriter.php +++ b/src/Writer/DoctrineWriter.php @@ -135,13 +135,11 @@ public function prepare() */ protected function getNewInstance() { - $className = $this->entityMetadata->getName(); - - if (class_exists($className) === false) { - throw new \Exception('Unable to create new instance of ' . $className); + if (class_exists($this->entityName) === false) { + throw new \Exception('Unable to create new instance of ' . $this->entityName); } - return new $className; + return new $this->entityName; } /**