for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Jaxon\Di\Traits;
use Jaxon\App\Metadata\InputDataInterface;
use Jaxon\App\Metadata\MetadataInterface;
use Jaxon\App\Metadata\MetadataReaderInterface;
trait MetadataTrait
{
/**
* Register the values into the container
*
* @return void
*/
private function registerMetadataReader()
// By default, register a fake metadata reader.
$this->set('metadata_reader_null', function() {
set()
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
$this->/** @scrutinizer ignore-call */
set('metadata_reader_null', function() {
return new class implements MetadataReaderInterface
public function getAttributes(InputDataInterface $xInputData): ?MetadataInterface
return null;
}
};
});
* Get the metadata reader with the given id
* @param string $sReaderId
* @return MetadataReaderInterface
public function getMetadataReader(string $sReaderId): MetadataReaderInterface
return $this->h("metadata_reader_$sReaderId") ?
h()
return $this->/** @scrutinizer ignore-call */ h("metadata_reader_$sReaderId") ?
$this->g("metadata_reader_$sReaderId") :
g()
g("metadata_reader_$sReaderId") :
$this->g('metadata_reader_null');