Skip to content

Commit 2b40e89

Browse files
minor #42949 Remove needless TypeErrors (nicolas-grekas)
This PR was merged into the 6.0 branch. Discussion ---------- Remove needless TypeErrors | Q | A | ------------- | --- | Branch? | 6.0 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Commits ------- c7d479ea51 Remove needless TypeErrors
2 parents 2d6ab0f + 9289cec commit 2b40e89

File tree

2 files changed

+0
-6
lines changed

2 files changed

+0
-6
lines changed

HttpCache/HttpCache.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ public function __construct(KernelInterface $kernel, string|StoreInterface $cach
4545

4646
if ($cache instanceof StoreInterface) {
4747
$this->store = $cache;
48-
} elseif (null !== $cache && !\is_string($cache)) {
49-
throw new \TypeError(sprintf('Argument 2 passed to "%s()" must be a string or a SurrogateInterface, "%s" given.', __METHOD__, get_debug_type($cache)));
5048
} else {
5149
$this->cacheDir = $cache;
5250
}

Secrets/SodiumVault.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ class SodiumVault extends AbstractVault implements EnvVarLoaderInterface
3434
*/
3535
public function __construct(string $secretsDir, string|\Stringable $decryptionKey = null)
3636
{
37-
if (null !== $decryptionKey && !\is_string($decryptionKey) && !$decryptionKey instanceof \Stringable) {
38-
throw new \TypeError(sprintf('Decryption key should be a string or an object that implements the __toString() method, "%s" given.', get_debug_type($decryptionKey)));
39-
}
40-
4137
$this->pathPrefix = rtrim(strtr($secretsDir, '/', \DIRECTORY_SEPARATOR), \DIRECTORY_SEPARATOR).\DIRECTORY_SEPARATOR.basename($secretsDir).'.';
4238
$this->decryptionKey = $decryptionKey;
4339
$this->secretsDir = $secretsDir;

0 commit comments

Comments
 (0)