mirror of
https://github.com/laravel/valet.git
synced 2026-02-05 08:30:07 +01:00
Use constructor promotion
This commit is contained in:
@@ -17,20 +17,14 @@ class Brew
|
||||
const BREW_DISABLE_AUTO_CLEANUP = 'HOMEBREW_NO_INSTALL_CLEANUP=1';
|
||||
const LATEST_PHP_VERSION = 'php@8.2';
|
||||
|
||||
public $cli;
|
||||
public $files;
|
||||
|
||||
/**
|
||||
* Create a new Brew instance.
|
||||
*
|
||||
* @param CommandLine $cli
|
||||
* @param Filesystem $files
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(CommandLine $cli, Filesystem $files)
|
||||
public function __construct(public CommandLine $cli, public Filesystem $files)
|
||||
{
|
||||
$this->cli = $cli;
|
||||
$this->files = $files;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,16 +4,13 @@
|
||||
|
||||
class Configuration
|
||||
{
|
||||
public $files;
|
||||
|
||||
/**
|
||||
* Create a new Valet configuration class instance.
|
||||
*
|
||||
* @param Filesystem $files
|
||||
*/
|
||||
public function __construct(Filesystem $files)
|
||||
public function __construct(public Filesystem $files)
|
||||
{
|
||||
$this->files = $files;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -51,8 +51,6 @@ class Diagnose
|
||||
'sh -c \'for file in ~/.config/valet/nginx/*; do echo "------\n~/.config/valet/nginx/$(basename $file)\n---\n"; cat $file | grep -n "# valet loopback"; echo "\n------\n"; done\'',
|
||||
];
|
||||
|
||||
public $cli;
|
||||
public $files;
|
||||
public $print;
|
||||
public $progressBar;
|
||||
|
||||
@@ -63,10 +61,8 @@ class Diagnose
|
||||
* @param Filesystem $files
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(CommandLine $cli, Filesystem $files)
|
||||
public function __construct(public CommandLine $cli, public Filesystem $files)
|
||||
{
|
||||
$this->cli = $cli;
|
||||
$this->files = $files;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,24 +4,20 @@
|
||||
|
||||
class DnsMasq
|
||||
{
|
||||
public $brew;
|
||||
public $cli;
|
||||
public $files;
|
||||
public $configuration;
|
||||
|
||||
public $dnsmasqMasterConfigFile = BREW_PREFIX.'/etc/dnsmasq.conf';
|
||||
public $dnsmasqSystemConfDir = BREW_PREFIX.'/etc/dnsmasq.d';
|
||||
public $resolverPath = '/etc/resolver';
|
||||
|
||||
/**
|
||||
* Create a new DnsMasq instance.
|
||||
* Create a new DnsMasq Instance
|
||||
*
|
||||
* @param Brew $brew
|
||||
* @param CommandLine $cli
|
||||
* @param Filesystem $files
|
||||
* @param Configuration $configuration
|
||||
*/
|
||||
public function __construct(Brew $brew, CommandLine $cli, Filesystem $files, Configuration $configuration)
|
||||
public function __construct(public Brew $brew, public CommandLine $cli, public Filesystem $files, public Configuration $configuration)
|
||||
{
|
||||
$this->cli = $cli;
|
||||
$this->brew = $brew;
|
||||
$this->files = $files;
|
||||
$this->configuration = $configuration;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,11 +7,6 @@
|
||||
|
||||
class Nginx
|
||||
{
|
||||
public $brew;
|
||||
public $cli;
|
||||
public $files;
|
||||
public $configuration;
|
||||
public $site;
|
||||
const NGINX_CONF = BREW_PREFIX.'/etc/nginx/nginx.conf';
|
||||
|
||||
/**
|
||||
@@ -22,16 +17,10 @@ class Nginx
|
||||
* @param Filesystem $files
|
||||
* @param Configuration $configuration
|
||||
* @param Site $site
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Brew $brew, CommandLine $cli, Filesystem $files,
|
||||
Configuration $configuration, Site $site)
|
||||
public function __construct(public Brew $brew, public CommandLine $cli, public Filesystem $files,
|
||||
public Configuration $configuration, public Site $site)
|
||||
{
|
||||
$this->cli = $cli;
|
||||
$this->brew = $brew;
|
||||
$this->site = $site;
|
||||
$this->files = $files;
|
||||
$this->configuration = $configuration;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,13 +7,6 @@
|
||||
|
||||
class PhpFpm
|
||||
{
|
||||
public $brew;
|
||||
public $cli;
|
||||
public $files;
|
||||
public $config;
|
||||
public $site;
|
||||
public $nginx;
|
||||
|
||||
public $taps = [
|
||||
'homebrew/homebrew-core',
|
||||
'shivammathur/php',
|
||||
@@ -28,16 +21,9 @@ class PhpFpm
|
||||
* @param Configuration $config
|
||||
* @param Site $site
|
||||
* @param Nginx $nginx
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Brew $brew, CommandLine $cli, Filesystem $files, Configuration $config, Site $site, Nginx $nginx)
|
||||
public function __construct(public Brew $brew, public CommandLine $cli, public Filesystem $files, public Configuration $config, public Site $site, public Nginx $nginx)
|
||||
{
|
||||
$this->cli = $cli;
|
||||
$this->brew = $brew;
|
||||
$this->files = $files;
|
||||
$this->config = $config;
|
||||
$this->site = $site;
|
||||
$this->nginx = $nginx;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,11 +4,13 @@
|
||||
|
||||
class Server
|
||||
{
|
||||
public $config;
|
||||
|
||||
public function __construct(array $config)
|
||||
/**
|
||||
* Create a new Server instance.
|
||||
*
|
||||
* @param array $config
|
||||
*/
|
||||
public function __construct(public array $config)
|
||||
{
|
||||
$this->config = $config;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -8,11 +8,6 @@
|
||||
|
||||
class Site
|
||||
{
|
||||
public $brew;
|
||||
public $config;
|
||||
public $cli;
|
||||
public $files;
|
||||
|
||||
/**
|
||||
* Create a new Site instance.
|
||||
*
|
||||
@@ -21,12 +16,8 @@ class Site
|
||||
* @param CommandLine $cli
|
||||
* @param Filesystem $files
|
||||
*/
|
||||
public function __construct(Brew $brew, Configuration $config, CommandLine $cli, Filesystem $files)
|
||||
public function __construct(public Brew $brew, public Configuration $config, public CommandLine $cli, public Filesystem $files)
|
||||
{
|
||||
$this->brew = $brew;
|
||||
$this->cli = $cli;
|
||||
$this->files = $files;
|
||||
$this->config = $config;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,9 +6,6 @@
|
||||
|
||||
class Valet
|
||||
{
|
||||
public $cli;
|
||||
public $files;
|
||||
|
||||
public $valetBin = BREW_PREFIX.'/bin/valet';
|
||||
|
||||
/**
|
||||
@@ -17,10 +14,8 @@ class Valet
|
||||
* @param CommandLine $cli
|
||||
* @param Filesystem $files
|
||||
*/
|
||||
public function __construct(CommandLine $cli, Filesystem $files)
|
||||
public function __construct(public CommandLine $cli, public Filesystem $files)
|
||||
{
|
||||
$this->cli = $cli;
|
||||
$this->files = $files;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user