Skip to content

Commit ca1038e

Browse files
committed
Revert "A failure in parsing an FQSEN causes the whole project to crash"
This reverts commit 9b9aa61.
1 parent 9b9aa61 commit ca1038e

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

src/phpDocumentor/Reflection/Php/ProjectFactory.php

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,9 @@ public function create($name, array $files): ProjectInterface
7474
$project = new Project($name);
7575

7676
foreach ($files as $filePath) {
77-
try {
78-
$strategy = $this->strategies->findMatching($filePath);
79-
$file = $strategy->create($filePath, $this->strategies);
80-
$project->addFile($file);
81-
} catch (\Exception $exception) {
82-
// TODO: Add logging
83-
// For now; silently ignore when there is an issue with a file so that
84-
// parsing continues for other files and this is not a showstopper.
85-
// The class responsible for failing also emits a log, so it should
86-
// not go unnoticed
87-
}
77+
$strategy = $this->strategies->findMatching($filePath);
78+
$file = $strategy->create($filePath, $this->strategies);
79+
$project->addFile($file);
8880
}
8981

9082
$this->buildNamespaces($project);

tests/unit/phpDocumentor/Reflection/Php/ProjectFactoryTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ public function testCreate()
6868
$this->assertEquals($files, $projectFilePaths);
6969
}
7070

71-
public function testSilentlyFailsWhenStrategyNotFound()
71+
/**
72+
* @expectedException \OutOfBoundsException
73+
*/
74+
public function testCreateThrowsExceptionWhenStrategyNotFound()
7275
{
7376
$projectFactory = new ProjectFactory([]);
7477
$projectFactory->create('MyProject', ['aa']);

0 commit comments

Comments
 (0)