Skip to content

Commit

Permalink
Cleaned up the code of the Hydrator class. Added some enters and spac…
Browse files Browse the repository at this point in the history
…es here and there.
  • Loading branch information
johnnymast committed Sep 6, 2016
1 parent b212517 commit ddb9ef2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
3 changes: 2 additions & 1 deletion README.md
@@ -1,6 +1,7 @@
![redbox-logo-klein](https://cloud.githubusercontent.com/assets/121194/18277406/ac4d9868-744e-11e6-8994-86943704d0d4.png)



[![Build Status](https://travis-ci.org/johnnymast/redbox-hydrator.svg?branch=master)](https://travis-ci.org/johnnymast/redbox-hydrator)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/johnnymast/redbox-hydrator/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/johnnymast/redbox-hydrator/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/johnnymast/redbox-hydrator/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/johnnymast/redbox-hydrator/?branch=master)
Expand All @@ -19,7 +20,7 @@ I have gone to great length to provide a special (read sexy) and tiny API for yo
### Static class method

In this example we will hydrate a new instance of class User and return it as $result1 using with with() function.

```php
use Redbox\Hydrate\Hydrator;

Expand Down
3 changes: 2 additions & 1 deletion examples/example.php
Expand Up @@ -2,6 +2,7 @@
require 'autoload.php';

use Redbox\Hydrate\Hydrator;
use function Redbox\Hydrate\Helpers\Hydrate;

class User {
protected $username = '';
Expand Down Expand Up @@ -60,5 +61,5 @@ public function getPassword()
* Dump what ever you want
*/
//var_dump($result1);
//var_dump($result2);
var_dump($result2);
//var_dump($result3);
22 changes: 10 additions & 12 deletions src/helpers/Hydrator.php
@@ -1,15 +1,13 @@
<?php
namespace Redbox\Hydrate\Helpers;
use Redbox\Hydrate\Hydrator;

if (function_exists('Hydrate') === false) {

/**
* @param $destination
* @return Hydrator
* @internal param $destination
*/
function Hydrate($destination)
{
return new Hydrator($destination);
}
}
/**
* @param $destination
* @return Hydrator
* @internal param $destination
*/
function Hydrate($destination)
{
return new Hydrator($destination);
}

0 comments on commit ddb9ef2

Please sign in to comment.