Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibilità PHP8 - Implements Countable & Iterator #104

Open
shinesoftware opened this issue Oct 26, 2022 · 1 comment
Open

Compatibilità PHP8 - Implements Countable & Iterator #104

shinesoftware opened this issue Oct 26, 2022 · 1 comment

Comments

@shinesoftware
Copy link

shinesoftware commented Oct 26, 2022

Describe the bug
Installando il modulo ed eseguendo la creazione del file xml viene indicato un errore all'implementazione della Countable e della Iterator in alcune classi del progetto deved. Controllando il codice sorgente del file ad esempio DettaglioLinee.php si nota che non vengono dichiarate esplicitamente i valori di ritorno.

To Reproduce
Usare le classi sotto >= PHP8.0

Expected behavior
Evitare l'errore seguente:
Fatal error: During inheritance of Countable: Uncaught Exception: Deprecated Functionality: Return type of Deved\FatturaElettronica\FatturaElettronica\FatturaElettronicaBody\DatiBeniServizi\DettaglioLinee::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/deved/fattura-elettronica/src/FatturaElettronica/FatturaElettronicaBody/DatiBeniServizi/DettaglioLinee.php on line 125

Una soluzione alternativa potrebbe essere evitare il braking changes con l'impostazione della versione di PHP nel file di composer.

grazie

shinesoftware pushed a commit to shinesoftware/fattura-elettronica that referenced this issue Oct 26, 2022
@tagliamax
Copy link

Ho avuto anche io lo stesso problema, in locale, con PHP 8.1. In attesa del fix, ho temporaneamente utilizzato l'operatore @ per la soppressione degli errori.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants