for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace msztorc\LaravelEnv\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Str;
use msztorc\LaravelEnv\Commands\Traits\CommandValidator;
use msztorc\LaravelEnv\Env;
class EnvListCommand extends Command
{
use CommandValidator;
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'env:list {key?} {--json}';
* The console command description.
protected $description = 'List all variables from an environment file';
* json format argument
* @var bool
protected $json;
* Env object
* @var object
protected $env;
* Create a new command instance.
* @return void
public function __construct()
parent::__construct();
}
* Execute the console command.
* @return mixed
public function handle()
$this->json = (bool)$this->option('json');
$this->env = new Env();
return $this->_printAllEnvValues();
$this->_printAllEnvValues()
msztorc\LaravelEnv\Comma...d::_printAllEnvValues()
This check looks for function or method calls that always return null and whose return value is used.
class A { function getObject() { return null; } } $a = new A(); if ($a->getObject()) {
The method getObject() can return nothing but null, so it makes no sense to use the return value.
getObject()
The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.
private function _printAllEnvValues()
$this->line(($this->json) ? json_encode($this->env->getVariables()) : $this->env->getEnvContent());
return;
This check looks for function or method calls that always return null and whose return value is used.
The method
getObject()
can return nothing but null, so it makes no sense to use the return value.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.