20 Commits

Author SHA1 Message Date
Luc SANCHEZ
15745d42b7 Upgrade code to php 8.1 (#6748)
* revert
Fix code indentation
Fix code

Upgrade code to php 8.1

* fix remarques

* code review

* code review

* code review

* Apply suggestions from code review

* code review

* Fixes

* Many remainging updates of array syntax

* Lost case 'reading-list'

* Uneeded PHPDoc

---------

Co-authored-by: Luc Sanchez <l.sanchez-prestataire@alptis.fr>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2024-11-28 17:11:04 +01:00
Alexandre Alapetite
d2247221bb Minor update whitespace PHPCS rules (#6666)
* Minor update whitespace PHPCS rules
To simplify our configuration, apply more rules, and be clearer about what is added or removed compared with PSR12.
Does not change our current conventions, but just a bit more consistent.

* Forgotten *.phtml

* Sort exclusion patterns + add a few for Extensions repo

* Relaxed some rules
2024-08-01 20:31:40 +02:00
Luc SANCHEZ
30c7a61a9b Use strict_types (#5830)
* Little's optimisations and booleans in conditions

* Apply strict type

* Apply strict type

* Apply strict type

* Fix multiple bugs with PHP 8.2 and 8.3

* Many declares missing, more errors fixed

* Apply strict type

* Another approach

* Stronger typing for Minz_Session

* Fix case of SQLite

---------

Co-authored-by: Luc <sanchezluc+freshrss@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-11-16 22:43:00 +01:00
Luc SANCHEZ
f8f163d054 Chore/processing of depreciations and updating code to php72 minimum (#5504)
* processing of depreciations and updating of code to php7.2 minimum

* Autoformat many strange array indenting
And revert a few unwanted changes

---------

Co-authored-by: Luc <sanchezluc+freshrss@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-07-07 22:36:27 +02:00
Luc SANCHEZ
247215ffaa Typehint some Controllers (#5106)
* Typehint to Controllers

* Remarque's from Alkarex

* Remarque's from Alkarex

* Remarque's from Alkarex

* Remarque's from Alkarex

* Remarque's from Alkarex

* Remarque's from Alkarex

---------

Co-authored-by: Luc <sanchezluc+freshrss@gmail.com>
2023-03-21 18:57:57 +01:00
Alexandre Alapetite
1335a0e3cf PHPStan level 5 (#4110)
* Fix most PHPDocs errors
Contributes to https://github.com/FreshRSS/FreshRSS/issues/4103
https://phpstan.org/writing-php-code/phpdoc-types

* Avoid func_get_args
Use variadic syntax instead https://php.net/manual/functions.arguments#functions.variable-arg-list
And avoid dynamic functions names when possible to more easily identify calls and unused functions.
Contributes to https://github.com/FreshRSS/FreshRSS/issues/4103

* PHPStan level 3

* PHPStand level 4

* Update default to PHPStan level 4

* Towards level 5

* Fix level 4 regression

* Towards level 5

* Pass PHPStan level 5

* Towards level 6

* Remove erronenous regression from changelog
https://github.com/FreshRSS/FreshRSS/pull/4116
2022-01-04 13:59:09 +01:00
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
Alexandre Alapetite
e61cc3153a Additional HTTP error codes (#3981) 2021-11-15 13:44:14 +01:00
Alexandre Alapetite
9c6682e7ed Avoid manual initialisations of system or user configuration (#3070)
* Avoid manual intialisations of system or user configuration

More consistent use of Context

* Simplify FreshRSS_Context::initUser

* Remove a few manual get_user_configuration

* A bit of debugging

* Fix context user init

* Fix install

* Fix concurrency

Concurrent requests could lead to bad race condition

* Fix actualize cron

Fix case when system i initialised several times
2021-01-02 21:20:19 +01:00
Alexandre Alapetite
0319cc9d23 Minz allow parallel sessions (#3096)
* Minz allow parallel sessions

#fix https://github.com/FreshRSS/FreshRSS/issues/3093

* Array optimisation

* Array optimisation missing

* Reduce direct access to $_SESSION except in install process

* Fix session start headers warning

* Use cookie only the first time the session is started:
`PHP Warning:  session_start(): Cannot start session when headers
already sent in /var/www/FreshRSS/lib/Minz/Session.php on line 39`

* New concept of volatile session for API calls

Optimisation: do not use cookies or local storage at all for API calls
without a Web session
Fix warning:

```
PHP Warning:  session_destroy(): Trying to destroy uninitialized session
in Unknown on line 0
```

* Only call Minz_Session::init once in our index

It was called twice (once indirectly via FreshRSS->init())

* Whitespace

* Mutex for notifications

Implement mutex for notifications
https://github.com/FreshRSS/FreshRSS/pull/3208#discussion_r499509809

* Typo

* Install script is not ready for using Minz_Session
2020-10-06 23:19:45 +02:00
Marien Fressinaud
d91a92434f Fix Minz_Error and error_Controller
- Error code and logs was not propagated from Minz_Error to the controller
- header was bad (200 instead of 404 or 403)

Related to https://github.com/FreshRSS/FreshRSS/issues/751
2015-01-18 11:47:16 +01:00
Marien Fressinaud
fee1ae997a Fix i18n for conf, entry, error, feed Controllers 2014-12-11 19:02:05 +01:00
Marien Fressinaud
8a7bab3a55 Refactoring of indexController
Global view has been moved to a different action (all is not working)

See https://github.com/marienfressinaud/FreshRSS/issues/634
and https://github.com/marienfressinaud/FreshRSS/issues/655
2014-10-20 19:35:22 +02:00
Marien Fressinaud
34151ea1ae Add comments in error and importExport controllers
See https://github.com/marienfressinaud/FreshRSS/issues/655
2014-10-06 13:12:36 +02:00
Marien Fressinaud
f5a95d383c Coding style errorController 2014-10-05 21:16:06 +02:00
Marien Fressinaud
9a0d01be0c Coding style
Remove spaces before parenthesis.

See https://github.com/marienfressinaud/FreshRSS/issues/655
2014-10-05 18:24:28 +02:00
Marien Fressinaud
6c8b36f04e Let's begin the big refactoring!
Minz_Translate::t\s? replaces by _t

See https://github.com/marienfressinaud/FreshRSS/issues/655
2014-10-05 15:55:20 +02:00
Alexandre Alapetite
35be1769de Basic protection against XSRF using Referer
https://github.com/marienfressinaud/FreshRSS/issues/554
Also edited the error controler to use the log message passed in
Minz_Error::error().
2014-08-01 20:20:25 +02:00
Alexandre Alapetite
b381d2a592 Un peu de typographie
* Remplace les tirets de soustraction par points médians ou des tirets
cadratins (si c'est trop long, nous pourrions mettre des
demi-cadratins).
* Met les abréviations des jours anglais en exposant, comme
`3<sup>rd</sup>`
2014-01-07 20:38:45 +01:00
Alexandre Alapetite
b4463cb69e Problème casse renommage répertoire 2013-12-15 11:28:27 +01:00