From 3733aeb0ce49cbfe1af351a8f0cefb5bcdf1ad6c Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 1 Apr 2020 15:03:33 -0700 Subject: [PATCH] (REF) CRM_Api4_Services - Cleanup extra comment/try/catch --- CRM/Api4/Services.php | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/CRM/Api4/Services.php b/CRM/Api4/Services.php index fba89627dd..35c24449e0 100644 --- a/CRM/Api4/Services.php +++ b/CRM/Api4/Services.php @@ -84,10 +84,8 @@ class CRM_Api4_Services { if (!file_exists($path) || !is_dir($path)) { $resource = new \Symfony\Component\Config\Resource\FileExistenceResource($path); $container->addResource($resource); - continue; } - - try { + else { $resource = new \Symfony\Component\Config\Resource\DirectoryResource($path, ';\.php$;'); foreach (glob("$path*.php") as $file) { $matches = []; @@ -101,15 +99,6 @@ class CRM_Api4_Services { } $container->addResource($resource); } - catch (\InvalidArgumentException $e) { - //Directory is not found so lets not do anything i suppose. - - // FIXME: The above comment implies that the try/catch is specifically - // about the directory's existence, which would make it redundant with the - // newer "file_exists()" guard. However, the actual "catch()" seems broader, - // and I don't see anything in DirectoryResource that throws the exception. - // So... maybe it's not needed, or maybe there's some additional purpose. - } } } -- 2.25.1