Skip to content

Commit ea77dfb

Browse files
committed
Fix type issue
PharData has PharData<PharFileInfo> "signature"
1 parent dfdcdae commit ea77dfb

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/Services/MaxMindDatabase.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function update()
7474
throw new \Exception('Database path not set in config file.');
7575
}
7676

77-
$this->withTemporaryDirectory(function ($directory) {
77+
$this->withTemporaryDirectory(function ($directory): void {
7878
$tarFile = sprintf('%s/maxmind.tar.gz', $directory);
7979

8080
file_put_contents($tarFile, fopen($this->config('update_url'), 'rb'));
@@ -97,7 +97,7 @@ public function update()
9797
* Provide a temporary directory to perform operations in
9898
* and ensure it is removed afterward.
9999
*
100-
* @param callable $callback
100+
* @param callable(string):void $callback
101101
*
102102
* @return void
103103
*/
@@ -125,17 +125,18 @@ protected function withTemporaryDirectory(callable $callback)
125125
*
126126
* @param \PharData $archive
127127
*
128-
* @return mixed
128+
* @return \PharFileInfo
129129
* @throws \Exception
130130
*/
131-
protected function findDatabaseFile($archive)
131+
protected function findDatabaseFile(\PharData $archive)
132132
{
133+
/** @var \PharFileInfo $file */
133134
foreach ($archive as $file) {
134135
if ($file->isDir()) {
135136
return $this->findDatabaseFile(new \PharData($file->getPathName()));
136137
}
137138

138-
if (pathinfo($file, \PATHINFO_EXTENSION) === 'mmdb') {
139+
if (pathinfo($file->getPathName(), \PATHINFO_EXTENSION) === 'mmdb') {
139140
return $file;
140141
}
141142
}

0 commit comments

Comments
 (0)