Skip to content

Commit fef5eb4

Browse files
committed
Move exception into method
1 parent 9882ca3 commit fef5eb4

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/Services/MaxMindDatabase.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,6 @@ public function update()
7676

7777
$file = $this->findDatabaseFile($archive);
7878

79-
if (is_null($file)) {
80-
throw new Exception('Database file could not be found within archive.');
81-
}
82-
8379
$relativePath = "{$archive->getFilename()}/{$file->getFilename()}";
8480

8581
$archive->extractTo($directory, $relativePath);
@@ -119,6 +115,7 @@ protected function withTemporaryDirectory(callable $callback)
119115
*
120116
* @param \PharData $archive
121117
* @return mixed
118+
* @throws \Exception
122119
*/
123120
protected function findDatabaseFile($archive)
124121
{
@@ -132,7 +129,7 @@ protected function findDatabaseFile($archive)
132129
}
133130
}
134131

135-
return null;
132+
throw new Exception('Database file could not be found within archive.');
136133
}
137134

138135
/**

0 commit comments

Comments
 (0)