Files
FreshRSS/app/views/javascript/nbUnreadsPerFeed.phtml
Alexandre Alapetite 77e9877316 Add PHPStan (#4021)
* Add PHPStan
#fix https://github.com/FreshRSS/FreshRSS/issues/4016
https://phpstan.org/

```sh
composer run-script phpstan
```

* More fixes

* Fix global variables

* Add .phtml

* Fix merge
https://github.com/FreshRSS/FreshRSS/pull/4090

* Fix more warnings

* Fix view errors and enable in CI

* ReturnTypeWillChange

* Dynamic view type

* Fix Minz static/self bug
2021-12-31 17:00:51 +01:00

16 lines
351 B
PHTML

<?php /** @var FreshRSS_View $this */ ?>
<?php
$result = array(
'feeds' => array(),
'tags' => array(),
);
foreach ($this->categories as $cat) {
foreach ($cat->feeds() as $feed) {
$result['feeds'][$feed->id()] = $feed->nbNotRead();
}
}
foreach ($this->tags as $tag) {
$result['tags'][$tag->id()] = $tag->nbUnread();
}
echo json_encode($result);