#5796 minor CS fixes (imported symbols) and removing last PHP5 compliance bits
This commit is contained in:
parent
a1c93bfd48
commit
12043cd845
@ -27,6 +27,7 @@ use Doctrine\ORM\Query\ResultSetMapping;
|
|||||||
use Doctrine\ORM\Proxy\ProxyFactory;
|
use Doctrine\ORM\Proxy\ProxyFactory;
|
||||||
use Doctrine\ORM\Query\FilterCollection;
|
use Doctrine\ORM\Query\FilterCollection;
|
||||||
use Doctrine\Common\Util\ClassUtils;
|
use Doctrine\Common\Util\ClassUtils;
|
||||||
|
use Throwable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The EntityManager is the central access point to ORM functionality.
|
* The EntityManager is the central access point to ORM functionality.
|
||||||
@ -236,7 +237,7 @@ use Doctrine\Common\Util\ClassUtils;
|
|||||||
$this->conn->commit();
|
$this->conn->commit();
|
||||||
|
|
||||||
return $return ?: true;
|
return $return ?: true;
|
||||||
} catch (\Throwable $e) {
|
} catch (Throwable $e) {
|
||||||
$this->close();
|
$this->close();
|
||||||
$this->conn->rollBack();
|
$this->conn->rollBack();
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ use Doctrine\DBAL\Connection;
|
|||||||
use Doctrine\DBAL\Types\Type;
|
use Doctrine\DBAL\Types\Type;
|
||||||
use Doctrine\ORM\Query\AST;
|
use Doctrine\ORM\Query\AST;
|
||||||
use Doctrine\ORM\Utility\PersisterHelper;
|
use Doctrine\ORM\Utility\PersisterHelper;
|
||||||
|
use Throwable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Executes the SQL statements for bulk DQL DELETE statements on classes in
|
* Executes the SQL statements for bulk DQL DELETE statements on classes in
|
||||||
@ -129,7 +130,7 @@ class MultiTableDeleteExecutor extends AbstractSqlExecutor
|
|||||||
foreach ($this->_sqlStatements as $sql) {
|
foreach ($this->_sqlStatements as $sql) {
|
||||||
$conn->executeUpdate($sql);
|
$conn->executeUpdate($sql);
|
||||||
}
|
}
|
||||||
} catch (\Throwable $exception) {
|
} catch (Throwable $exception) {
|
||||||
// FAILURE! Drop temporary table to avoid possible collisions
|
// FAILURE! Drop temporary table to avoid possible collisions
|
||||||
$conn->executeUpdate($this->_dropTempTableSql);
|
$conn->executeUpdate($this->_dropTempTableSql);
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ use Doctrine\DBAL\Types\Type;
|
|||||||
use Doctrine\ORM\Query\ParameterTypeInferer;
|
use Doctrine\ORM\Query\ParameterTypeInferer;
|
||||||
use Doctrine\ORM\Query\AST;
|
use Doctrine\ORM\Query\AST;
|
||||||
use Doctrine\ORM\Utility\PersisterHelper;
|
use Doctrine\ORM\Utility\PersisterHelper;
|
||||||
|
use Throwable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Executes the SQL statements for bulk DQL UPDATE statements on classes in
|
* Executes the SQL statements for bulk DQL UPDATE statements on classes in
|
||||||
@ -188,7 +189,7 @@ class MultiTableUpdateExecutor extends AbstractSqlExecutor
|
|||||||
|
|
||||||
$conn->executeUpdate($statement, $paramValues, $paramTypes);
|
$conn->executeUpdate($statement, $paramValues, $paramTypes);
|
||||||
}
|
}
|
||||||
} catch (\Throwable $exception) {
|
} catch (Throwable $exception) {
|
||||||
// FAILURE! Drop temporary table to avoid possible collisions
|
// FAILURE! Drop temporary table to avoid possible collisions
|
||||||
$conn->executeUpdate($this->_dropTempTableSql);
|
$conn->executeUpdate($this->_dropTempTableSql);
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ use Symfony\Component\Console\Command\Command;
|
|||||||
use Symfony\Component\Console\Input\InputOption;
|
use Symfony\Component\Console\Input\InputOption;
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
|
use Throwable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Command to ensure that Doctrine is properly configured for a production environment.
|
* Command to ensure that Doctrine is properly configured for a production environment.
|
||||||
@ -72,7 +73,7 @@ EOT
|
|||||||
if ($input->getOption('complete') !== null) {
|
if ($input->getOption('complete') !== null) {
|
||||||
$em->getConnection()->connect();
|
$em->getConnection()->connect();
|
||||||
}
|
}
|
||||||
} catch (\Throwable $e) {
|
} catch (Throwable $e) {
|
||||||
$output->writeln('<error>' . $e->getMessage() . '</error>');
|
$output->writeln('<error>' . $e->getMessage() . '</error>');
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -94,8 +94,6 @@ class SchemaTool
|
|||||||
$conn->executeQuery($sql);
|
$conn->executeQuery($sql);
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
throw ToolsException::schemaToolFailure($sql, $e);
|
throw ToolsException::schemaToolFailure($sql, $e);
|
||||||
} catch (\Exception $e) { // PHP 5
|
|
||||||
throw ToolsException::schemaToolFailure($sql, $e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
namespace Doctrine\ORM\Tools;
|
namespace Doctrine\ORM\Tools;
|
||||||
|
|
||||||
use Doctrine\ORM\ORMException;
|
use Doctrine\ORM\ORMException;
|
||||||
|
use Throwable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tools related Exceptions.
|
* Tools related Exceptions.
|
||||||
@ -28,13 +29,7 @@ use Doctrine\ORM\ORMException;
|
|||||||
*/
|
*/
|
||||||
class ToolsException extends ORMException
|
class ToolsException extends ORMException
|
||||||
{
|
{
|
||||||
/**
|
public static function schemaToolFailure(string $sql, Throwable $e) : self
|
||||||
* @param string $sql
|
|
||||||
* @param \Exception $e The original exception, or duck-typed Throwable in PHP 7.
|
|
||||||
*
|
|
||||||
* @return ToolsException
|
|
||||||
*/
|
|
||||||
public static function schemaToolFailure($sql, $e)
|
|
||||||
{
|
{
|
||||||
return new self("Schema-Tool failed with Error '" . $e->getMessage() . "' while executing DDL: " . $sql, "0", $e);
|
return new self("Schema-Tool failed with Error '" . $e->getMessage() . "' while executing DDL: " . $sql, "0", $e);
|
||||||
}
|
}
|
||||||
|
@ -44,6 +44,7 @@ use Doctrine\ORM\Persisters\Entity\SingleTablePersister;
|
|||||||
use Doctrine\ORM\Proxy\Proxy;
|
use Doctrine\ORM\Proxy\Proxy;
|
||||||
use Doctrine\ORM\Utility\IdentifierFlattener;
|
use Doctrine\ORM\Utility\IdentifierFlattener;
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
|
use Throwable;
|
||||||
use UnexpectedValueException;
|
use UnexpectedValueException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -410,7 +411,7 @@ class UnitOfWork implements PropertyChangedListener
|
|||||||
}
|
}
|
||||||
|
|
||||||
$conn->commit();
|
$conn->commit();
|
||||||
} catch (\Throwable $e) {
|
} catch (Throwable $e) {
|
||||||
$this->em->close();
|
$this->em->close();
|
||||||
$conn->rollBack();
|
$conn->rollBack();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user