1 | <?php |
||
28 | class ConnectionFactory |
||
29 | { |
||
30 | private $typesConfig = array(); |
||
31 | private $commentedTypes = array(); |
||
32 | private $initialized = false; |
||
33 | |||
34 | /** |
||
35 | * Construct. |
||
36 | * |
||
37 | * @param array $typesConfig |
||
38 | */ |
||
39 | public function __construct(array $typesConfig) |
||
43 | |||
44 | /** |
||
45 | * Create a connection by name. |
||
46 | * |
||
47 | * @param array $params |
||
48 | * @param Configuration $config |
||
|
|||
49 | * @param EventManager $eventManager |
||
50 | * @param array $mappingTypes |
||
51 | * |
||
52 | * @return \Doctrine\DBAL\Connection |
||
53 | */ |
||
54 | public function createConnection(array $params, Configuration $config = null, EventManager $eventManager = null, array $mappingTypes = array()) |
||
77 | |||
78 | /** |
||
79 | * Try to get the database platform. |
||
80 | * |
||
81 | * This could fail if types should be registered to an predefined/unused connection |
||
82 | * and the platform version is unknown. |
||
83 | * For details have a look at DoctrineBundle issue #673. |
||
84 | * |
||
85 | * @param \Doctrine\DBAL\Connection $connection |
||
86 | * |
||
87 | * @return \Doctrine\DBAL\Platforms\AbstractPlatform |
||
88 | * @throws \Doctrine\DBAL\DBALException |
||
89 | */ |
||
90 | private function getDatabasePlatform(Connection $connection) |
||
105 | |||
106 | /** |
||
107 | * initialize the types |
||
108 | */ |
||
109 | private function initializeTypes() |
||
123 | } |
||
124 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.