Skip to content

Commit f350af6

Browse files
authored
Merge pull request #12 from sharpstream/master
Can no longer pass null to strpos
2 parents 2cac558 + 74a359a commit f350af6

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

composer.json

+9-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
"name": "klaude/eloquent-preferences",
33
"type": "library",
44
"description": "Preferences for Laravel Eloquent models",
5-
"keywords": ["laravel", "eloquent", "preferences"],
5+
"keywords": [
6+
"laravel",
7+
"eloquent",
8+
"preferences"
9+
],
610
"homepage": "https://github.com/klaude/eloquent-preferences",
711
"license": "MIT",
812
"authors": [
@@ -13,8 +17,8 @@
1317
],
1418
"require": {
1519
"ext-json": "*",
16-
"illuminate/database": "~5|~6.0|~7.0|~8.0",
17-
"illuminate/support": "~5|~6.0|~7.0|~8.0"
20+
"illuminate/database": "~5|~6.0|~7.0|~8.0|~9.0|~10.0|~11.0",
21+
"illuminate/support": "~5|~6.0|~7.0|~8.0|~9.0|~10.0|~11.0"
1822
},
1923
"autoload": {
2024
"psr-4": {
@@ -23,12 +27,12 @@
2327
},
2428
"require-dev": {
2529
"ext-pdo": "*",
26-
"illuminate/events": "~5|~6.0|~7.0|~8.0",
30+
"illuminate/events": "~5|~6.0|~7.0|~8.0|~9.0|~10.0",
2731
"phpunit/phpunit": "~5.0|~4.8"
2832
},
2933
"autoload-dev": {
3034
"psr-4": {
3135
"KLaude\\EloquentPreferences\\Tests\\": "tests/"
3236
}
3337
}
34-
}
38+
}

src/HasPreferences.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ protected function castPreferenceValue($preference, $value)
303303
}
304304

305305
// Case Eloquent >= 5.7 compatible types
306-
if (method_exists($this, 'asDecimal') && strpos($castTo, 'decimal:') === 0) {
306+
if (method_exists($this, 'asDecimal') && $castTo && strpos($castTo, 'decimal:') === 0) {
307307
return $this->asDecimal($value, explode(':', $castTo, 2)[1]);
308308
}
309309

0 commit comments

Comments
 (0)