Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make method arguments consistent with interface #76

Merged
merged 1 commit into from
Apr 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ You can configure which data will be exported in the `selectPersonalData` method
```php
// in your User model

public function selectPersonalData(PersonalDataSelection $personalDataSelection) {
public function selectPersonalData(PersonalDataSelection $personalDataSelection): void {
$personalDataSelection
->add('user.json', ['name' => $this->name, 'email' => $this->email])
->addFile(storage_path("avatars/{$this->id}.jpg"))
Expand All @@ -40,7 +40,7 @@ public function selectPersonalData(PersonalDataSelection $personalDataSelection)
You can store files in a directory of the archive. For this, add the directory path as the third parameter.

```php
public function selectPersonalData(PersonalDataSelection $personalDataSelection) {
public function selectPersonalData(PersonalDataSelection $personalDataSelection): void {
$personalDataSelection
->addFile(storage_path("avatars/{$this->id}.jpg"), directory: 'avatars');
}
Expand Down Expand Up @@ -155,7 +155,7 @@ namespace Spatie\PersonalDataExport;

interface ExportsPersonalData
{
public function selectPersonalData(PersonalDataSelection $personalData): void;
public function selectPersonalData(PersonalDataSelection $personalDataSelection): void;

public function personalDataExportName(): string;
}
Expand All @@ -166,7 +166,7 @@ The `selectPersonalData` is used to determine the content of the personal downlo
```php
// in your user model

public function selectPersonalData(PersonalDataSelection $personalData): void {
public function selectPersonalData(PersonalDataSelection $personalDataSelection): void {
$personalData
->add('user.json', ['name' => $this->name, 'email' => $this->email])
->addFile(storage_path("avatars/{$this->id}.jpg"))
Expand Down
2 changes: 1 addition & 1 deletion tests/TestClasses/InvalidUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class InvalidUser implements ExportsPersonalData

protected $table = 'users';

public function selectPersonalData(PersonalDataSelection $personalData): void
public function selectPersonalData(PersonalDataSelection $personalDataSelection): void
{
}

Expand Down
4 changes: 2 additions & 2 deletions tests/TestClasses/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ class User extends BaseUser implements ExportsPersonalData
{
use Notifiable;

public function selectPersonalData(PersonalDataSelection $personalData): void
public function selectPersonalData(PersonalDataSelection $personalDataSelection): void
{
$personalData
$personalDataSelection
->addFile(__DIR__.'/../stubs/avatar.png')
->addFile('thumbnail.png', 'user-disk')
->add('attributes.json', $this->attributesToArray());
Expand Down