Skip to content

Commit

Permalink
update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
mevdschee committed Oct 12, 2024
1 parent a20d917 commit d00c96c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
13 changes: 9 additions & 4 deletions api.include.php
Original file line number Diff line number Diff line change
Expand Up @@ -1535,7 +1535,7 @@ public function createStreamFromResource($resource): StreamInterface
return Stream::create($resource);
}

public function createUploadedFile(StreamInterface $stream, int $size = null, int $error = \UPLOAD_ERR_OK, string $clientFilename = null, string $clientMediaType = null): UploadedFileInterface
public function createUploadedFile(StreamInterface $stream, ?int $size = null, int $error = \UPLOAD_ERR_OK, ?string $clientFilename = null, ?string $clientMediaType = null): UploadedFileInterface
{
if (null === $size) {
$size = $stream->getSize();
Expand Down Expand Up @@ -2000,7 +2000,7 @@ class Response implements ResponseInterface
* @param string $version Protocol version
* @param string|null $reason Reason phrase (when empty a default will be used based on the status code)
*/
public function __construct(int $status = 200, array $headers = [], $body = null, string $version = '1.1', string $reason = null)
public function __construct(int $status = 200, array $headers = [], $body = null, string $version = '1.1', ?string $reason = null)
{
// If we got no body, defer initialization of the stream until Response::getBody()
if ('' !== $body && null !== $body) {
Expand Down Expand Up @@ -4736,7 +4736,12 @@ class Config implements ConfigInterface
'openApiBase' => '{"info":{"title":"PHP-CRUD-API","version":"1.0.0"}}',
'geometrySrid' => 4326,
];


public function getUID(): string
{
return md5(json_encode($this->values));
}

private function getDefaultDriver(array $values): string
{
if (isset($values['driver'])) {
Expand Down Expand Up @@ -12308,7 +12313,7 @@ public function __construct(Config $config)
$config->getPassword(),
$config->getGeometrySrid()
);
$prefix = sprintf('phpcrudapi-%s-', substr(md5(__FILE__), 0, 8));
$prefix = sprintf('phpcrudapi-%s-', substr($config->getUID(), 0, 8));
$cache = CacheFactory::create($config->getCacheType(), $prefix, $config->getCachePath());
$reflection = new ReflectionService($db, $cache, $config->getCacheTime());
$responder = new JsonResponder($config->getJsonOptions(), $config->getDebug());
Expand Down
13 changes: 9 additions & 4 deletions api.php
Original file line number Diff line number Diff line change
Expand Up @@ -1535,7 +1535,7 @@ public function createStreamFromResource($resource): StreamInterface
return Stream::create($resource);
}

public function createUploadedFile(StreamInterface $stream, int $size = null, int $error = \UPLOAD_ERR_OK, string $clientFilename = null, string $clientMediaType = null): UploadedFileInterface
public function createUploadedFile(StreamInterface $stream, ?int $size = null, int $error = \UPLOAD_ERR_OK, ?string $clientFilename = null, ?string $clientMediaType = null): UploadedFileInterface
{
if (null === $size) {
$size = $stream->getSize();
Expand Down Expand Up @@ -2000,7 +2000,7 @@ class Response implements ResponseInterface
* @param string $version Protocol version
* @param string|null $reason Reason phrase (when empty a default will be used based on the status code)
*/
public function __construct(int $status = 200, array $headers = [], $body = null, string $version = '1.1', string $reason = null)
public function __construct(int $status = 200, array $headers = [], $body = null, string $version = '1.1', ?string $reason = null)
{
// If we got no body, defer initialization of the stream until Response::getBody()
if ('' !== $body && null !== $body) {
Expand Down Expand Up @@ -4736,7 +4736,12 @@ class Config implements ConfigInterface
'openApiBase' => '{"info":{"title":"PHP-CRUD-API","version":"1.0.0"}}',
'geometrySrid' => 4326,
];


public function getUID(): string
{
return md5(json_encode($this->values));
}

private function getDefaultDriver(array $values): string
{
if (isset($values['driver'])) {
Expand Down Expand Up @@ -12308,7 +12313,7 @@ public function __construct(Config $config)
$config->getPassword(),
$config->getGeometrySrid()
);
$prefix = sprintf('phpcrudapi-%s-', substr(md5(__FILE__), 0, 8));
$prefix = sprintf('phpcrudapi-%s-', substr($config->getUID(), 0, 8));
$cache = CacheFactory::create($config->getCacheType(), $prefix, $config->getCachePath());
$reflection = new ReflectionService($db, $cache, $config->getCacheTime());
$responder = new JsonResponder($config->getJsonOptions(), $config->getDebug());
Expand Down

0 comments on commit d00c96c

Please sign in to comment.