testing php storm code cleanup and styling

This commit is contained in:
Andras Bacsai
2023-08-08 11:51:36 +02:00
parent a8ee779b31
commit f2228cec7b
368 changed files with 23834 additions and 2623 deletions

View File

@@ -15,13 +15,10 @@ use Spatie\Url\Url;
class PublicGitRepository extends Component
{
public string $repository_url;
private object $repository_url_parsed;
public int $port = 3000;
public string $type;
public $parameters;
public $query;
public bool $branch_found = false;
public string $selected_branch = 'main';
public bool $is_static = false;
@@ -29,11 +26,6 @@ class PublicGitRepository extends Component
public string $git_branch = 'main';
public int $rate_limit_remaining = 0;
public $rate_limit_reset = 0;
private GithubApp|GitlabApp $git_source;
private string $git_host;
private string $git_repository;
protected $rules = [
'repository_url' => 'required|url',
'port' => 'required|numeric',
@@ -46,6 +38,11 @@ class PublicGitRepository extends Component
'is_static' => 'static',
'publish_directory' => 'publish directory',
];
private object $repository_url_parsed;
private GithubApp|GitlabApp $git_source;
private string $git_host;
private string $git_repository;
public function mount()
{
if (isDev()) {
@@ -67,12 +64,7 @@ class PublicGitRepository extends Component
}
$this->emit('success', 'Application settings updated!');
}
private function get_branch()
{
['rate_limit_remaining' => $this->rate_limit_remaining, 'rate_limit_reset' => $this->rate_limit_reset] = git_api(source: $this->git_source, endpoint: "/repos/{$this->git_repository}/branches/{$this->git_branch}");
$this->rate_limit_reset = Carbon::parse((int)$this->rate_limit_reset)->format('Y-M-d H:i:s');
$this->branch_found = true;
}
public function load_branch()
{
$this->branch_found = false;
@@ -96,6 +88,7 @@ class PublicGitRepository extends Component
}
}
}
private function get_git_source()
{
$this->repository_url_parsed = Url::fromString($this->repository_url);
@@ -111,6 +104,14 @@ class PublicGitRepository extends Component
// Not supported yet
}
}
private function get_branch()
{
['rate_limit_remaining' => $this->rate_limit_remaining, 'rate_limit_reset' => $this->rate_limit_reset] = git_api(source: $this->git_source, endpoint: "/repos/{$this->git_repository}/branches/{$this->git_branch}");
$this->rate_limit_reset = Carbon::parse((int)$this->rate_limit_reset)->format('Y-M-d H:i:s');
$this->branch_found = true;
}
public function submit()
{
try {