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

Incidencia - General - Evitar errores en PHP 8 por llamadas a funciones no estáticas como si lo fueran #476

Open
jordiSTIC opened this issue Nov 13, 2024 · 0 comments · May be fixed by #477
Assignees
Labels
bug Something isn't working General

Comments

@jordiSTIC
Copy link
Collaborator

Descripción del problema

Durante el desarrollo del PR #315 (Actualización del core), se ha ejecutado la herramienta Rector en todo el código de SinergiaCRM.

Se ha observado se realizan llamadas a funciones no estáticas como si éstas fueran estáticas, y esto provoca error en PHP 8: Deprecated: Non-static method should not be called statically. Es decir:

class myClass() {
  public function myMethod() {
    // ...
  }
}

myClass::myMethod(); // Deprecated: Non-static method MyClass::MyMethod() should not be called statically in ... on line ...

// Debería ser:
// (new myClass())->myMethod();

Solución propuesta

Cambiar las llamadas estáticas de funciones no estáticas a llamadas de métodos de una clase instanciada

@jordiSTIC jordiSTIC added bug Something isn't working General labels Nov 13, 2024
@jordiSTIC jordiSTIC self-assigned this Nov 13, 2024
@jordiSTIC jordiSTIC linked a pull request Nov 13, 2024 that will close this issue
@jordiSTIC jordiSTIC linked a pull request Nov 26, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working General
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant