Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

PHP 7.4 compatibility #1748

Merged
merged 1 commit into from
Aug 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ php:
- 7.0
- 7.1
- 7.2
- 7.3
- nightly

sudo: false
Expand Down
2 changes: 1 addition & 1 deletion src/Faker/Provider/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ public static function regexify($regex = '')
// All A-F inside of [] become ABCDEF
$regex = preg_replace_callback('/\[([^\]]+)\]/', function ($matches) {
return '[' . preg_replace_callback('/(\w|\d)\-(\w|\d)/', function ($range) {
return implode(range($range[1], $range[2]), '');
return implode('', range($range[1], $range[2]));
}, $matches[1]) . ']';
}, $regex);
// All [ABC] become B (or A or C)
Expand Down
2 changes: 1 addition & 1 deletion src/Faker/Provider/Internet.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public function slug($nbWords = 6, $variableNbWords = true)
}
$words = $this->generator->words($nbWords);

return join($words, '-');
return join('-', $words);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/Faker/Provider/Lorem.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public static function sentence($nbWords = 6, $variableNbWords = true)
$words = static::words($nbWords);
$words[0] = ucwords($words[0]);

return implode($words, ' ') . '.';
return implode(' ', $words) . '.';
}

/**
Expand Down Expand Up @@ -131,7 +131,7 @@ public static function paragraph($nbSentences = 3, $variableNbSentences = true)
$nbSentences = self::randomizeNbElements($nbSentences);
}

return implode(static::sentences($nbSentences), ' ');
return implode(' ', static::sentences($nbSentences));
}

/**
Expand Down Expand Up @@ -193,7 +193,7 @@ public static function text($maxNbChars = 200)
$text[count($text) - 1] .= '.';
}

return implode($text, '');
return implode('', $text);
}

protected static function randomizeNbElements($nbElements)
Expand Down
4 changes: 2 additions & 2 deletions src/Faker/Provider/ar_JO/Company.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function catchPhrase()
$result[] = static::randomElement($word);
}

return join($result, ' ');
return join(' ', $result);
}

/**
Expand All @@ -58,6 +58,6 @@ public function bs()
$result[] = static::randomElement($word);
}

return join($result, ' ');
return join(' ', $result);
}
}
4 changes: 2 additions & 2 deletions src/Faker/Provider/ar_SA/Company.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function catchPhrase()
$result[] = static::randomElement($word);
}

return join($result, ' ');
return join(' ', $result);
}

/**
Expand All @@ -60,7 +60,7 @@ public function bs()
$result[] = static::randomElement($word);
}

return join($result, ' ');
return join(' ', $result);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Faker/Provider/en_US/Company.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function catchPhrase()
$result[] = static::randomElement($word);
}

return join($result, ' ');
return join(' ', $result);
}

/**
Expand All @@ -97,7 +97,7 @@ public function bs()
$result[] = static::randomElement($word);
}

return join($result, ' ');
return join(' ', $result);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Faker/Provider/es_AR/Company.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function catchPhrase()
$result[] = static::randomElement($word);
}

return join($result, ' ');
return join(' ', $result);
}

/**
Expand All @@ -61,6 +61,6 @@ public function bs()
$result[] = static::randomElement($word);
}

return join($result, ' ');
return join(' ', $result);
}
}
4 changes: 2 additions & 2 deletions src/Faker/Provider/es_ES/Company.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function catchPhrase()
$result[] = static::randomElement($word);
}

return join($result, ' ');
return join(' ', $result);
}

/**
Expand All @@ -75,6 +75,6 @@ public function bs()
$result[] = static::randomElement($word);
}

return join($result, ' ');
return join(' ', $result);
}
}
4 changes: 2 additions & 2 deletions src/Faker/Provider/es_PE/Company.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function catchPhrase()
$result[] = static::randomElement($word);
}

return join($result, ' ');
return join(' ', $result);
}

/**
Expand All @@ -61,6 +61,6 @@ public function bs()
$result[] = static::randomElement($word);
}

return join($result, ' ');
return join(' ', $result);
}
}
4 changes: 2 additions & 2 deletions src/Faker/Provider/fi_FI/Company.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function catchPhrase()
$result[] = static::randomElement($word);
}

return join($result, ' ');
return join(' ', $result);
}

/**
Expand All @@ -59,6 +59,6 @@ public function bs()
$result[] = static::randomElement($word);
}

return join($result, ' ');
return join(' ', $result);
}
}
4 changes: 2 additions & 2 deletions src/Faker/Provider/hy_AM/Company.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function catchPhrase()
$result[] = static::randomElement($word);
}

return join($result, ' ');
return join(' ', $result);
}

/**
Expand All @@ -49,6 +49,6 @@ public function bs()
$result[] = static::randomElement($word);
}

return join($result, ' ');
return join(' ', $result);
}
}
4 changes: 2 additions & 2 deletions src/Faker/Provider/it_IT/Company.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function catchPhrase()
$result[] = static::randomElement($word);
}

return join($result, ' ');
return join(' ', $result);
}

/**
Expand All @@ -61,7 +61,7 @@ public function bs()
$result[] = static::randomElement($word);
}

return join($result, ' ');
return join(' ', $result);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Faker/Provider/ru_RU/Company.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function catchPhrase()
$result[] = static::randomElement($word);
}

return join($result, ' ');
return join(' ', $result);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Faker/Provider/sk_SK/Company.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function catchPhrase()
$result[] = static::randomElement($word);
}

return join($result, ' ');
return join(' ', $result);
}

/**
Expand All @@ -59,6 +59,6 @@ public function bs()
$result[] = static::randomElement($word);
}

return join($result, ' ');
return join(' ', $result);
}
}