Skip to content

Commit

Permalink
Merge pull request #152 from weierophinney/feature/function-removal
Browse files Browse the repository at this point in the history
Remove marshalUriFromSapi function
  • Loading branch information
Xerkus authored May 2, 2023
2 parents 6fce157 + 62b55c0 commit 9b7432e
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 712 deletions.
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
"src/functions/marshal_headers_from_sapi.php",
"src/functions/marshal_method_from_sapi.php",
"src/functions/marshal_protocol_version_from_sapi.php",
"src/functions/marshal_uri_from_sapi.php",
"src/functions/normalize_server.php",
"src/functions/normalize_uploaded_files.php",
"src/functions/parse_cookie_header.php"
Expand Down
3 changes: 0 additions & 3 deletions docs/book/v3/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,6 @@ and even the `Cookie` header. These include:
when under Apache)
- `Laminas\Diactoros\marshalProtocolVersionFromSapi(array $server) : string`
- `Laminas\Diactoros\marshalMethodFromSapi(array $server) : string`.
- `Laminas\Diactoros\marshalUriFromSapi(array $server, array $headers) : Uri`.
Please note: **this function is deprecated as of version 2.11.1**, and no longer used in `ServerRequestFactory::fromGlobals()`.
Use `ServerRequestFactory::fromGlobals()` instead.
- `Laminas\Diactoros\marshalHeadersFromSapi(array $server) : array`
- `Laminas\Diactoros\parseCookieHeader(string $header) : array`
- `Laminas\Diactoros\createUploadedFile(array $spec) : UploadedFile` (creates the
Expand Down
6 changes: 6 additions & 0 deletions docs/book/v3/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ With the update in PHP 8.0 to usage of opaque resource types for all GD resource
As such, we have removed the feature entirely.

If you need to stream an image, the recommendation is to use the functionality in the GD extension to write the image to a temporary file (e.g., `php://temp`), and then to pass that to `Laminas\Diactoros\Stream`.

### marshalUriFromSapi function

The `Laminas\Diactoros\marshalUriFromSapi()` function was deprecated starting in version 2.11.0, and now removed.
The functionality that was present in it was moved to `Laminas\Diactoros\UriFactory::createFromSapi()`.
If you were using the function previously, use this static method instead.
46 changes: 0 additions & 46 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -305,52 +305,6 @@
<code><![CDATA[$server['SERVER_PROTOCOL']]]></code>
</MixedArgument>
</file>
<file src="src/functions/marshal_uri_from_sapi.php">
<MissingClosureParamType>
<code>$default</code>
<code>$host</code>
<code>$https</code>
</MissingClosureParamType>
<MissingClosureReturnType>
<code>static function ($host) {</code>
<code>static function (string $name, array $headers, $default = null) {</code>
</MissingClosureReturnType>
<MixedArgument>
<code><![CDATA[$getHeaderFromArray('x-forwarded-proto', $headers, '')]]></code>
<code>$host</code>
<code>$host</code>
<code>$host</code>
<code>$host</code>
<code>$port</code>
<code>$requestUri</code>
<code><![CDATA[$server['QUERY_STRING']]]></code>
</MixedArgument>
<MixedArgumentTypeCoercion>
<code>$headers[$header]</code>
<code>$host</code>
</MixedArgumentTypeCoercion>
<MixedAssignment>
<code>$host</code>
<code>$iisUrlRewritten</code>
<code>$origPathInfo</code>
<code>$unencodedUrl</code>
</MixedAssignment>
<MixedInferredReturnType>
<code>array</code>
<code>string</code>
</MixedInferredReturnType>
<MixedOperand>
<code><![CDATA[$server['SERVER_ADDR']]]></code>
</MixedOperand>
<MixedReturnStatement>
<code>$defaults</code>
<code>$origPathInfo</code>
<code>$unencodedUrl</code>
</MixedReturnStatement>
<PossiblyFalseOperand>
<code><![CDATA[strrpos($host, ':')]]></code>
</PossiblyFalseOperand>
</file>
<file src="src/functions/normalize_server.php">
<MixedArrayAccess>
<code><![CDATA[$apacheRequestHeaders['Authorization']]]></code>
Expand Down
12 changes: 0 additions & 12 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@
</stubs>

<issueHandlers>
<DeprecatedFunction>
<errorLevel type="suppress">
<referencedFunction name="laminas\diactoros\marshalurifromsapi"/>
</errorLevel>
</DeprecatedFunction>

<InternalClass>
<errorLevel type="suppress">
<referencedClass name="Laminas\Diactoros\ServerRequestFilter\IPRange"/>
Expand All @@ -44,12 +38,6 @@
<referencedMethod name="Laminas\Diactoros\ServerRequestFilter\IPRange::matchesIPv6"/>
</errorLevel>
</InternalMethod>

<UndefinedClass>
<errorLevel type="suppress">
<referencedClass name="GdImage" />
</errorLevel>
</UndefinedClass>
</issueHandlers>
<plugins>
<pluginClass class="Psalm\PhpUnitPlugin\Plugin"/>
Expand Down
233 changes: 0 additions & 233 deletions src/functions/marshal_uri_from_sapi.php

This file was deleted.

Loading

0 comments on commit 9b7432e

Please sign in to comment.