mirror of
https://github.com/vitodeploy/vito.git
synced 2025-06-30 21:46:16 +00:00
@ -17,6 +17,35 @@ public function __construct(SourceControl $sourceControl)
|
||||
$this->sourceControl = $sourceControl;
|
||||
}
|
||||
|
||||
public function createRules(array $input): array
|
||||
{
|
||||
return [
|
||||
'token' => 'required',
|
||||
'url' => [
|
||||
'nullable',
|
||||
'url:http,https',
|
||||
'ends_with:/',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
public function createData(array $input): array
|
||||
{
|
||||
return [
|
||||
'token' => $input['token'] ?? '',
|
||||
];
|
||||
}
|
||||
|
||||
public function data(): array
|
||||
{
|
||||
// support for older data
|
||||
$token = $this->sourceControl->access_token ?? '';
|
||||
|
||||
return [
|
||||
'token' => $this->sourceControl->provider_data['token'] ?? $token,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws SourceControlIsNotConnected
|
||||
* @throws RepositoryNotFound
|
||||
|
Reference in New Issue
Block a user