/// <summary> /// Ensures the value as an alias. /// In case it isn't, the value is aliased. /// </summary> /// <returns>Non-null alias of the value.</returns> public virtual PhpAlias EnsureAlias(ref PhpValue me) { Debug.Assert(Type != PhpTypeCode.Alias, "To be overriden!"); var alias = new PhpAlias(me, 1); me = Create(alias); return(alias); }
public void SetItemAlias(IntStringKey key, PhpAlias alias) { if (key.IsInteger) { _array[key.Integer] = ToObject(alias.Value); } else { throw new ArgumentException(nameof(key)); } }
public virtual void Accept(PhpAlias obj) => Accept(obj.Value);
public static PhpValue Create(PhpAlias value) => new PhpValue(TypeTable.AliasTable, value);
public void SetItemAlias(IntStringKey key, PhpAlias alias) { this.EnsureWritable(); table._add_or_update(ref key, PhpValue.Create(alias)); this.KeyAdded(ref key); }
void IPhpArray.SetItemAlias(PhpValue index, PhpAlias alias) { throw new NotSupportedException(); }
/// <summary> /// Writes aliased value at given index. /// </summary> void IPhpArray.SetItemAlias(IntStringKey key, PhpAlias alias) { throw new NotSupportedException(); }
public override void Accept(PhpAlias obj) { _output.Append("&"); base.Accept(obj); }
public void SetItemAlias(IntStringKey key, PhpAlias alias) { _array.offsetSet(PhpValue.Create(key), PhpValue.Create(alias)); }
/// <summary> /// Assigns a PHP value to an aliased place. /// </summary> /// <param name="target">Target of the assignment.</param> /// <param name="value">Value to be assigned.</param> public static void SetValue(PhpAlias target, PhpValue value) { Debug.Assert(!value.IsAlias); target.Value = value; }
public void SetItemAlias(PhpValue index, PhpAlias alias) => SetItemAlias(index.ToIntStringKey(), alias);
public void SetItemAlias(PhpValue index, PhpAlias alias) => _array.offsetSet(index, PhpValue.Create(alias));
/// <summary> /// Assigns a PHP value to an aliased place. /// </summary> /// <param name="target">Target of the assignment.</param> /// <param name="value">Value to be assigned. Caller ensures the value is not an alias.</param> public static void SetValue(PhpAlias target, PhpValue value) { Debug.Assert(!value.IsAlias); target.Value = value; }
/// <summary> /// Ensures the value as an alias. /// In case it isn't, the value is aliased. /// </summary> /// <returns>Non-null alias of the value.</returns> public virtual PhpAlias EnsureAlias(ref PhpValue me) { Debug.Assert(Type != PhpTypeCode.Alias, "To be overriden!"); var alias = new PhpAlias(me, 1); me = Create(alias); return alias; }