code: public function setVariable(string $name, $value, bool $as_instance = true)
      {
          $this->variables[$name] = $value;
          if (is_object($value))
              $this->instances[get_class($value)] = $value;
          return $this;
      }
docs: Assign a variable to make available to the app.
  
  Depending on the type of controller, the variables are assigned in
  various ways.  For a plain script, the variables are available directly
  as their name. When the script contains a class, the variables may be
  assigned to public properties of that class with the same name.
  
  Additionally, they may be assigned to parameters to the controller
  method. When $as_instance is set to true, an equal class name
  is sufficient to perform the matching. When $as_instance is set to false,
  class and name must be equal. This only works for objects.
  
  @param string $name The name of the variable
  @param string $value The value to assign
  @param bool $as_instance To allow referencing this variable by class
  @return AppRunner Provides fluent interface