cstr::join accepte un iterable
This commit is contained in:
parent
8d55a931d2
commit
5c2dd610ef
|
@ -2,8 +2,10 @@
|
|||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/php/src_base" isTestSource="false" packagePrefix="nulib\" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/php/tests" isTestSource="true" packagePrefix="nulib\" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/php/src_base" isTestSource="false" packagePrefix="nucore\" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/php/tests" isTestSource="true" packagePrefix="nucore\" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
|
|
|
@ -261,7 +261,7 @@ class cstr {
|
|||
* pour chaque valeur du tableau avec une clé associative, c'est la clé qui
|
||||
* est utilisée mais uniquement si la valeur est vraie
|
||||
*/
|
||||
static final function join(string $glue, ?array $values): ?string {
|
||||
static final function join(string $glue, ?iterable $values): ?string {
|
||||
if ($values === null) return null;
|
||||
$pieces = [];
|
||||
$index = 0;
|
||||
|
@ -281,7 +281,7 @@ class cstr {
|
|||
* comme {@link join()} mais en ignorant les valeurs fausses selon les règles
|
||||
* de PHP
|
||||
*/
|
||||
static final function pjoin(string $glue, ?array $values): ?string {
|
||||
static final function pjoin(string $glue, ?iterable $values): ?string {
|
||||
if ($values === null) return null;
|
||||
$pieces = [];
|
||||
$index = 0;
|
||||
|
|
Loading…
Reference in New Issue