Exemple #1
0
 /**
  * @return void
  */
 public function addVariable(Variable $variable)
 {
     $variable_name = $variable->getName();
     if (Variable::isHardcodedGlobalVariableWithName($variable_name)) {
         // Silently ignore globally replacing $_POST, $argv, runkit superglobals, etc.
         // with superglobals.
         // TODO: Add a warning for incompatible assignments in callers.
         return;
     }
     self::$global_variable_map[$variable->getName()] = $variable;
 }
Exemple #2
0
 /**
  * @return void
  */
 public function addVariable(Variable $variable)
 {
     $this->variable_map[$variable->getName()] = $variable;
 }
Exemple #3
0
 /**
  * @return void
  */
 public function addVariable(Variable $variable)
 {
     self::$global_variable_map[$variable->getName()] = $variable;
 }
Exemple #4
0
 /**
  * @param Variable $global_variable
  * Any global variable
  *
  * @return null
  */
 public function addGlobalVariable(Variable $global_variable)
 {
     $this->global_variable_map[$global_variable->getName()] = $global_variable;
 }
Exemple #5
0
 /**
  * @param Variable $variable
  * A variable to add to the local scope
  *
  * @return Scope;
  */
 public function withVariable(Variable $variable) : Scope
 {
     $scope = clone $this;
     $scope->variable_map[$variable->getName()] = $variable;
     return $scope;
 }