count
thermage/thermage
Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Counts all elements in an array or in a Countable object
Alias
sizeof
count
(
Countable
|array
$value
,
int $mode
=
COUNT_NORMAL
):
int
$chars
[] =
$this
->
styles
->
get
(
'font.chars.'
.
$char
);
}
$charsCount
=
count
(
$chars
);
$linesCount
=
$this
->
styles
->
get
(
'font.lines'
);
$colorsCount
=
$this
->
styles
->
get
(
'font.colors'
);
$colors
=
$this
->
styles
->
get
(
'colors'
);
src/Base/Element.php
{
$line
=
''
;
$i
=
0
;
$count
=
count
(
$data
);
$labelSizes
= [];
src/Elements/Chart.php
}
foreach (
$this
->
sparkData
as
$number
) {
$tickIndex
=
ceil
((
$number
/
$max
) *
count
(
$this
->
sparkTicks
)) -
1
;
if (
$max
===
0
||
$tickIndex
<
0
)
$tickIndex
=
0
;
$result
.=
span
(
$this
->
sparkTicks
[
$tickIndex
])->
color
(
$this
->
getStyles
()[
'color'
] . ((
$tickIndex
==
0
) ?
100
:
$tickIndex
*
100
))->
renderToString
();
}
src/Elements/Spark.php
test
(
'test getCurrentPosition'
, function ():
void
{
expect
(
terminal
()->
cursor
()->
getCurrentPosition
())->
toBeArray
();
expect
(
count
(
terminal
()->
cursor
()->
getCurrentPosition
()))->
toEqual
(
2
);
});
tests/Base/CursorTest.php