Created
August 23, 2021 20:05
-
-
Save Modelizer/d8f06b0256275ae09c3c24fbb6a68231 to your computer and use it in GitHub Desktop.
A reason to make her smile.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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