Skip to content

Commit

Permalink
feat: enable the usage of "psr/http-message": "^1.0|^2.0" (#6338)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromegamez authored Jun 20, 2023
1 parent 4aa2e85 commit b3967d3
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Core/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"guzzlehttp/promises": "^1.4||^2.0",
"guzzlehttp/psr7": "^1.7|^2.0",
"monolog/monolog": "^1.1|^2.0|^3.0",
"psr/http-message": "^1.0"
"psr/http-message": "^1.0|^2.0"
},
"require-dev": {
"phpunit/phpunit": "^9.0",
Expand Down
4 changes: 2 additions & 2 deletions Debugger/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
"phpdocumentor/reflection": "^5.0",
"erusev/parsedown": "^1.6",
"google/cloud-tools": "^0.13.0",
"kreait/firebase-php": "^5.20"
"kreait/firebase-php": "^5.26.5"
},
"suggest": {
"ext-grpc": "The gRPC extension enables use of the performant gRPC transport",
"ext-protobuf": "Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions.",
"kreait/firebase-php": "^5.20 for use of the Firebase connection class and snapshot-debugger (see https://github.com/GoogleCloudPlatform/snapshot-debugger)",
"kreait/firebase-php": "^5.26.5 for use of the Firebase connection class and snapshot-debugger (see https://github.com/GoogleCloudPlatform/snapshot-debugger)",
"ext-stackdriver_debugger": "*"
},
"extra": {
Expand Down
2 changes: 1 addition & 1 deletion Debugger/src/Connection/Firebase.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Firebase implements ConnectionInterface
public function __construct(array $config = [])
{
if (!class_exists(Factory::class)) {
throw new \LogicException('Please install "kreait/firebase-php:^5.20"');
throw new \LogicException('Please install "kreait/firebase-php:^5.26.5');
}
$databaseUrl = isset($config['firebase_db_url'])
? $config['firebase_db_url']
Expand Down
6 changes: 3 additions & 3 deletions Storage/src/ReadStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function __construct(StreamInterface $stream)
*
* @return int The size of the stream.
*/
public function getSize()
public function getSize(): ?int
{
return $this->stream->getSize() ?: $this->getSizeFromMetadata();
}
Expand All @@ -58,7 +58,7 @@ public function getSize()
*
* @return int The Size of the stream
*/
private function getSizeFromMetadata()
private function getSizeFromMetadata(): int
{
foreach ($this->stream->getMetadata('wrapper_data') as $value) {
if (substr($value, 0, 15) == "Content-Length:") {
Expand All @@ -78,7 +78,7 @@ private function getSizeFromMetadata()
* @param int $length The number of bytes to read.
* @return string Read bytes from the underlying stream.
*/
public function read($length)
public function read($length): string
{
$data = '';
do {
Expand Down
8 changes: 4 additions & 4 deletions Storage/src/WriteStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function __construct(AbstractUploader $uploader = null, $options = [])
/**
* Close the stream. Uploads any remaining data.
*/
public function close()
public function close(): void
{
if ($this->uploader && $this->hasWritten) {
$this->uploader->upload();
Expand All @@ -75,7 +75,7 @@ public function close()
* @return int The number of bytes written
* @throws \RuntimeException
*/
public function write($data)
public function write($data): int
{
if (!isset($this->uploader)) {
throw new \RuntimeException("No uploader set.");
Expand All @@ -98,12 +98,12 @@ public function write($data)
*
* @param AbstractUploader $uploader The new uploader to use.
*/
public function setUploader($uploader)
public function setUploader($uploader): void
{
$this->uploader = $uploader;
}

private function getChunkedWriteSize()
private function getChunkedWriteSize(): int
{
return (int) floor($this->getSize() / $this->chunkSize) * $this->chunkSize;
}
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"guzzlehttp/guzzle": "^6.5.7|^7.4.4",
"guzzlehttp/psr7": "^1.7|^2.0",
"monolog/monolog": "^2.0||^3.0",
"psr/http-message": "^1.0",
"psr/http-message": "^1.0|^2.0",
"ramsey/uuid": "^4.0",
"google/gax": "^1.12",
"google/common-protos": "^4.0",
Expand All @@ -64,7 +64,7 @@
"opis/closure": "^3.0",
"rg/avro-php": "^3.0.0",
"phpspec/prophecy-phpunit": "^2.0",
"kreait/firebase-php": "^5.20"
"kreait/firebase-php": "^5.26.5"
},
"conflict": {
"psr/log": ">=3"
Expand Down

0 comments on commit b3967d3

Please sign in to comment.