Skip to content

Instantly share code, notes, and snippets.

@HamHamFonFon
Created February 11, 2024 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HamHamFonFon/6a6e494e2e0457dfdfd9b3beda08e83f to your computer and use it in GitHub Desktop.
Save HamHamFonFon/6a6e494e2e0457dfdfd9b3beda08e83f to your computer and use it in GitHub Desktop.
final class Dog extends Animal
{
private readonly string $noise = 'barks';
protected fonction makeNoise(): string
{
return $this->noise;
}
}
final class Cat extends Animal
{
}
final class Bird extends Animal
{
}
abstract class Animal
{
abstract protected fonction makeNoise(): string;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment