Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F12945995
OmniString.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
OmniString.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
Keruald\OmniTools\Strings\Multibyte
;
class
OmniString
{
use
WithEncoding
;
///
/// Private members
///
/**
* @var string
*/
private
$value
;
///
/// Constructor
///
public
function
__construct
(
string
$value
=
''
,
string
$encoding
=
''
)
{
$this
->
value
=
$value
;
$this
->
setEncoding
(
$encoding
?:
"UTF-8"
);
}
///
/// Magic methods
///
public
function
__toString
()
:
string
{
return
$this
->
value
;
}
///
/// Helper methods
///
public
function
pad
(
int
$padLength
=
0
,
string
$padString
=
' '
,
int
$padType
=
STR_PAD_RIGHT
)
:
string
{
return
(
new
StringPad
)
->
setInput
(
$this
->
value
)
->
setEncoding
(
$this
->
encoding
)
->
setPadLength
(
$padLength
)
->
setPadString
(
$padString
)
->
setPadType
(
$padType
)
->
pad
();
}
/**
* @return string
*/
public
function
getValue
()
:
string
{
return
$this
->
value
;
}
/**
* @param string $value
*/
public
function
setValue
(
string
$value
)
{
$this
->
value
=
$value
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Nov 18, 18:03 (1 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3161918
Default Alt Text
OmniString.php (1 KB)
Attached To
Mode
rKERUALD Keruald libraries development repository
Attached
Detach File
Event Timeline
Log In to Comment