Browse Source

update filter methods

main
yggverse 4 weeks ago
parent
commit
31a6703374
  1. 10
      src/Controller/Server/Nex.php
  2. 11
      src/Model/Filter.php

10
src/Controller/Server/Nex.php

@ -90,7 +90,7 @@ class Nex implements MessageComponentInterface
{ {
$lines[] = sprintf( $lines[] = sprintf(
'# %s', '# %s',
\Yggverse\Pulsar\Model\Filter::title( \Yggverse\Pulsar\Model\Filter::string(
$channelItem->title $channelItem->title
) )
); );
@ -106,14 +106,14 @@ class Nex implements MessageComponentInterface
if ($channelItem->description) if ($channelItem->description)
{ {
$lines[] = \Yggverse\Pulsar\Model\Filter::description( $lines[] = \Yggverse\Pulsar\Model\Filter::text(
$channelItem->description $channelItem->description
) . PHP_EOL; ) . PHP_EOL;
} }
if ($channelItem->content) if ($channelItem->content)
{ {
$lines[] = \Yggverse\Pulsar\Model\Filter::description( $lines[] = \Yggverse\Pulsar\Model\Filter::text(
$channelItem->content $channelItem->content
) . PHP_EOL; ) . PHP_EOL;
} }
@ -147,7 +147,7 @@ class Nex implements MessageComponentInterface
{ {
$lines[] = sprintf( $lines[] = sprintf(
'# %s', '# %s',
\Yggverse\Pulsar\Model\Filter::title( \Yggverse\Pulsar\Model\Filter::string(
$channel->title $channel->title
) )
); );
@ -170,7 +170,7 @@ class Nex implements MessageComponentInterface
'Y-m-d', 'Y-m-d',
$channelItem->pubTime $channelItem->pubTime
) : '', ) : '',
\Yggverse\Pulsar\Model\Filter::title( \Yggverse\Pulsar\Model\Filter::string(
$channelItem->title $channelItem->title
) )
); );

11
src/Model/Filter.php

@ -17,7 +17,7 @@ class Filter
); );
} }
public static function title( public static function string(
string $value string $value
): string ): string
{ {
@ -35,15 +35,6 @@ class Filter
); );
} }
public static function description(
string $value
): string
{
return self::text(
$value
);
}
public static function text( public static function text(
string $value string $value
): string ): string

Loading…
Cancel
Save