code: public function checkIfSingleton($name, $item) 
      {
          // If the closure is marked as needing to be saved as a singleton, store result. 
          if (isset($this->signaturesToSingletons->$name) and $this->signaturesToSingletons->$name) {
              $this->$name = $item;
              $this->signaturesToSingletons = false;
          }
      }
docs: Checks if a resource should be saved as a singleton. Save item if yes.
  
  @param string $name The name of the resource.
  @param mixed $item An instance of the resource.
  @return void