for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Leonidas\Framework\Module\Abstracts;
use Leonidas\Contracts\Extension\ModuleInterface;
use Leonidas\Contracts\System\Model\Taxonomy\TaxonomyInterface;
use Leonidas\Contracts\System\Model\Taxonomy\TaxonomyOptionHandlerCollectionInterface;
use Leonidas\Contracts\System\Model\Taxonomy\TaxonomyRegistrarInterface;
use Leonidas\Hooks\TargetsInitHook;
use Leonidas\Library\System\Model\Taxonomy\TaxonomyRegistrar;
abstract class TaxonomyRegistrationModule extends Module implements ModuleInterface
{
use TargetsInitHook;
public function hook(): void
$this->targetInitHook();
}
protected function doInitAction(): void
$this->registerTaxonomies();
protected function registerTaxonomies(): void
$this->taxonomyRegistrar()->registerMany(...$this->taxonomies());
protected function taxonomyRegistrar(): TaxonomyRegistrarInterface
return new TaxonomyRegistrar($this->optionHandlers());
$this->optionHandlers()
Leonidas\Framework\Modul...odule::optionHandlers()
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.
protected function optionHandlers(): ?TaxonomyOptionHandlerCollectionInterface
return null;
/**
* @return TaxonomyInterface[]
*/
abstract protected function taxonomies(): array;
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.