Skip to content

Commit 8d3ebc4

Browse files
committed
Merge branch 'release/1.5.7'
2 parents b021ce2 + 315a2f5 commit 8d3ebc4

5 files changed

Lines changed: 24 additions & 9 deletions

File tree

Blueprints/src/BlueprintSchema.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ protected function parseFormField($key, array $field, array $params, $prefix = '
566566
protected function getFieldKey($key, $prefix, $parent)
567567
{
568568
// Set name from the array key.
569-
if (strpos($key[0], '.') === 0) {
569+
if (is_string($key) && strpos($key[0], '.') === 0) {
570570
return ($parent ?: rtrim($prefix, '.')) . $key;
571571
}
572572

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# v1.5.7
2+
## 02/17/2021
3+
4+
1. [](#new)
5+
* Pass new phpstan level 8 tests
6+
1. [](#bugfix)
7+
* Fixed `Trying to access array offset on value of type int` in `BlueprintSchema::getFieldKey()`
8+
19
# v1.5.6
210
## 12/03/2020
311

File/src/MoFile.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ protected function readInt()
144144
}
145145

146146
$read = unpack($this->endian, $read);
147+
if ($read === false) {
148+
return false;
149+
}
147150

148151
return array_shift($read);
149152
}

Session/src/Session.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public function start()
9999
*/
100100
public function getId()
101101
{
102-
return session_id();
102+
return session_id() ?: null;
103103
}
104104

105105
/**
@@ -123,7 +123,7 @@ public function setId($id)
123123
*/
124124
public function getName()
125125
{
126-
return session_name();
126+
return session_name() ?: null;
127127
}
128128

129129
/**
@@ -146,11 +146,14 @@ public function setName($name)
146146
*/
147147
public function invalidate()
148148
{
149-
$params = session_get_cookie_params();
150-
setcookie(session_name(), '', time() - 42000,
151-
$params['path'], $params['domain'],
152-
$params['secure'], $params['httponly']
153-
);
149+
$name = $this->getName();
150+
if (null !== $name) {
151+
$params = session_get_cookie_params();
152+
setcookie($name, '', time() - 42000,
153+
$params['path'], $params['domain'],
154+
$params['secure'], $params['httponly']
155+
);
156+
}
154157

155158
session_unset();
156159
session_destroy();

tests/phpstan/phpstan.neon

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ includes:
22
#- '../../vendor/phpstan/phpstan-strict-rules/rules.neon'
33
- '../../vendor/phpstan/phpstan-deprecation-rules/rules.neon'
44
parameters:
5-
bootstrap: phpstan-bootstrap.php
5+
bootstrapFiles:
6+
- phpstan-bootstrap.php
67
inferPrivatePropertyTypeFromConstructor: true
78
reportUnmatchedIgnoredErrors: false
89

0 commit comments

Comments
 (0)