Skip to content

Instantly share code, notes, and snippets.

@Modelizer
Created August 23, 2021 20:05
Show Gist options
  • Save Modelizer/d8f06b0256275ae09c3c24fbb6a68231 to your computer and use it in GitHub Desktop.
Save Modelizer/d8f06b0256275ae09c3c24fbb6a68231 to your computer and use it in GitHub Desktop.
A reason to make her smile.
<?php
namespace World;
interface MarriageContract
{
public function engageTo(Person $partner): string;
}
class Person implements MarriageContract
{
public function __construct(public string $name) {}
public function engageTo(Person $partner): string
{
return "$this->name is engage to $partner->name. 👫";
}
}
$mudassir = new Person('Shaikh Mohammed Mudassir');
$mehek = new Person('Mehek Shaikh');
echo $mudassir->engageTo($mehek);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment