MediaWiki master
SpecBasedFactoryTrait.php File Reference

Go to the source code of this file.

Namespaces

namespace  Wikimedia\Leximorph\Traits
 

Variables

 Wikimedia\Leximorph\Traits::$args = $this->getSpecArgs( $spec, $logger )
 
return Wikimedia\Leximorph\Traits::$cached
 
 Wikimedia\Leximorph\Traits::$instance = ObjectFactory::getObjectFromSpec( $objectSpec )
 
LoggerInterface Wikimedia\Leximorph\Traits::$logger = null
 The logger instance.
 
if(!empty( $spec['args']) &&is_array( $spec['args'])) Wikimedia\Leximorph\Traits::$objectSpec
 
if(!isset( $specs[$class])) Wikimedia\Leximorph\Traits::$spec = $specs[$class]
 
 Wikimedia\Leximorph\Traits::$specs = $this->getSpecMap()
 
array array< string, $singletons=[];abstract protected function getSpecMap():array;abstract protected function getSpecArgs(array $spec, LoggerInterface $logger):array;protected function createFromSpec(string $class) { if(isset($this->singletons[ $class])) { $cached=$this-> Wikimedia\Leximorph\Traits::singletons [$class]
 Cache of created singleton objects.
 
if(! $instance instanceof $class) $this Wikimedia\Leximorph\Traits::singletons [$class] = $instance
 
trait Wikimedia\Leximorph\Traits::SpecBasedFactoryTrait
 SpecBasedFactoryTrait.
 

Detailed Description

Note
GPL-2.0-or-later

Definition in file SpecBasedFactoryTrait.php.