Inheritance: IPhpConvertible
示例#1
0
            /// <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);
            }
示例#2
0
 public void SetItemAlias(IntStringKey key, PhpAlias alias)
 {
     if (key.IsInteger)
     {
         _array[key.Integer] = ToObject(alias.Value);
     }
     else
     {
         throw new ArgumentException(nameof(key));
     }
 }
示例#3
0
 public virtual void Accept(PhpAlias obj) => Accept(obj.Value);
示例#4
0
 public static PhpValue Create(PhpAlias value) => new PhpValue(TypeTable.AliasTable, value);
示例#5
0
 public void SetItemAlias(IntStringKey key, PhpAlias alias)
 {
     this.EnsureWritable();
     table._add_or_update(ref key, PhpValue.Create(alias));
     this.KeyAdded(ref key);
 }
示例#6
0
 void IPhpArray.SetItemAlias(PhpValue index, PhpAlias alias)
 {
     throw new NotSupportedException();
 }
示例#7
0
 /// <summary>
 /// Writes aliased value at given index.
 /// </summary>
 void IPhpArray.SetItemAlias(IntStringKey key, PhpAlias alias)
 {
     throw new NotSupportedException();
 }
示例#8
0
 /// <summary>
 /// Writes aliased value at given index.
 /// </summary>
 void IPhpArray.SetItemAlias(IntStringKey key, PhpAlias alias) { throw new NotSupportedException(); }
示例#9
0
 public override void Accept(PhpAlias obj)
 {
     _output.Append("&");
     base.Accept(obj);
 }
示例#10
0
 public void SetItemAlias(IntStringKey key, PhpAlias alias)
 {
     _array.offsetSet(PhpValue.Create(key), PhpValue.Create(alias));
 }
示例#11
0
 /// <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;
 }
示例#12
0
 public void SetItemAlias(PhpValue index, PhpAlias alias) => SetItemAlias(index.ToIntStringKey(), alias);
示例#13
0
 public void SetItemAlias(PhpValue index, PhpAlias alias) => _array.offsetSet(index, PhpValue.Create(alias));
示例#14
0
        /// <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;
        }
示例#15
0
 /// <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;
 }
示例#16
0
 public void SetItemAlias(IntStringKey key, PhpAlias alias)
 {
     this.EnsureWritable();
     table._add_or_update(ref key, PhpValue.Create(alias));
     this.KeyAdded(ref key);
 }