for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Helpers\SearchFilterHelper;
class TestSearch extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'test:search';
* The console command description.
protected $description = 'test search filter';
* Create a new command instance.
* @return void
@return
Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.
Please refer to the PHP core documentation on constructors.
public function __construct()
parent::__construct();
}
* Execute the console command.
* @return mixed
public function handle()
$searchTerm = 'zelda maps:25 legend maps:30';
$result = SearchFilterHelper::searchFilter($searchTerm);
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
$a = "a"; $ab = "ab"; $abc = "abc";
will produce issues in the first and second line, while this second example
will produce no issues.
echo PHP_EOL;
print_r($result);
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.