diff --git a/src/Propel/Generator/Builder/Util/SchemaReader.php b/src/Propel/Generator/Builder/Util/SchemaReader.php index 2a05686cdb..e446a8a0cc 100644 --- a/src/Propel/Generator/Builder/Util/SchemaReader.php +++ b/src/Propel/Generator/Builder/Util/SchemaReader.php @@ -151,7 +151,7 @@ public function startElement($parser, $name, $attributes) switch ($name) { case 'database': if ($this->isExternalSchema()) { - $this->currentPackage = @$attributes['package']; + $this->currentPackage = isset($attributes['package']) ? $attributes['package'] : null; if (null === $this->currentPackage) { $this->currentPackage = $this->defaultPackage; } @@ -166,16 +166,16 @@ public function startElement($parser, $name, $attributes) } elseif ('database' === $parentTag) { switch ($name) { case 'external-schema': - $xmlFile = @$attributes['filename']; + $xmlFile = isset($attributes['filename']) ? $attributes['filename'] : null; // 'referenceOnly' attribute is valid in the main schema XML file only, // and it's ignored in the nested external-schemas if (!$this->isExternalSchema()) { - $isForRefOnly = @$attributes['referenceOnly']; + $isForRefOnly = isset($attributes['referenceOnly']) ? $attributes['referenceOnly'] : null; $this->isForReferenceOnly = (null !== $isForRefOnly ? ('true' === strtolower($isForRefOnly)) : true); // defaults to TRUE } - if ($xmlFile{0} !== '/') { + if ('/' !== $xmlFile{0}) { $xmlFile = realpath(dirname($this->currentXmlFile) . DIRECTORY_SEPARATOR . $xmlFile); if (!file_exists($xmlFile)) { throw new SchemaException(sprintf('Unknown include external "%s"', $xmlFile)); diff --git a/src/Propel/Generator/Util/QuickBuilder.php b/src/Propel/Generator/Util/QuickBuilder.php index cb537c04ad..5bd3c317b3 100644 --- a/src/Propel/Generator/Util/QuickBuilder.php +++ b/src/Propel/Generator/Util/QuickBuilder.php @@ -21,8 +21,6 @@ use Propel\Runtime\Connection\ConnectionWrapper; use Propel\Runtime\Connection\StatementInterface; -use \PDO; - class QuickBuilder { protected $schema, $platform, $config, $database; @@ -103,7 +101,7 @@ public function build($dsn = null, $user = null, $pass = null, $adapter = null, } $pdo = new PdoConnection($dsn, $user, $pass); $con = new ConnectionWrapper($pdo); - $con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING); + $con->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_WARNING); $this->buildSQL($con); $this->buildClasses($classTargets); $name = $this->getDatabase()->getName();