Separate text filter decorators.
This commit is contained in:
25
app/Decorators/TextBreakDecorator.php
Normal file
25
app/Decorators/TextBreakDecorator.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: k
|
||||
* Date: 28.02.2019
|
||||
* Time: 21:32
|
||||
*/
|
||||
|
||||
namespace App\Decorators;
|
||||
|
||||
|
||||
class TextBreakDecorator extends TextConverterDecorator
|
||||
{
|
||||
|
||||
private $lineLength = 32;
|
||||
|
||||
/**
|
||||
* łamie tekst w miejscu spacji do długości 32 znaki na linię
|
||||
* @return string
|
||||
*/
|
||||
public function getText(): string
|
||||
{
|
||||
return wordwrap($this->text->getText(), $this->lineLength);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user