Skip to content
Snippets Groups Projects

Issue #3284123: PHP 8.1: Deprecated function: explode(): Passing null to parameter #2 ($string) of type string is deprecated

Merged Issue #3284123: PHP 8.1: Deprecated function: explode(): Passing null to parameter #2 ($string) of type string is deprecated
+ 3
3
@@ -965,9 +965,9 @@ class EasyBreadcrumbBuilder implements BreadcrumbBuilderInterface {
@@ -965,9 +965,9 @@ class EasyBreadcrumbBuilder implements BreadcrumbBuilderInterface {
// List of words to be ignored by the capitalizator.
// List of words to be ignored by the capitalizator.
$ignored_words = $this->config->get(EasyBreadcrumbConstants::CAPITALIZATOR_IGNORED_WORDS) ?? [];
$ignored_words = $this->config->get(EasyBreadcrumbConstants::CAPITALIZATOR_IGNORED_WORDS) ?? [];
if (!is_array($ignored_words)) {
if (!is_array($ignored_words)) {
$ignored_words = explode(' ', $ignored_words);
$ignored_words = explode(' ', $ignored_words ?? '');
}
}
$words = explode(' ', $normalized_text);
$words = explode(' ', $normalized_text ?? '');
// Transforms the non-ignored words of the segment.
// Transforms the non-ignored words of the segment.
$words[0] = Unicode::ucfirst($words[0]);
$words[0] = Unicode::ucfirst($words[0]);
@@ -997,7 +997,7 @@ class EasyBreadcrumbBuilder implements BreadcrumbBuilderInterface {
@@ -997,7 +997,7 @@ class EasyBreadcrumbBuilder implements BreadcrumbBuilderInterface {
if ($forced_words && !$this->config->get(EasyBreadcrumbConstants::CAPITALIZATOR_FORCED_WORDS_CASE_SENSITIVITY)) {
if ($forced_words && !$this->config->get(EasyBreadcrumbConstants::CAPITALIZATOR_FORCED_WORDS_CASE_SENSITIVITY)) {
$forced_words = array_map('strtolower', $forced_words);
$forced_words = array_map('strtolower', $forced_words);
}
}
$words = explode(' ', $normalized_text);
$words = explode(' ', $normalized_text ?? '');
// Transforms the non-ignored words of the segment.
// Transforms the non-ignored words of the segment.
if ($this->config->get(EasyBreadcrumbConstants::CAPITALIZATOR_FORCED_WORDS_FIRST_LETTER)) {
if ($this->config->get(EasyBreadcrumbConstants::CAPITALIZATOR_FORCED_WORDS_FIRST_LETTER)) {
Loading