Skip to content

Commit ad2d30c

Browse files
committed
Fix CS and skip phpstan issues
1 parent 0376f22 commit ad2d30c

File tree

3 files changed

+51
-50
lines changed

3 files changed

+51
-50
lines changed

lib/Doctrine/ODM/MongoDB/Configuration.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,7 @@ public function setAutoEncryption(array $options): void
702702
throw new InvalidArgumentException('The "keyVaultNamespace" option is required.');
703703
}
704704

705+
// @todo Throw en exception if multiple KMS providers are defined. This is not supported yet and would require a setting for the KMS provider to use when creating a new collection
705706
if (! isset($options['kmsProviders']) || ! is_array($options['kmsProviders']) || count($options['kmsProviders']) < 1) {
706707
throw new InvalidArgumentException('The "kmsProviders" option is required.');
707708
}

phpstan-baseline.neon

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -948,14 +948,20 @@ parameters:
948948
count: 1
949949
path: lib/Doctrine/ODM/MongoDB/Mapping/Driver/AttributeReader.php
950950

951+
-
952+
message: '#^Match expression does not handle remaining value\: string$#'
953+
identifier: match.unhandled
954+
count: 1
955+
path: lib/Doctrine/ODM/MongoDB/Mapping/Driver/XmlDriver.php
956+
951957
-
952958
message: '#^Method Doctrine\\ODM\\MongoDB\\Mapping\\Driver\\XmlDriver\:\:getSearchIndexFieldDefinition\(\) return type has no value type specified in iterable type array\.$#'
953959
identifier: missingType.iterableValue
954960
count: 1
955961
path: lib/Doctrine/ODM/MongoDB/Mapping/Driver/XmlDriver.php
956962

957963
-
958-
message: '#^Parameter \#2 \$mapping of method Doctrine\\ODM\\MongoDB\\Mapping\\Driver\\XmlDriver\:\:addFieldMapping\(\) expects array\{type\?\: string, fieldName\?\: string, name\?\: string, strategy\?\: string, association\?\: int, id\?\: bool, isOwningSide\?\: bool, collectionClass\?\: class\-string, \.\.\.\}, array\<string, bool\|non\-empty\-list\<string\>\|string\> given\.$#'
964+
message: '#^Parameter \#2 \$mapping of method Doctrine\\ODM\\MongoDB\\Mapping\\Driver\\XmlDriver\:\:addFieldMapping\(\) expects array\{type\?\: string, fieldName\?\: string, name\?\: string, strategy\?\: string, association\?\: int, id\?\: bool, isOwningSide\?\: bool, collectionClass\?\: class\-string, \.\.\.\}, array\<string, array\<int\<0, max\>\|string, float\|int\|MongoDB\\BSON\\Decimal128\|MongoDB\\BSON\\UTCDateTime\|string\|null\>\|bool\|string\> given\.$#'
959965
identifier: argument.type
960966
count: 1
961967
path: lib/Doctrine/ODM/MongoDB/Mapping/Driver/XmlDriver.php
@@ -1476,6 +1482,18 @@ parameters:
14761482
count: 1
14771483
path: lib/Doctrine/ODM/MongoDB/UnitOfWork.php
14781484

1485+
-
1486+
message: '#^Method Doctrine\\ODM\\MongoDB\\Utility\\EncryptionFieldMap\:\:createEncryptionFieldMap\(\) has parameter \$classMetadata with generic class Doctrine\\ODM\\MongoDB\\Mapping\\ClassMetadata but does not specify its types\: T$#'
1487+
identifier: missingType.generics
1488+
count: 1
1489+
path: lib/Doctrine/ODM/MongoDB/Utility/EncryptionFieldMap.php
1490+
1491+
-
1492+
message: '#^Method Doctrine\\ODM\\MongoDB\\Utility\\EncryptionFieldMap\:\:getEncryptionFieldMap\(\) return type has no value type specified in iterable type array\.$#'
1493+
identifier: missingType.iterableValue
1494+
count: 1
1495+
path: lib/Doctrine/ODM/MongoDB/Utility/EncryptionFieldMap.php
1496+
14791497
-
14801498
message: '#^Unable to resolve the template type T in call to method Doctrine\\ODM\\MongoDB\\DocumentManager\:\:getClassMetadata\(\)$#'
14811499
identifier: argument.templateType
@@ -1536,12 +1554,6 @@ parameters:
15361554
count: 1
15371555
path: tests/Doctrine/ODM/MongoDB/Tests/Aggregation/Stage/SetWindowFieldsTest.php
15381556

1539-
-
1540-
message: '#^Constant DOCTRINE_MONGODB_DATABASE not found\.$#'
1541-
identifier: constant.notFound
1542-
count: 5
1543-
path: tests/Doctrine/ODM/MongoDB/Tests/BaseTestCase.php
1544-
15451557
-
15461558
message: '#^Constant DOCTRINE_MONGODB_SERVER not found\.$#'
15471559
identifier: constant.notFound
@@ -1560,12 +1572,6 @@ parameters:
15601572
count: 1
15611573
path: tests/Doctrine/ODM/MongoDB/Tests/BaseTestCase.php
15621574

1563-
-
1564-
message: '#^Used constant DOCTRINE_MONGODB_DATABASE not found\.$#'
1565-
identifier: constant.notFound
1566-
count: 1
1567-
path: tests/Doctrine/ODM/MongoDB/Tests/BaseTestCase.php
1568-
15691575
-
15701576
message: '#^Used constant DOCTRINE_MONGODB_SERVER not found\.$#'
15711577
identifier: constant.notFound
@@ -1578,24 +1584,12 @@ parameters:
15781584
count: 1
15791585
path: tests/Doctrine/ODM/MongoDB/Tests/DocumentManagerTest.php
15801586

1581-
-
1582-
message: '#^Constant DOCTRINE_MONGODB_DATABASE not found\.$#'
1583-
identifier: constant.notFound
1584-
count: 1
1585-
path: tests/Doctrine/ODM/MongoDB/Tests/DocumentRepositoryTest.php
1586-
15871587
-
15881588
message: '#^Parameter \#2 \$projects of class Documents\\Developer constructor expects Doctrine\\Common\\Collections\\Collection\<int, Documents\\Project\>\|null, Doctrine\\Common\\Collections\\ArrayCollection\<int, Documents\\SubProject\> given\.$#'
15891589
identifier: argument.type
15901590
count: 1
15911591
path: tests/Doctrine/ODM/MongoDB/Tests/DocumentRepositoryTest.php
15921592

1593-
-
1594-
message: '#^Used constant DOCTRINE_MONGODB_DATABASE not found\.$#'
1595-
identifier: constant.notFound
1596-
count: 1
1597-
path: tests/Doctrine/ODM/MongoDB/Tests/DocumentRepositoryTest.php
1598-
15991593
-
16001594
message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Functional\\CustomDatabaseTest\:\:\$id is unused\.$#'
16011595
identifier: property.unused
@@ -1668,6 +1662,30 @@ parameters:
16681662
count: 1
16691663
path: tests/Doctrine/ODM/MongoDB/Tests/Functional/NestedDocumentsTest.php
16701664

1665+
-
1666+
message: '#^Access to an undefined property MongoDB\\Model\\BSONDocument\:\:\$patientId\.$#'
1667+
identifier: property.notFound
1668+
count: 1
1669+
path: tests/Doctrine/ODM/MongoDB/Tests/Functional/QueryableEncryptionTest.php
1670+
1671+
-
1672+
message: '#^Access to an undefined property MongoDB\\Model\\BSONDocument\:\:\$patientName\.$#'
1673+
identifier: property.notFound
1674+
count: 1
1675+
path: tests/Doctrine/ODM/MongoDB/Tests/Functional/QueryableEncryptionTest.php
1676+
1677+
-
1678+
message: '#^Access to an undefined property MongoDB\\Model\\BSONDocument\:\:\$patientRecord\.$#'
1679+
identifier: property.notFound
1680+
count: 3
1681+
path: tests/Doctrine/ODM/MongoDB/Tests/Functional/QueryableEncryptionTest.php
1682+
1683+
-
1684+
message: '#^Parameter \#1 \$options of method Doctrine\\ODM\\MongoDB\\Configuration\:\:setAutoEncryption\(\) expects array\{keyVaultNamespace\: string, kmsProviders\: array\<string, array\<string, string\>\>, tlsOptions\?\: array\{kmip\: array\{tlsCAFile\: string, tlsCertificateKeyFile\: string\}\}\}, array\{keyVaultNamespace\: non\-falsy\-string, kmsProviders\: array\{local\: array\{key\: MongoDB\\BSON\\Binary\}\}\} given\.$#'
1685+
identifier: argument.type
1686+
count: 1
1687+
path: tests/Doctrine/ODM/MongoDB/Tests/Functional/QueryableEncryptionTest.php
1688+
16711689
-
16721690
message: '#^Parameter \$discriminatorMap of attribute class Doctrine\\ODM\\MongoDB\\Mapping\\Annotations\\ReferenceOne constructor expects array\<string, class\-string\>\|null, array\<string, string\> given\.$#'
16731691
identifier: argument.type
@@ -1740,18 +1758,6 @@ parameters:
17401758
count: 1
17411759
path: tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/MODM116Test.php
17421760

1743-
-
1744-
message: '#^Constant DOCTRINE_MONGODB_DATABASE not found\.$#'
1745-
identifier: constant.notFound
1746-
count: 2
1747-
path: tests/Doctrine/ODM/MongoDB/Tests/Id/IncrementGeneratorTest.php
1748-
1749-
-
1750-
message: '#^Used constant DOCTRINE_MONGODB_DATABASE not found\.$#'
1751-
identifier: constant.notFound
1752-
count: 1
1753-
path: tests/Doctrine/ODM/MongoDB/Tests/Id/IncrementGeneratorTest.php
1754-
17551761
-
17561762
message: '#^Property Doctrine\\ODM\\MongoDB\\Tests\\Mapping\\AnnotationDriverTestSuper\:\:\$private is unused\.$#'
17571763
identifier: property.unused
@@ -1920,12 +1926,6 @@ parameters:
19201926
count: 1
19211927
path: tests/Doctrine/ODM/MongoDB/Tests/Query/BuilderTest.php
19221928

1923-
-
1924-
message: '#^Constant DOCTRINE_MONGODB_DATABASE not found\.$#'
1925-
identifier: constant.notFound
1926-
count: 2
1927-
path: tests/Doctrine/ODM/MongoDB/Tests/QueryTest.php
1928-
19291929
-
19301930
message: '#^Method Doctrine\\ODM\\MongoDB\\Tests\\QueryTest\:\:createCursorMock\(\) return type has no value type specified in iterable type Traversable\.$#'
19311931
identifier: missingType.iterableValue
@@ -1938,12 +1938,6 @@ parameters:
19381938
count: 1
19391939
path: tests/Doctrine/ODM/MongoDB/Tests/QueryTest.php
19401940

1941-
-
1942-
message: '#^Used constant DOCTRINE_MONGODB_DATABASE not found\.$#'
1943-
identifier: constant.notFound
1944-
count: 1
1945-
path: tests/Doctrine/ODM/MongoDB/Tests/QueryTest.php
1946-
19471941
-
19481942
message: '#^Instantiated class MongoDB\\Model\\CollectionInfoCommandIterator not found\.$#'
19491943
identifier: class.notFound
@@ -2082,6 +2076,12 @@ parameters:
20822076
count: 1
20832077
path: tests/Documents/Ecommerce/StockItem.php
20842078

2079+
-
2080+
message: '#^Method Documents\\Encryption\\Client\:\:__construct\(\) has parameter \$clientCards with generic interface Doctrine\\Common\\Collections\\Collection but does not specify its types\: TKey, T$#'
2081+
identifier: missingType.generics
2082+
count: 1
2083+
path: tests/Documents/Encryption/Client.php
2084+
20852085
-
20862086
message: '#^Property Documents\\Event\:\:\$id is never written, only read\.$#'
20872087
identifier: property.onlyRead

tests/Doctrine/ODM/MongoDB/Tests/Functional/QueryableEncryptionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
use Documents\Encryption\PatientRecord;
1212
use MongoDB\BSON\Binary;
1313
use MongoDB\Client;
14-
1514
use MongoDB\Model\BSONDocument;
15+
1616
use function iterator_to_array;
1717
use function random_bytes;
1818

0 commit comments

Comments
 (0)