Skip to content

Commit

Permalink
Add deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianallgeier committed Jun 17, 2024
1 parent 65fb0b6 commit 589be73
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Content/Translation.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public function __debugInfo(): array
*/
public function code(): string
{
Helpers::deprecated('`$translation->code()` has been deprecated. Use `$translation->language()->code()` instead.', 'translation-code');
return $this->language->code();
}

Expand All @@ -56,6 +57,7 @@ public function code(): string
*/
public function content(): array
{
Helpers::deprecated('`$translation->content()` has been deprecated. Use `$translation->version()->content()` instead.', 'translation-content');
return $this->version->content($this->language)->toArray();
}

Expand All @@ -66,6 +68,7 @@ public function content(): array
*/
public function contentFile(): string
{
Helpers::deprecated('`$translation->contentFile()` has been deprecated. Use `$translation->version()->contentFile()` instead.', 'translation-contentFile');
return $this->version->contentFile($this->language);
}

Expand Down Expand Up @@ -100,6 +103,7 @@ public static function create(
*/
public function exists(): bool
{
Helpers::deprecated('`$translation->exists()` has been deprecated. Use `$translation->version()->exists()` instead.', 'translation-exists');
return $this->version->exists($this->language);
}

Expand All @@ -119,6 +123,7 @@ public function id(): string
*/
public function isDefault(): bool
{
Helpers::deprecated('`$translation->isDefault()` has been deprecated. Use `$translation->language()->isDefault()` instead.', 'translation-isDefault');
return $this->language->isDefault();
}

Expand Down

0 comments on commit 589be73

Please sign in to comment.