Skip to content

Commit 13e43e5

Browse files
committed
Some psalm checks
1 parent bc5e042 commit 13e43e5

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

src/Drivers/LocalLanguageRecognizerDriver.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class LocalLanguageRecognizerDriver implements LanguageRecognizer
1717
*
1818
* @var string
1919
*/
20-
protected $binaryPath = null;
20+
protected $binaryPath;
2121

2222
public function __construct($config)
2323
{
@@ -29,18 +29,15 @@ public function __construct($config)
2929
}
3030

3131
/**
32-
* @return false|string
32+
*
33+
* @param string $configuredPath
34+
* @return string
35+
* @throws \InvalidArgumentException
3336
*/
3437
protected function obtainBinaryPath($configuredPath)
3538
{
3639
$basePath = Str::startsWith($configuredPath, '.') ? base_path($configuredPath) : $configuredPath;
3740

38-
// $basePath = realpath($resolvedPath);
39-
40-
// if($basePath === false){
41-
// throw new InvalidArgumentException("Specified path [{$resolvedPath}] cannot be resolved to a valid, existing path.");
42-
// }
43-
4441
$suffixes = [
4542
'',
4643
'.exe',
@@ -76,6 +73,10 @@ public function recognize($text, $limit = 2): array
7673
})->toArray();
7774
}
7875

76+
/**
77+
* @param string $text
78+
* @return string
79+
*/
7980
private function run($text): string
8081
{
8182
$options = [$this->binaryPath, '--all'];

src/LaravelLanguageRecognizer.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ public function driver($driver = null)
2828

2929
/**
3030
* @return \Oneofftech\LaravelLanguageRecognizer\Drivers\LocalLanguageRecognizerDriver
31+
*
32+
* @psalm-suppress UndefinedInterfaceMethod
3133
*/
3234
protected function createLocalDriver()
3335
{
@@ -38,6 +40,8 @@ protected function createLocalDriver()
3840
* Get the default driver name.
3941
*
4042
* @return string
43+
*
44+
* @psalm-suppress UndefinedInterfaceMethod
4145
*/
4246
public function getDefaultDriver()
4347
{

0 commit comments

Comments
 (0)