Replies: 1 comment
-
Thank you for taking the time to do this deep assessment and share your findings! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
After stumbling upon an issue during my first try of Valet, diagnosing the issue, exploring the source code, submitting bug reports and solutions, one thing that stood out about Valet's source code is it has a lot of inconsistent terminology across its command arguments, function parameters, variable names, and also patterns. For example, a domain/project "name" is referred to as:
directory
domain
host
link
name
site
url
valetSite
Depending on the executed command or class methods, there's different requirements and patterns throughout. For example, a registered site is resolved by:
HTTP_HOST
.link [name]
).unisolate [--site=]
).Certificates
andNginx
directories use the host name with TLD.Sites
and parked directories use the host name without TLD.Another example is the
Site::host()
andSite::domain()
methods.Site::host()
looks for a linked site given a full path and returns the path's base name.Site::domain()
ensures the TLD is present in the given string and if the given value isnull
, will fetch the current working directory's linked site base name with TLD.Overall, I think most commands/features should resolve the host name from its full path and vice versa. Terminology should be boiled down to distinguish between link name, host name (link name with TLD).
This is understandably a large task and potentially a breaking change sort of clean-up but should be considered given the eventual abandonment of PHP 7- and the complete adoption of PHP 8+. Especially with features such as named arguments. Cleaning-up the inconsistent terminology and patterns will help contributors and developers of custom additions work with Valet.
Beta Was this translation helpful? Give feedback.
All reactions