Skip to content

Commit 1d6aafe

Browse files
Copilotkawax
andcommitted
Replace static return types with self in SheetsClient and related classes
Co-authored-by: kawax <[email protected]>
1 parent 8166b6c commit 1d6aafe

File tree

5 files changed

+32
-32
lines changed

5 files changed

+32
-32
lines changed

src/Concerns/SheetsDrive.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function spreadsheetList(): array
2929
return $list;
3030
}
3131

32-
public function setDriveService(mixed $drive): static
32+
public function setDriveService(mixed $drive): self
3333
{
3434
$this->drive = $drive;
3535

src/Concerns/SheetsValues.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,28 +133,28 @@ public function ranges(): ?string
133133
return $this->range;
134134
}
135135

136-
public function range(string $range): static
136+
public function range(string $range): self
137137
{
138138
$this->range = $range;
139139

140140
return $this;
141141
}
142142

143-
public function majorDimension(string $majorDimension): static
143+
public function majorDimension(string $majorDimension): self
144144
{
145145
$this->majorDimension = $majorDimension;
146146

147147
return $this;
148148
}
149149

150-
public function valueRenderOption(string $valueRenderOption): static
150+
public function valueRenderOption(string $valueRenderOption): self
151151
{
152152
$this->valueRenderOption = $valueRenderOption;
153153

154154
return $this;
155155
}
156156

157-
public function dateTimeRenderOption(string $dateTimeRenderOption): static
157+
public function dateTimeRenderOption(string $dateTimeRenderOption): self
158158
{
159159
$this->dateTimeRenderOption = $dateTimeRenderOption;
160160

src/Contracts/Factory.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,22 @@
1111

1212
interface Factory
1313
{
14-
public function setService(mixed $service): static;
14+
public function setService(mixed $service): self;
1515

1616
public function getService(): Sheets;
1717

1818
/**
1919
* set access_token and set new service.
2020
*/
21-
public function setAccessToken(array|string $token): static;
21+
public function setAccessToken(array|string $token): self;
2222

23-
public function spreadsheet(string $spreadsheetId): static;
23+
public function spreadsheet(string $spreadsheetId): self;
2424

25-
public function spreadsheetByTitle(string $title): static;
25+
public function spreadsheetByTitle(string $title): self;
2626

27-
public function sheet(string $sheet): static;
27+
public function sheet(string $sheet): self;
2828

29-
public function sheetById(string $sheetId): static;
29+
public function sheetById(string $sheetId): self;
3030

3131
public function sheetList(): array;
3232

@@ -36,7 +36,7 @@ public function collection(array $header, array|Collection $rows): Collection;
3636

3737
public function spreadsheetList(): array;
3838

39-
public function setDriveService(mixed $drive): static;
39+
public function setDriveService(mixed $drive): self;
4040

4141
public function getDriveService(): mixed;
4242

@@ -60,11 +60,11 @@ public function append(
6060

6161
public function ranges(): ?string;
6262

63-
public function range(string $range): static;
63+
public function range(string $range): self;
6464

65-
public function majorDimension(string $majorDimension): static;
65+
public function majorDimension(string $majorDimension): self;
6666

67-
public function dateTimeRenderOption(string $dateTimeRenderOption): static;
67+
public function dateTimeRenderOption(string $dateTimeRenderOption): self;
6868

6969
public function getSpreadsheetId(): string;
7070

src/Facades/Sheets.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
use Revolution\Google\Sheets\Contracts\Factory;
1414

1515
/**
16-
* @method static static setAccessToken(array|string $token)
17-
* @method static static spreadsheet(string $spreadsheetId)
18-
* @method static static spreadsheetByTitle(string $title)
19-
* @method static static sheet(string $sheet)
20-
* @method static static sheetById(string $sheetId)
16+
* @method static self setAccessToken(array|string $token)
17+
* @method static self spreadsheet(string $spreadsheetId)
18+
* @method static self spreadsheetByTitle(string $title)
19+
* @method static self sheet(string $sheet)
20+
* @method static self sheetById(string $sheetId)
2121
* @method static array sheetList()
2222
* @method static BatchUpdateSpreadsheetResponse addSheet(string $sheetTitle)
2323
* @method static BatchUpdateSpreadsheetResponse deleteSheet(string $sheetTitle)
@@ -28,14 +28,14 @@
2828
* @method static BatchUpdateValuesResponse update(array $value, string $valueInputOption = 'RAW')
2929
* @method static ClearValuesResponse|null clear()
3030
* @method static AppendValuesResponse append(array $values, string $valueInputOption = 'RAW', string $insertDataOption = 'OVERWRITE')
31-
* @method static static range(string $range)
32-
* @method static static majorDimension(string $majorDimension)
33-
* @method static static valueRenderOption(string $valueRenderOption)
34-
* @method static static dateTimeRenderOption(string $dateTimeRenderOption)
31+
* @method static self range(string $range)
32+
* @method static self majorDimension(string $majorDimension)
33+
* @method static self valueRenderOption(string $valueRenderOption)
34+
* @method static self dateTimeRenderOption(string $dateTimeRenderOption)
3535
* @method static GoogleSheets getService()
36-
* @method static static setService(mixed $service)
36+
* @method static self setService(mixed $service)
3737
* @method static Drive getDriveService()
38-
* @method static static setDriveService(mixed $drive)
38+
* @method static self setDriveService(mixed $drive)
3939
* @method static array spreadsheetList()
4040
* @method static object spreadsheetProperties()
4141
* @method static object sheetProperties()

src/SheetsClient.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class SheetsClient implements Factory
3030

3131
protected ?string $sheet = null;
3232

33-
public function setService(mixed $service): static
33+
public function setService(mixed $service): self
3434
{
3535
$this->service = $service;
3636

@@ -45,7 +45,7 @@ public function getService(): GoogleSheets
4545
/**
4646
* set access_token and set new service.
4747
*/
48-
public function setAccessToken(#[\SensitiveParameter] array|string $token): static
48+
public function setAccessToken(#[\SensitiveParameter] array|string $token): self
4949
{
5050
Google::getCache()->clear();
5151

@@ -64,14 +64,14 @@ public function getAccessToken(): ?array
6464
return $this->getService()->getClient()->getAccessToken();
6565
}
6666

67-
public function spreadsheet(string $spreadsheetId): static
67+
public function spreadsheet(string $spreadsheetId): self
6868
{
6969
$this->spreadsheetId = $spreadsheetId;
7070

7171
return $this;
7272
}
7373

74-
public function spreadsheetByTitle(string $title): static
74+
public function spreadsheetByTitle(string $title): self
7575
{
7676
$list = $this->spreadsheetList();
7777

@@ -80,14 +80,14 @@ public function spreadsheetByTitle(string $title): static
8080
return $this;
8181
}
8282

83-
public function sheet(string $sheet): static
83+
public function sheet(string $sheet): self
8484
{
8585
$this->sheet = $sheet;
8686

8787
return $this;
8888
}
8989

90-
public function sheetById(string $sheetId): static
90+
public function sheetById(string $sheetId): self
9191
{
9292
$list = $this->sheetList();
9393

0 commit comments

Comments
 (0)