Last active
April 4, 2018 06:46
-
-
Save ahmed-abid/f7a0fc710c03b1f5f9ee1bcb33b9a035 to your computer and use it in GitHub Desktop.
No Dependency Injection Needed
This file contains 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 App\Core\Test; | |
use UserModel; | |
/** | |
* My Class : example to show the case of no dependency injection | |
* | |
* Class MyClass | |
* | |
* @package App\Core\Test | |
* | |
*/ | |
class MyClass | |
{ | |
/** | |
* getName | |
* | |
* @return string $name | |
* | |
*/ | |
public function getName() : string | |
{ | |
$user = new UserModel(); | |
$name = $user->tableName(); | |
return $name; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment