1 | <?php |
||
27 | class ConnectionFactory |
||
28 | { |
||
29 | private $typesConfig = array(); |
||
30 | private $commentedTypes = array(); |
||
31 | private $initialized = false; |
||
32 | |||
33 | /** |
||
34 | * Construct. |
||
35 | * |
||
36 | * @param array $typesConfig |
||
37 | */ |
||
38 | public function __construct(array $typesConfig) |
||
42 | |||
43 | /** |
||
44 | * Create a connection by name. |
||
45 | * |
||
46 | * @param array $params |
||
47 | * @param Configuration $config |
||
|
|||
48 | * @param EventManager $eventManager |
||
49 | * @param array $mappingTypes |
||
50 | * |
||
51 | * @return \Doctrine\DBAL\Connection |
||
52 | */ |
||
53 | public function createConnection(array $params, Configuration $config = null, EventManager $eventManager = null, array $mappingTypes = array()) |
||
76 | |||
77 | /** |
||
78 | * Try to get the database platform. |
||
79 | * |
||
80 | * This could fail if types should be registered to an predefined/unused connection |
||
81 | * and the platform version is unknown. |
||
82 | * For details have a look at DoctrineBundle issue #673. |
||
83 | * |
||
84 | * @param \Doctrine\DBAL\Connection $connection |
||
85 | * |
||
86 | * @return \Doctrine\DBAL\Platforms\AbstractPlatform |
||
87 | * @throws \Doctrine\DBAL\Exception\DriverException |
||
88 | */ |
||
89 | private function getDatabasePlatform(Connection $connection) |
||
104 | |||
105 | /** |
||
106 | * initialize the types |
||
107 | */ |
||
108 | private function initializeTypes() |
||
122 | } |
||
123 |
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.