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

๐Ÿ› ๏ธ Refactor and improvements #1

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

DRSDavidSoft
Copy link
Owner

Refactor PHP and shell scripts

Description

This pull request contains two commits that refactor the PHP and shell scripts to make them more readable, maintainable, and efficient.

The first commit optimizes the PHP code with constants and comments. It also simplifies the loop logic and avoids using global variables.

The second commit simplifies the shell script with variables and conditions. It also uses a more reliable method to get the script directory and handles different operating system types.

Changes

  • Define a constant to store the CLI mode status in PHP
  • Use a while loop instead of a do-while loop in PHP
  • Use absolute paths instead of chdir() in PHP
  • Add comments to explain the code logic in PHP
  • Use variables to store the operating system type and paths in shell
  • Use a single if statement to check the operating system type in shell
  • Use readlink to get the absolute path of the script directory in shell
  • Add comments to explain the code logic in shell

Testing

The refactored scripts have been tested on Windows and Linux systems with different versions of Laravel and PHP. They work as expected and produce the same results as the original scripts.

@DRSDavidSoft DRSDavidSoft self-assigned this May 11, 2023
@DRSDavidSoft DRSDavidSoft marked this pull request as ready for review July 25, 2023 06:58
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.

1 participant