for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Epesi\Core\System\Integration\Modules\Concerns;
trait HasOptions
{
/**
* Define the option elements and return as array
* Options are class specific and can be modified by the user
*/
public function elements() {}
* Define the server side form validation rules
public function rules() {
return [];
}
public function defaultOptions()
return collect($this->elements())->pluck('default', 'name');
$this->elements()
Epesi\Core\System\Integr...\HasOptions::elements()
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.
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.