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
ファイル: Operators.cs プロジェクト: allisterb/peachpie
 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
ファイル: PhpValue.cs プロジェクト: zhangwenquan/peachpie
 public static PhpValue Create(PhpAlias value) => new PhpValue(TypeTable.AliasTable, value);
コード例 #5
0
ファイル: PhpArray.cs プロジェクト: crazyants/peachpie
 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
ファイル: PhpString.cs プロジェクト: iolevel/peachpie
 /// <summary>
 /// Writes aliased value at given index.
 /// </summary>
 void IPhpArray.SetItemAlias(IntStringKey key, PhpAlias alias) { throw new NotSupportedException(); }
コード例 #9
0
ファイル: Variables.cs プロジェクト: iolevel/peachpie
 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
ファイル: Operators.cs プロジェクト: allisterb/peachpie
 public void SetItemAlias(PhpValue index, PhpAlias alias) => SetItemAlias(index.ToIntStringKey(), alias);
コード例 #13
0
ファイル: Operators.cs プロジェクト: allisterb/peachpie
 public void SetItemAlias(PhpValue index, PhpAlias alias) => _array.offsetSet(index, PhpValue.Create(alias));
コード例 #14
0
ファイル: Operators.cs プロジェクト: iolevel/peachpie
        /// <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
ファイル: PhpArray.cs プロジェクト: iolevel/peachpie
 public void SetItemAlias(IntStringKey key, PhpAlias alias)
 {
     this.EnsureWritable();
     table._add_or_update(ref key, PhpValue.Create(alias));
     this.KeyAdded(ref key);
 }