1
0
Fork 0

Fix type error in ArchiverInterface::supports(), fixes #10702

pull/10718/head
Jordi Boggiano 2022-04-06 22:23:47 +02:00
parent e0cce2bfb0
commit eb36025d37
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
3 changed files with 4 additions and 4 deletions

View File

@ -36,9 +36,9 @@ interface ArchiverInterface
* Format supported by the archiver. * Format supported by the archiver.
* *
* @param string $format The archive format * @param string $format The archive format
* @param string $sourceType The source type (git, svn, hg, etc.) * @param ?string $sourceType The source type (git, svn, hg, etc.)
* *
* @return bool true if the format is supported by the archiver * @return bool true if the format is supported by the archiver
*/ */
public function supports(string $format, string $sourceType): bool; public function supports(string $format, ?string $sourceType): bool;
} }

View File

@ -97,7 +97,7 @@ class PharArchiver implements ArchiverInterface
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function supports(string $format, string $sourceType): bool public function supports(string $format, ?string $sourceType): bool
{ {
return isset(static::$formats[$format]); return isset(static::$formats[$format]);
} }

View File

@ -78,7 +78,7 @@ class ZipArchiver implements ArchiverInterface
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function supports(string $format, string $sourceType): bool public function supports(string $format, ?string $sourceType): bool
{ {
return isset(static::$formats[$format]) && $this->compressionAvailable(); return isset(static::$formats[$format]) && $this->compressionAvailable();
} }