-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Address doctrine/persistence 3.3.3 release
FileDriver became templatable, and some very wrong phpdoc has been fixed, causing Psalm to better understand the 2 FileDriver classes in this project.
- Loading branch information
Showing
3 changed files
with
6 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,8 @@ | |
* XmlDriver is a metadata driver that enables mapping through XML files. | ||
* | ||
* @link www.doctrine-project.org | ||
* | ||
* @template-extends FileDriver<SimpleXMLElement> | ||
*/ | ||
class XmlDriver extends FileDriver | ||
Check failure on line 43 in src/Mapping/Driver/XmlDriver.php GitHub Actions / Static Analysis with PHPStan (default, 2.5)
|
||
{ | ||
|
@@ -79,7 +81,6 @@ public function __construct($locator, $fileExtension = self::DEFAULT_FILE_EXTENS | |
public function loadMetadataForClass($className, PersistenceClassMetadata $metadata) | ||
{ | ||
$xmlRoot = $this->getElement($className); | ||
assert($xmlRoot instanceof SimpleXMLElement); | ||
|
||
if ($xmlRoot->getName() === 'entity') { | ||
if (isset($xmlRoot['repository-class'])) { | ||
|
@@ -203,6 +204,7 @@ public function loadMetadataForClass($className, PersistenceClassMetadata $metad | |
]; | ||
|
||
if (isset($discrColumn['options'])) { | ||
assert($discrColumn['options'] instanceof SimpleXMLElement); | ||
$columnDef['options'] = $this->parseOptions($discrColumn['options']->children()); | ||
} | ||
|
||
|
@@ -214,6 +216,7 @@ public function loadMetadataForClass($className, PersistenceClassMetadata $metad | |
// Evaluate <discriminator-map...> | ||
if (isset($xmlRoot->{'discriminator-map'})) { | ||
$map = []; | ||
assert($xmlRoot->{'discriminator-map'}->{'discriminator-mapping'} instanceof SimpleXMLElement); | ||
foreach ($xmlRoot->{'discriminator-map'}->{'discriminator-mapping'} as $discrMapElement) { | ||
$map[(string) $discrMapElement['value']] = (string) $discrMapElement['class']; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,8 @@ | |
* The YamlDriver reads the mapping metadata from yaml schema files. | ||
* | ||
* @deprecated 2.7 This class is being removed from the ORM and won't have any replacement | ||
* | ||
* @template-extends FileDriver<array<string, mixed>> | ||
*/ | ||
class YamlDriver extends FileDriver | ||
Check failure on line 37 in src/Mapping/Driver/YamlDriver.php GitHub Actions / Static Analysis with PHPStan (default, 2.5)
|
||
{ | ||
|