Skip to content

Commit

Permalink
Add some more return types
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Feb 22, 2022
1 parent 6da38f8 commit 225b4d7
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Composer/DependencyResolver/GenericRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function isAssertion(): bool
*
* @return string
*/
public function __toString()
public function __toString(): string
{
$result = $this->isDisabled() ? 'disabled(' : '(';

Expand Down
2 changes: 1 addition & 1 deletion src/Composer/DependencyResolver/MultiConflictRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function disable(): void
*
* @return string
*/
public function __toString()
public function __toString(): string
{
// TODO multi conflict?
$result = $this->isDisabled() ? 'disabled(multi(' : '(multi(';
Expand Down
2 changes: 1 addition & 1 deletion src/Composer/DependencyResolver/Rule2Literals.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function isAssertion(): bool
*
* @return string
*/
public function __toString()
public function __toString(): string
{
$result = $this->isDisabled() ? 'disabled(' : '(';

Expand Down
2 changes: 1 addition & 1 deletion src/Composer/Package/Link.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public function getPrettyConstraint(): string
/**
* @return string
*/
public function __toString()
public function __toString(): string
{
return $this->source.' '.$this->description.' '.$this->target.' ('.$this->constraint.')';
}
Expand Down
4 changes: 2 additions & 2 deletions src/Composer/Repository/PlatformRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,8 @@ protected function initialize(): void
}

// ICU TZData version => 2019c
if (Preg::isMatch('/^ICU TZData version => (?<version>.*)$/im', $info, $zoneinfoMatches)) {
$this->addLibrary('icu-zoneinfo', Version::parseZoneinfoVersion($zoneinfoMatches['version']), 'zoneinfo ("Olson") database for icu');
if (Preg::isMatch('/^ICU TZData version => (?<version>.*)$/im', $info, $zoneinfoMatches) && null !== ($version = Version::parseZoneinfoVersion($zoneinfoMatches['version']))) {
$this->addLibrary('icu-zoneinfo', $version, 'zoneinfo ("Olson") database for icu');
}

// Add a separate version for the CLDR library version
Expand Down

0 comments on commit 225b4d7

Please sign in to comment.