Skip to content

🔥 Remove unused variables from test files #2821

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

Conversation

mohammadrasoulasghari
Copy link

@mohammadrasoulasghari mohammadrasoulasghari commented Mar 13, 2025

🧹 Remove unused variables from test files

In this PR I removed several unnecessary variables from test classes that were not being used. These variables were declared but never utilized in the test logic🧹.

Removing them helps with:

  1. Maintainability - cleaner code is easier to understand and modify
  2. Readability - less cognitive load when reviewing tests
  3. Code quality - follows best practices by eliminating dead code

This change doesn't affect test functionality - all tests continue to pass successfully.

Updates:

  1. remove additional variable form src/Traits/HasPermissions.php
  2. replaced assertTrue(count() > 0) with assertNotEmpty() for better readability and more descriptive test failures.📝

Cleaned up unused variables that were declared but never used throughout the test classes and in HasPermissions, improving code quality and readability.
@drbyte
Copy link
Collaborator

drbyte commented Mar 20, 2025

Thanks. However, several of the variables you've removed, while not used once defined, serve as documentation and clarification within the tests.

@drbyte drbyte closed this Apr 9, 2025
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