Clears all EOL placeholders from self::$content with the base modules EOL token

@param string $eol [optional] custom EOL token

@return $this
175242
protected function clearEOL(string $eol = null){
		$eol = $eol ?? PHP_EOL;
		$this->content = str_replace($this->options->placeholder_eol, $eol, $this->content);

		return $this;
	}
665197
public function addPlaceholder($value, $content)
    {
        $placeholder = $this->createPlaceholder($value);

        return str_replace($value, $placeholder, $content);
    }
1011406
public function removeModule($module)
    {
        foreach ($this->modules as $key => $moduleElement) {
            if ($moduleElement === $module) {
                unset($this->modules[$key]);
                break;
            }
        }

        return $this;
    }
469789
private function resetContent(Content $content, array $translatedContents)
    {
        foreach ($translatedContents as $lang => $translatedContent) {
            $this->updateTranslation($content, $translatedContent, $lang, true);
        }

        $this->updateTranslation($content, $translatedContents['en']);

        return $content;
    }
537138
public function setContent($content)
    {
        $this->original = $content;

        // If the content is "JSONable" we will set the appropriate header and convert
        // the content to JSON. This is useful when returning something like models
        // from routes that will be automatically transformed to their JSON form.
        if ($this->shouldBeJson($content)) {
            $this->header('Content-Type', 'application/json');

            $content = $this->morphToJson($content);
        }

        // If this content implements the "Renderable" interface then we will call the
        // render method on the object so we will avoid any "__toString" exceptions
        // that might be thrown and have their errors obscured by PHP's handling.
        elseif ($content instanceof Renderable) {
            $content = $content->render();
        }

        parent::setContent($content);

        return $this;
    }
55339
public function setContent($content)
    {
        $this->original = $content;

        // If the content is "JSONable" we will set the appropriate header and convert
        // the content to JSON. This is useful when returning something like models
        // from routes that will be automatically transformed to their JSON form.
        if ($this->shouldBeJson($content)) {
            $this->headers->set('Content-Type', 'application/json');

            $content = $this->morphToJson($content);
        }

        // If this content implements the "RenderableInterface", then we will call the
        // render method on the object so we will avoid any "__toString" exceptions
        // that might be thrown and have their errors obscured by PHP's handling.
        else if ($content instanceof RenderableInterface) {
            $content = $content->render();
        }

        return parent::setContent($content);
    }
36405
public function setContent(array $content, $replace = false)
    {
        if ($replace) {
            $this->content = $content;
        } else {
            foreach ($content as $key => $value) {
                $this->content[$key] = $value;
            }
        }

        return $this;
    }
108622
public function setContent($content)
    {
        $app = App::getInstance();

        $text = new \FelixOnline\Core\Text();
        $text->setContent($content);
        $text->save();

        $this->setText1($text);

        return $this;
    }
1021508
public function setContent($content)
    {
        if (is_array($content) || $content instanceof ArrayAccess || $content instanceof JsonSerializable) {
            $this->headers->add(['Content-Type' => 'application/json; charset=utf-8']);
            $content = json_encode($content, JSON_UNESCAPED_UNICODE);
        }

        parent::setContent($content);
        parent::setCharset('utf-8');

        return $this;
    }
1270322
public function setContent($content)
    {

        if (!is_null($content) && (!preg_match("/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", $content))) {
            throw new \InvalidArgumentException("invalid value for $content when calling SendSmtpEmailAttachment., must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.");
        }

        $this->container['content'] = $content;

        return $this;
    }
733729
public function before($content)
    {
        $content = self::create($content);
        $newnodes = array();
        foreach ($this as $i => $node) {
            /** @var \DOMNode $node */
            foreach ($content as $newnode) {
                /** @var \DOMNode $newnode */
                if ($node !== $newnode) {
                    $newnode = static::importNewnode($newnode, $node, $i);
                    $node->parentNode->insertBefore($newnode, $node);
                    $newnodes[] = $newnode;
                }
            }
        }
        $content->clear();
        $content->add($newnodes);
        return $this;
    }
776425
protected static function setFile($content)
    {
        $root = Process::root;

        if (file_exists(Process::root.'config/alias.php')) {
            $file = fopen(Process::root.'config/alias.php', 'w');
            fwrite($file, $content);
            fclose($file);
            //
            return true;
        }

        return false;
    }
907341
protected function restoreHolders($content)
    {
        if (!empty($this->holder)) {

            /**
             * Now the question that you might be asking yourself is, why use a 'for' loop instead
             * of the plain 'str_replace' function once?
             *
             * Well, since html can be nested, there might be cases were a placeholder was placed inside
             * another placeholder and if we do just one 'str_replace', we might not get the full original
             * content.
             *
             * In order to ensure that no data is lost, we need to run 'str_replace' for each time a tag
             * was registered in the constructor. That is the worst case scenario, most of the times, the loop
             * is just going to run once and repeat the cycle only if there are signs that another placeholder is in
             * the content.
             */
            $count = count($this->tags) + 1;
            for ($i=0; $i < $count; $i++) {
                $content = str_replace(array_keys($this->holder), array_values($this->holder), $content);
                if (strpos($content, '%{{') === false) {
                    break;
                }
            }

        }

        return $content;
    }
54718
public static function parse($content)
    {
        $matter = array();

        $text = str_replace(PHP_EOL, $id = uniqid(), $content);

        $regex = '/^---' . $id . '(.*?)' . $id . '---/';

        if (preg_match($regex, $text, $matches) === 1) {
            $yaml = str_replace($id, PHP_EOL, $matches[1]);

            $matter = (array) Yaml::parse(trim($yaml));

            $body = str_replace($matches[0], '', $text);

            $content = str_replace($id, PHP_EOL, $body);
        }

        return array($matter, (string) trim($content));
    }
1168764
public function deletePackage($content) {
    $this->h5pC->fs->deleteContent($content);
    $this->h5pC->fs->deleteExport(($content['slug'] ? $content['slug'] . '-' : '') . $content['id'] . '.h5p');
    $this->h5pF->deleteContentData($content['id']);
  }
1321867
public function setJsonContent($content)
    {
        $context = $this->_context;

        $this->setHeader('Content-Type', 'application/json; charset=utf-8');

        if (is_array($content)) {
            if (!isset($content['code'])) {
                $content = ['code' => 0, 'message' => '', 'data' => $content];
            }
        } elseif ($content instanceof \JsonSerializable) {
            $content = ['code' => 0, 'message' => '', 'data' => $content];
        } elseif (is_string($content)) {
            null;
        } elseif (is_int($content)) {
            $content = ['code' => $content, 'message' => ''];
        } elseif ($content === null) {
            $content = ['code' => 0, 'message' => '', 'data' => null];
        } elseif ($content instanceof ValidatorException) {
            $content = ['code' => -2, 'message' => $content->getMessage()];
        } elseif ($content instanceof \Exception) {
            if ($content instanceof \ManaPHP\Exception) {
                $this->setStatus($content->getStatusCode());
                $content = $content->getJson();
            } else {
                $this->setStatus(500);
                $content = ['code' => 500, 'message' => 'Server Internal Error'];
            }
        }

        $context->content = $this->_jsonEncode($content);

        return $this;
    }
1327783
protected function replace($content, $instance){
        foreach( $this->placeholders as $key => $desc ){
            $fill = $this->fill($key, $instance);
            if( $fill && false !== strpos($content, '%'.$key.'%') ){
                $content = str_replace("%{$key}%", $fill, $content);
            }
        }
        return $content;
    }