modifs.mineures sans commentaires

This commit is contained in:
Jephté Clain 2023-10-25 16:49:28 +04:00
parent 4a0006724e
commit 1aee701fef
2 changed files with 37 additions and 0 deletions

View File

@ -3,6 +3,21 @@
<component name="PhpDockerContainerSettings">
<list>
<map>
<entry key="125ffb9d-fd5f-4e71-8182-94191665795a">
<value>
<DockerContainerSettings>
<option name="version" value="1" />
<option name="volumeBindings">
<list>
<DockerVolumeBindingImpl>
<option name="containerPath" value="/opt/project" />
<option name="hostPath" value="$PROJECT_DIR$" />
</DockerVolumeBindingImpl>
</list>
</option>
</DockerContainerSettings>
</value>
</entry>
<entry key="c4cf2564-ed91-488c-a93d-fe2daeae80db">
<value>
<DockerContainerSettings>

View File

@ -1,6 +1,8 @@
<?php
namespace nulib;
use nur\base;
/**
* Class str: gestion des chaines de caractère "simples"
*/
@ -66,6 +68,26 @@ class str {
else return rtrim($s);
}
static final function left(?string $s, int $size): ?string {
if ($s === null) return null;
else return str_pad($s, $size);
}
static final function right(?string $s, int $size): ?string {
if ($s === null) return null;
else return str_pad($s, $size, " ", STR_PAD_LEFT);
}
static final function center(?string $s, int $size): ?string {
if ($s === null) return null;
else return str_pad($s, $size, " ", STR_PAD_BOTH);
}
static final function pad0(?string $s, int $size): ?string {
if ($s === null) return null;
else return str_pad($s, $size, "0", STR_PAD_LEFT);
}
static final function lower(?string $s): ?string {
if ($s === null) return null;
else return strtolower($s);