Skip to content

Commit

Permalink
Ajustes finales
Browse files Browse the repository at this point in the history
  • Loading branch information
elmijo committed Jun 7, 2015
1 parent 3e14eb6 commit 306b82d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ use PHPTools\PHPClientAddr\PHPClientAddr;
#### 2.- Obtener los valores

```php
echo PHPClientAddr::$IP;
echo PHPClientAddr::$HOSTNAME;
$address = new PHPClientAddr();
echo $address->ip;
echo $address->hostname;
```
11 changes: 3 additions & 8 deletions src/PHPClientAddr/PHPClientAddr.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,11 @@ class PHPClientAddr
*/
private $env;

/**
* Constructor
* @param array $server Arreglo de valores correspondientes a la variable $_SERVER
* @param array $env Arreglo de valores correspondientes a la variable $_ENV
*/
public function __construct($server = array(), $env = array())
public function __construct()
{
$this->server = $server;
$this->server = $_SERVER;

$this->env = $env;
$this->env = $_ENV;

$this->ip = $this->get_remode_addr();

Expand Down
2 changes: 1 addition & 1 deletion tests/PHPClientAddrTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class PHPClientAddrTest extends PHPUnit_Framework_TestCase
{
protected function setUp()
{
$this->cliaddr = new PHPTools\PHPClientAddr\PHPClientAddr($_SERVER,$_ENV);
$this->cliaddr = new PHPTools\PHPClientAddr\PHPClientAddr();

$this->assertInstanceOf('PHPTools\PHPClientAddr\PHPClientAddr', $this->cliaddr);
}
Expand Down

0 comments on commit 306b82d

Please sign in to comment.