Skip to content
Permalink
Browse files

Fix some issues that came up while using strict_types

  • Loading branch information...
cleptric committed Jun 20, 2017
1 parent d141a1b commit 0a25d74bb9a95179e2ae9219375d34614e758bf7
Showing with 5 additions and 5 deletions.
  1. +2 −2 src/Core/functions.php
  2. +1 −1 src/Database/Schema/SqliteSchema.php
  3. +1 −1 src/Http/Response.php
  4. +1 −1 src/Network/Session.php
@@ -51,7 +51,7 @@ function h($text, $double = true, $charset = null)
} else {
$text = '(object)' . get_class($text);
}
} elseif (is_bool($text)) {
} elseif (is_bool($text) || is_null($text) || is_int($text)) {
return $text;
}
@@ -199,7 +199,7 @@ function env($key, $default = null)
return (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off');
}
return (strpos(env('SCRIPT_URI'), 'https://') === 0);
return (strpos((string)env('SCRIPT_URI'), 'https://') === 0);
}
if ($key === 'SCRIPT_NAME') {
@@ -177,7 +177,7 @@ protected function _defaultValue($default)
}
// Remove quotes
if (preg_match("/^'(.*)'$/", $default, $matches)) {
if (preg_match("/^'(.*)'$/", (string)$default, $matches)) {
return str_replace("''", "'", $matches[1]);
}
@@ -1853,7 +1853,7 @@ public function withLength($bytes)
*/
public function checkNotModified(ServerRequest $request)
{
$etags = preg_split('/\s*,\s*/', $request->header('If-None-Match'), null, PREG_SPLIT_NO_EMPTY);
$etags = preg_split('/\s*,\s*/', (string)$request->header('If-None-Match'), 0, PREG_SPLIT_NO_EMPTY);
$modifiedSince = $request->header('If-Modified-Since');
if ($responseTag = $this->etag()) {
$etagMatches = in_array('*', $etags) || in_array($responseTag, $etags);
@@ -288,7 +288,7 @@ public function options(array $options)
}
foreach ($options as $setting => $value) {
if (ini_set($setting, $value) === false) {
if (ini_set($setting, (string)$value) === false) {
throw new RuntimeException(
sprintf('Unable to configure the session, setting %s failed.', $setting)
);

0 comments on commit 0a25d74

Please sign in to comment.
You can’t perform that action at this time.