This repository has been archived on 2019-03-01. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
paper-pi/app/Decorators/HideLinesDecorator.php
2019-03-01 07:58:22 +01:00

23 lines
408 B
PHP

<?php
/**
* Created by PhpStorm.
* User: k
* Date: 28.02.2019
* Time: 20:47
*/
namespace App\Decorators;
class HideLinesDecorator extends TextConverterDecorator
{
/**
* usuwa linijki z tekstu które zaczynają zię od znaku #
* @return string
*/
public function getText(): string
{
return preg_replace('/^\s*[!#].*?$[\r\n]?/m', '', $this->text->getText());
}
}