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

add declaration of dynamically declared variables, which is deprecated #4

Open
wants to merge 3 commits into
base: P3C6-correction
Choose a base branch
from

Conversation

Teosany
Copy link

@Teosany Teosany commented Feb 29, 2024

No description provided.

Comment on lines +23 to +24
private mixed $scorePlayerA = NULL;
private mixed $scorePlayerB = NULL;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mixed is rarely a good idea unless you are creating a really abstract code for a framework or an open source module. it is way too permissive. keeping things closer to what you expect will avoid weird types to be set by mistake.

Suggested change
private mixed $scorePlayerA = NULL;
private mixed $scorePlayerB = NULL;
private ?int $scorePlayerA = null;
private ?int $scorePlayerB = null;

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

Successfully merging this pull request may close these issues.

2 participants