Skip to content

Commit

Permalink
Remove obsolete internal classes, methods and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromegamez committed Jun 26, 2023
1 parent 896642d commit ee7ea30
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 478 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,22 @@
to the HTTP V1 API
([#804](https://github.com/kreait/firebase-php/pull/804)/[#805](https://github.com/kreait/firebase-php/pull/805))

### Removed

* Removed obsolete internal classes
* `Kreait\Firebase\Http\RequestWithSubRequests`
* `Kreait\Firebase\Http\ResponseWithSubResponses`
* `Kreait\Firebase\Http\WrappedPsr7Response`
* `Kreait\Firebase\Messaging\Http\Request\MessageRequest`
* `Kreait\Firebase\Messaging\Http\Request\SendMessage`
* `Kreait\Firebase\Messaging\Http\Request\SendMessageToTokens`
* `Kreait\Firebase\Messaging\Http\Request\SendMessages`

* Removed obsolete internal methods
* `Kreait\Firebase\Http\Middleware::responseWithSubResponses()`

* Removed obsolete Composer dependency `riverline/multipart-parser`

## [7.4.0] - 2023-06-18

### Added
Expand Down
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@
"lcobucci/jwt": "^4.3.0|^5.0",
"mtdowling/jmespath.php": "^2.6.1",
"psr/cache": "^1.0.1|^2.0|^3.0",
"psr/log": "^1.1|^2.0|^3.0",
"riverline/multipart-parser": "^2.0.9"
"psr/log": "^1.1|^2.0|^3.0"
},
"require-dev": {
"beste/php-cs-fixer-config": "^2.2",
Expand Down
2 changes: 0 additions & 2 deletions src/Firebase/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -545,8 +545,6 @@ public function createApiClient(?array $config = null, ?array $middlewares = nul

$handler->push(new AuthTokenMiddleware($credentials, $authTokenHandler));

$handler->push(Middleware::responseWithSubResponses());

$config['handler'] = $handler;
$config['auth'] = 'google_auth';

Expand Down
21 changes: 0 additions & 21 deletions src/Firebase/Http/Middleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

use function array_merge;
use function ltrim;
use function mb_stristr;
use function preg_match_all;
use function str_ends_with;

/**
Expand Down Expand Up @@ -59,25 +57,6 @@ public static function addDatabaseAuthVariableOverride(?array $override): callab
};
}

/**
* Parses multi-requests and multi-responses.
*/
public static function responseWithSubResponses(): callable
{
return static fn (callable $handler) => static fn (RequestInterface $request, ?array $options = null) => $handler($request, $options ?: [])
->then(static function (ResponseInterface $response) {
$isMultiPart = mb_stristr($response->getHeaderLine('Content-Type'), 'multipart') !== false;
$hasMultipleStartLines = ((int) preg_match_all('@http/[\S]+\s@i', (string) $response->getBody())) >= 1;

if ($isMultiPart && $hasMultipleStartLines) {
return new ResponseWithSubResponses($response);
}

return $response;
})
;
}

public static function log(LoggerInterface $logger, MessageFormatter $formatter, string $logLevel, string $errorLogLevel): callable
{
return static fn (callable $handler) => static fn ($request, array $options) => $handler($request, $options)->then(
Expand Down
101 changes: 0 additions & 101 deletions src/Firebase/Http/RequestWithSubRequests.php

This file was deleted.

94 changes: 0 additions & 94 deletions src/Firebase/Http/ResponseWithSubResponses.php

This file was deleted.

104 changes: 0 additions & 104 deletions src/Firebase/Http/WrappedPsr7Response.php

This file was deleted.

15 changes: 0 additions & 15 deletions src/Firebase/Messaging/Http/Request/MessageRequest.php

This file was deleted.

0 comments on commit ee7ea30

Please sign in to comment.