Pchp.Library.Streams.PhpStream.GetValid C# (CSharp) Method

GetValid() public static method

Check that the resource handle contains a valid PhpStream resource and cast the handle to PhpStream.
public static GetValid ( PhpResource handle ) : PhpStream
handle Pchp.Core.PhpResource A PhpResource passed to the PHP function.
return PhpStream
        public static PhpStream GetValid(PhpResource handle)
        {
            var result = handle as PhpStream;
            if (result != null && result.IsValid)
            {
                return result;
            }
            else
            {
                PhpException.Throw(PhpError.Warning, ErrResources.invalid_stream_resource);
                return null;
            }
        }

Same methods

PhpStream::GetValid ( PhpResource handle, FileAccess desiredAccess ) : PhpStream