You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add new Share class to setup the supported share tools and communicate with the share tool classes.
Added:
- Add new `Share` class which holds various methods to set and get the share tools (eg. ngrok), and create the share tool class instance to be able to chain their methods.
- Add new `ShareTool` abstract class in the new `ShareTools` directory, with the namespace `Valet\ShareTools`. It acts as the base/parent class that all other share tool classes will extend. It declares abstract methods that requires the child classes to implement, like `start`, `run`, and `getConfig`.
The class also holds shared methods like `currentTunnelUrl` and `findHttpTunnelUrl` that don't need to be implemented by the child classes because the code doesn't need to be changed.
- Add the new `Share` class to the facades.php.
Changed:
- Move `Ngrok` class into the `ShareTools` directory, and changing it's namespace and it extends the new `ShareTool` class.
- Move the `currentTunnelUrl` and `findHttpTunnelUrl` methods from Ngrok to the parent `ShareTool` class.
- Change `getNgrokConfig` method name to the new `getConfig`. Also change all references to the method.
- Change the `Facade` class to check if the class called is `Ngrok`, and append the `ShareTools` string to the default `Valet` namespace to create the ShareTools namespace. This is so that we can call Ngrok methods statically in the main valet.php file. Like `Ngrok::run` for the `ngrok` command.
0 commit comments