diff options
| author | 2019-10-23 11:18:20 +0200 | |
|---|---|---|
| committer | 2019-10-23 11:18:20 +0200 | |
| commit | 7a5236de3f13f08b8c51eb183c0dcf1c8c85beca (patch) | |
| tree | 10a09f07458ed1279e62646188cb42e87fe0ed8f /app/views/index/rss.phtml | |
| parent | fdfd8ce9be182943e73d20ec3bff4d560c5b7503 (diff) | |
Take advantage of PHP 5.4+ short echo (#2585)
* Take advantage of PHP 5.4+ short echo
https://php.net/migration54.new-features thanks to
https://github.com/FreshRSS/FreshRSS/pull/2495
Use `<?= ?>` instead of `<?php echo; ?>`
10kB of code saved :-)
Done with regular expression:
```
<\?php echo (.+?);? *\?>
<?= \1 ?>
```
* Try Travis fix
https://github.com/squizlabs/PHP_CodeSniffer/issues/2045#issuecomment-395238272
Diffstat (limited to 'app/views/index/rss.phtml')
| -rwxr-xr-x | app/views/index/rss.phtml | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/app/views/index/rss.phtml b/app/views/index/rss.phtml index dcfaa0a57..00be01c28 100755 --- a/app/views/index/rss.phtml +++ b/app/views/index/rss.phtml @@ -1,18 +1,18 @@ -<?php echo '<?xml version="1.0" encoding="UTF-8" ?>'; ?> +<?= '<?xml version="1.0" encoding="UTF-8" ?>'; ?> <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/"> <channel> - <title><?php echo $this->rss_title; ?></title> - <link><?php echo Minz_Url::display(null, 'html', true); ?></link> - <description><?php echo _t('index.feed.rss_of', $this->rss_title); ?></description> - <pubDate><?php echo date('D, d M Y H:i:s O'); ?></pubDate> - <lastBuildDate><?php echo gmdate('D, d M Y H:i:s'); ?> GMT</lastBuildDate> - <atom:link href="<?php echo Minz_Url::display($this->url, 'html', true); ?>" rel="self" type="application/rss+xml" /> + <title><?= $this->rss_title ?></title> + <link><?= Minz_Url::display(null, 'html', true) ?></link> + <description><?= _t('index.feed.rss_of', $this->rss_title) ?></description> + <pubDate><?= date('D, d M Y H:i:s O') ?></pubDate> + <lastBuildDate><?= gmdate('D, d M Y H:i:s') ?> GMT</lastBuildDate> + <atom:link href="<?= Minz_Url::display($this->url, 'html', true) ?>" rel="self" type="application/rss+xml" /> <?php foreach ($this->entries as $item) { ?> <item> - <title><?php echo $item->title(); ?></title> - <link><?php echo $item->link(); ?></link> + <title><?= $item->title() ?></title> + <link><?= $item->link() ?></link> <?php $authors = $item->authors(); if (is_array($authors)) { @@ -30,8 +30,8 @@ foreach ($this->entries as $item) { <description><![CDATA[<?php echo $item->content(); ?>]]></description> - <pubDate><?php echo date('D, d M Y H:i:s O', $item->date(true)); ?></pubDate> - <guid isPermaLink="false"><?php echo $item->id(); ?></guid> + <pubDate><?= date('D, d M Y H:i:s O', $item->date(true)) ?></pubDate> + <guid isPermaLink="false"><?= $item->id() ?></guid> </item> <?php } ?> |
