Skip to content

Instantly share code, notes, and snippets.

@ahmed-abid
Last active April 4, 2018 06:46
Show Gist options
  • Save ahmed-abid/f7a0fc710c03b1f5f9ee1bcb33b9a035 to your computer and use it in GitHub Desktop.
Save ahmed-abid/f7a0fc710c03b1f5f9ee1bcb33b9a035 to your computer and use it in GitHub Desktop.
No Dependency Injection Needed
<?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