Skip to content

Commit 3c098bf

Browse files
committed
Fix return covariance of Factory::invoke
1 parent 6b15c5d commit 3c098bf

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/Factory.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
use Nexus\CsConfig\Ruleset\RulesetInterface;
1717
use PhpCsFixer\Config;
18+
use PhpCsFixer\ConfigInterface;
1819
use PhpCsFixer\Finder;
1920

2021
/**
@@ -107,7 +108,7 @@ public static function create(RulesetInterface $ruleset, array $overrides = [],
107108
* @param string $email
108109
* @param null|int $startingYear
109110
*
110-
* @return \PhpCsFixer\Config
111+
* @return \PhpCsFixer\ConfigInterface
111112
*/
112113
public function forLibrary(string $library, string $author, string $email = '', ?int $startingYear = null)
113114
{
@@ -145,7 +146,12 @@ public function forLibrary(string $library, string $author, string $email = '',
145146
]);
146147
}
147148

148-
public function forProjects(): Config
149+
/**
150+
* Plain invocation of `Config` with no additional arguments.
151+
*
152+
* @return \PhpCsFixer\ConfigInterface
153+
*/
154+
public function forProjects()
149155
{
150156
return $this->invoke();
151157
}
@@ -155,11 +161,11 @@ public function forProjects(): Config
155161
*
156162
* @param array<string, array<string>|bool> $overrides
157163
*
158-
* @return \PhpCsFixer\Config
164+
* @return \PhpCsFixer\ConfigInterface
159165
*
160166
* @internal
161167
*/
162-
private function invoke(array $overrides = []): Config
168+
private function invoke(array $overrides = []): ConfigInterface
163169
{
164170
$rules = array_merge($this->options['rules'], $overrides);
165171

0 commit comments

Comments
 (0)