fix bitbucket (#119)

Fix Bitbucket API errors
This commit is contained in:
Saeed Vaziry
2024-03-17 11:36:04 +01:00
committed by GitHub
parent f0c4fc4812
commit b07ae470f9
10 changed files with 167 additions and 45 deletions

View File

@ -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