From 9d5431ab9ef0d8df30c3f47c8d879f1b8fa15271 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20M=C3=AD=C5=A1ek?= Date: Mon, 5 Aug 2024 14:58:17 +0200 Subject: [PATCH] correct named arguments for stream_context_create() --- src/Peachpie.Library/Streams/StreamContext.cs | 12 ++++++------ src/Peachpie.Library/Streams/Streams.cs | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Peachpie.Library/Streams/StreamContext.cs b/src/Peachpie.Library/Streams/StreamContext.cs index 25455f6195..a8ee58c679 100644 --- a/src/Peachpie.Library/Streams/StreamContext.cs +++ b/src/Peachpie.Library/Streams/StreamContext.cs @@ -55,19 +55,19 @@ public StreamContext() /// /// Create a new context resource from an array of wrapper options. /// - /// A 2-dimensional array of wrapper options - public StreamContext(PhpArray data) - : this(data, true) { } + /// A 2-dimensional array of wrapper options + public StreamContext(PhpArray options) + : this(options, true) { } /// /// Create a new context resource from an array of wrapper options. /// - /// A 2-dimensional array of wrapper options + /// A 2-dimensional array of wrapper options /// Whether to register this instance in current . Should be false for static resources. - private StreamContext(PhpArray data, bool registerInCtx) + private StreamContext(PhpArray options, bool registerInCtx) : base(StreamContextTypeName/*, registerInCtx*/) { - this.Data = data; + this.Data = options; } #endregion diff --git a/src/Peachpie.Library/Streams/Streams.cs b/src/Peachpie.Library/Streams/Streams.cs index 22c9819c0f..94c7bdcfed 100644 --- a/src/Peachpie.Library/Streams/Streams.cs +++ b/src/Peachpie.Library/Streams/Streams.cs @@ -40,18 +40,18 @@ public static class PhpContexts #region stream_context_create /// Create a new stream context. - /// The 2-dimensional array in format "options[wrapper][option]". - public static PhpResource stream_context_create(PhpArray data = null) + /// The 2-dimensional array in format "options[wrapper][option]". + public static PhpResource stream_context_create(PhpArray options = null) { - if (data == null) + if (options == null) { return StreamContext.Default; } // OK, data lead to a valid stream-context. - if (CheckContextData(data)) + if (CheckContextData(options)) { - return new StreamContext(data); + return new StreamContext(options); } // Otherwise.. @@ -62,12 +62,12 @@ public static PhpResource stream_context_create(PhpArray data = null) /// /// Check whether the provided argument is a valid stream-context data array. /// - /// The data to be stored into context. + /// The data to be stored into context. /// - static bool CheckContextData(PhpArray data) + static bool CheckContextData(PhpArray options) { // Check if the supplied data are correctly formed. - var enumerator = data.GetFastEnumerator(); + var enumerator = options.GetFastEnumerator(); while (enumerator.MoveNext()) { if (enumerator.CurrentValue.AsArray() == null)