Skip to content

Instantly share code, notes, and snippets.

@pedrochaves
Last active August 29, 2015 14:24
Show Gist options
  • Save pedrochaves/3bd8d2adcfadb186876f to your computer and use it in GitHub Desktop.
Save pedrochaves/3bd8d2adcfadb186876f to your computer and use it in GitHub Desktop.
namespaces
<?php
// Google/Client.php
class Google_Client
{
}
// Google/Service/Drive.php
class Google_Service_Drive
{
}
// Google/Service/Calendar.php
class Google_Service_Calendar
{
}
<?php
// Arquivo Google/Service/Calendar
namespace Google\Service;
use Google\Client; // A classe está no arquivo Google/Client.php;
class Calendar
{
private $client;
public function __construct(Client $client)
{
$this->client = $client;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment