[Chore] Introduce psalm (#962)

* chore: introduce psalm

* chore: remove dead code

* chore: run psalm workflow

* chore: run psalm in grumphp

* normalize composer.json

* chore: analyse --> analyze

* chore: just remove psalm when running tests instead of worrying about dependency mismatch hell

Co-authored-by: mr-feek <[email protected]>
This commit is contained in:
feek
2020-06-22 20:28:59 +02:00
committed by GitHub
co-authored by mr-feek
parent 3381123e71
commit 545298c44d
9 changed files with 68 additions and 34 deletions
+2
View File
@@ -21,6 +21,7 @@ use Barryvdh\Reflection\DocBlock\Serializer as DocBlockSerializer;
class Alias
{
protected $alias;
/** @psalm-var class-string $facade */
protected $facade;
protected $extends = null;
protected $extendsClass = null;
@@ -43,6 +44,7 @@ class Alias
/**
* @param ConfigRepository $config
* @param string $alias
* @psalm-param class-string $facade
* @param string $facade
* @param array $magicMethods
* @param array $interfaces
+2 -2
View File
@@ -43,7 +43,7 @@ class MetaCommand extends Command
/** @var \Illuminate\Contracts\View\Factory */
protected $view;
/** @var \Illuminate\Contracts\Config */
/** @var \Illuminate\Contracts\Config\Repository */
protected $config;
protected $methods = [
@@ -61,7 +61,7 @@ class MetaCommand extends Command
*
* @param \Illuminate\Contracts\Filesystem\Filesystem $files
* @param \Illuminate\Contracts\View\Factory $view
* @param \Illuminate\Contracts\Config $config
* @param \Illuminate\Contracts\Config\Repository $config
*/
public function __construct($files, $view, $config)
{
-30
View File
@@ -283,36 +283,6 @@ class Generator
);
}
/**
* Get the driver/connection/store from the managers
*
* @param $alias
* @return array|bool|string
*/
public function getDriver($alias)
{
try {
if ($alias == "Auth") {
$driver = \Auth::driver();
} elseif ($alias == "DB") {
$driver = \DB::connection();
} elseif ($alias == "Cache") {
$driver = get_class(\Cache::driver());
$store = get_class(\Cache::getStore());
return array($driver, $store);
} elseif ($alias == "Queue") {
$driver = \Queue::connection();
} else {
return false;
}
return get_class($driver);
} catch (\Exception $e) {
$this->error("Could not determine driver/connection for $alias.");
return false;
}
}
/**
* Write a string as error output.
*