Skip to content

Commit bf00d72

Browse files
committed
Do not suggest installation of puli via composer or error messages
1 parent 788f72d commit bf00d72

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"puli/composer-plugin": "1.0.0-beta10"
2222
},
2323
"suggest": {
24-
"puli/composer-plugin": "Sets up Puli which is recommended for Discovery to work. Check http://docs.php-http.org/en/latest/discovery.html for more details.",
2524
"php-http/message": "Allow to use Guzzle, Diactoros or Slim Framework factories"
2625
},
2726
"autoload": {

src/ClassDiscovery.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ abstract class ClassDiscovery
2727
Strategy\CommonPsr17ClassesStrategy::class,
2828
];
2929

30+
private static $deprecatedStrategies = [
31+
Strategy\PuliBetaStrategy::class => true,
32+
];
33+
3034
/**
3135
* Discovery cache to make the second time we use discovery faster.
3236
*
@@ -54,8 +58,10 @@ protected static function findOneByType($type)
5458
foreach (self::$strategies as $strategy) {
5559
try {
5660
$candidates = call_user_func($strategy.'::getCandidates', $type);
57-
} catch (StrategyUnavailableException $e) {
58-
$exceptions[] = $e;
61+
} catch (StrategyUnavailableException $e) {
62+
if (!isset(self::$deprecatedStrategies[$strategy])) {
63+
$exceptions[] = $e;
64+
}
5965

6066
continue;
6167
}

tests/Exception/InitializeExceptionTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ public function testInitialize()
1111
{
1212
$e[] = new DiscoveryException\ClassInstantiationFailedException();
1313
$e[] = new DiscoveryException\NotFoundException();
14-
$e[] = new DiscoveryException\PuliUnavailableException();
1514
$e[] = new DiscoveryException\StrategyUnavailableException();
1615
$e[] = new DiscoveryException\NoCandidateFoundException('CommonClasses', []);
1716
$e[] = DiscoveryException\DiscoveryFailedException::create($e);

0 commit comments

Comments
 (0)