mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-04 23:42:34 +00:00
Add phpstan level 7(#544)
This commit is contained in:
@ -114,7 +114,7 @@ private function deployAction(): Action
|
||||
{
|
||||
return Action::make('deploy')
|
||||
->icon('heroicon-o-rocket-launch')
|
||||
->action(function () {
|
||||
->action(function (): void {
|
||||
if (! $this->site->deploymentScript?->content) {
|
||||
Notification::make()
|
||||
->danger()
|
||||
@ -123,7 +123,7 @@ private function deployAction(): Action
|
||||
|
||||
return;
|
||||
}
|
||||
run_action($this, function () {
|
||||
run_action($this, function (): void {
|
||||
app(Deploy::class)->run($this->site);
|
||||
|
||||
Notification::make()
|
||||
@ -139,12 +139,12 @@ private function deployAction(): Action
|
||||
private function autoDeploymentAction(): Action
|
||||
{
|
||||
return Action::make('auto-deployment')
|
||||
->label(fn () => $this->site->isAutoDeployment() ? 'Disable Auto Deployment' : 'Enable Auto Deployment')
|
||||
->modalHeading(fn () => $this->site->isAutoDeployment() ? 'Disable Auto Deployment' : 'Enable Auto Deployment')
|
||||
->modalIconColor(fn () => $this->site->isAutoDeployment() ? 'red' : 'green')
|
||||
->label(fn (): string => $this->site->isAutoDeployment() ? 'Disable Auto Deployment' : 'Enable Auto Deployment')
|
||||
->modalHeading(fn (): string => $this->site->isAutoDeployment() ? 'Disable Auto Deployment' : 'Enable Auto Deployment')
|
||||
->modalIconColor(fn (): string => $this->site->isAutoDeployment() ? 'red' : 'green')
|
||||
->requiresConfirmation()
|
||||
->action(function () {
|
||||
run_action($this, function () {
|
||||
->action(function (): void {
|
||||
run_action($this, function (): void {
|
||||
$this->site->isAutoDeployment()
|
||||
? $this->site->disableAutoDeployment()
|
||||
: $this->site->enableAutoDeployment();
|
||||
@ -168,8 +168,8 @@ private function deploymentScriptAction(): Action
|
||||
->default($this->site->deploymentScript?->content)
|
||||
->rules(UpdateDeploymentScript::rules()['script']),
|
||||
])
|
||||
->action(function (array $data) {
|
||||
run_action($this, function () use ($data) {
|
||||
->action(function (array $data): void {
|
||||
run_action($this, function () use ($data): void {
|
||||
app(UpdateDeploymentScript::class)->update($this->site, $data);
|
||||
|
||||
Notification::make()
|
||||
@ -188,15 +188,13 @@ private function dotEnvAction(): Action
|
||||
->modalHeading('Update .env file')
|
||||
->form([
|
||||
CodeEditorField::make('env')
|
||||
->formatStateUsing(function () {
|
||||
return $this->site->getEnv();
|
||||
})
|
||||
->formatStateUsing(fn (): string => $this->site->getEnv())
|
||||
->rules([
|
||||
'env' => 'required',
|
||||
]),
|
||||
])
|
||||
->action(function (array $data) {
|
||||
run_action($this, function () use ($data) {
|
||||
->action(function (array $data): void {
|
||||
run_action($this, function () use ($data): void {
|
||||
app(UpdateEnv::class)->update($this->site, $data);
|
||||
|
||||
Notification::make()
|
||||
@ -219,8 +217,8 @@ private function branchAction(): Action
|
||||
->default($this->site->branch)
|
||||
->rules(UpdateBranch::rules()['branch']),
|
||||
])
|
||||
->action(function (array $data) {
|
||||
run_action($this, function () use ($data) {
|
||||
->action(function (array $data): void {
|
||||
run_action($this, function () use ($data): void {
|
||||
app(UpdateBranch::class)->update($this->site, $data);
|
||||
|
||||
Notification::make()
|
||||
|
Reference in New Issue
Block a user