Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
- trailing whitespace
  • Loading branch information
weierophinney committed Aug 1, 2012
1 parent 7bdd8b8 commit a22bdcb
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 36 deletions.
28 changes: 14 additions & 14 deletions src/Hydrator/AbstractHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,44 +23,44 @@ abstract class AbstractHydrator implements HydratorInterface, StrategyEnabledInt
{
/**
* The list with strategies that this hydrator has.
*
*
* @var ArrayObject
*/
protected $strategies;

/**
* Initializes a new instance of this class.
* Initializes a new instance of this class.
*/
public function __construct()
{
$this->strategies = new ArrayObject();
}

/**
* Gets the strategy with the given name.
*
*
* @param string $name The name of the strategy to get.
* @return StrategyInterface
*/
public function getStrategy($name)
{
return $this->strategies[$name];
}

/**
* Checks if the strategy with the given name exists.
*
*
* @param string $name The name of the strategy to check for.
* @return bool
*/
public function hasStrategy($name)
{
return array_key_exists($name, $this->strategies);
}

/**
* Adds the given strategy under the given name.
*
*
* @param string $name The name of the strategy to register.
* @param StrategyInterface $strategy The strategy to register.
* @return HydratorInterface
Expand All @@ -70,10 +70,10 @@ public function addStrategy($name, StrategyInterface $strategy)
$this->strategies[$name] = $strategy;
return $this;
}

/**
* Removes the strategy with the given name.
*
*
* @param string $name The name of the strategy to remove.
* @return HydratorInterface
*/
Expand All @@ -82,10 +82,10 @@ public function removeStrategy($name)
unset($this->strategies[$name]);
return $this;
}

/**
* Converts a value for extraction. If no strategy exists the plain value is returned.
*
*
* @param string $name The name of the strategy to use.
* @param mixed $value The value that should be converted.
* @return mixed
Expand All @@ -98,10 +98,10 @@ public function extractValue($name, $value)
}
return $value;
}

/**
* Converts a value for hydration. If no strategy exists the plain value is returned.
*
*
* @param string $name The name of the strategy to use.
* @param mixed $value The value that should be converted.
* @return mixed
Expand Down
2 changes: 1 addition & 1 deletion src/Hydrator/Reflection.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function extract($object)
$result = array();
foreach(self::getReflProperties($object) as $property) {
$propertyName = $property->getName();

$value = $property->getValue($object);
$result[$propertyName] = $this->extractValue($propertyName, $value);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Hydrator/Strategy/DefaultStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class DefaultStrategy implements StrategyInterface
{
/**
* Converts the given value so that it can be extracted by the hydrator.
*
*
* @param mixed $value The original value.
* @return mixed Returns the value that should be extracted.
*/
Expand All @@ -30,7 +30,7 @@ public function extract($value)

/**
* Converts the given value so that it can be hydrated by the hydrator.
*
*
* @param mixed $value The original value.
* @return mixed Returns the value that should be hydrated.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Hydrator/Strategy/StrategyInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ interface StrategyInterface
{
/**
* Converts the given value so that it can be extracted by the hydrator.
*
*
* @param mixed $value The original value.
* @return mixed Returns the value that should be extracted.
*/
public function extract($value);

/**
* Converts the given value so that it can be hydrated by the hydrator.
*
*
* @param mixed $value The original value.
* @return mixed Returns the value that should be hydrated.
*/
Expand Down
8 changes: 4 additions & 4 deletions src/Hydrator/StrategyEnabledInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ interface StrategyEnabledInterface
{
/**
* Adds the given strategy under the given name.
*
*
* @param string $name The name of the strategy to register.
* @param StrategyInterface $strategy The strategy to register.
* @return HydratorInterface
Expand All @@ -30,23 +30,23 @@ public function addStrategy($name, StrategyInterface $strategy);

/**
* Gets the strategy with the given name.
*
*
* @param string $name The name of the strategy to get.
* @return StrategyInterface
*/
public function getStrategy($name);

/**
* Checks if the strategy with the given name exists.
*
*
* @param string $name The name of the strategy to check for.
* @return bool
*/
public function hasStrategy($name);

/**
* Removes the strategy with the given name.
*
*
* @param string $name The name of the strategy to remove.
* @return HydratorInterface
*/
Expand Down
10 changes: 5 additions & 5 deletions test/TestAsset/HydratorStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ class HydratorStrategy extends DefaultStrategy
{
/**
* A simulated storage device which is just an array with Car objects.
*
*
* @var array
*/
private $simulatedStorageDevice;

public function __construct()
{
$this->simulatedStorageDevice = array();
$this->simulatedStorageDevice[] = new HydratorStrategyEntityB(111, 'AAA');
$this->simulatedStorageDevice[] = new HydratorStrategyEntityB(222, 'BBB');
$this->simulatedStorageDevice[] = new HydratorStrategyEntityB(333, 'CCC');
}

public function extract($value)
{
$result = array();
Expand All @@ -37,7 +37,7 @@ public function extract($value)
}
return $result;
}

public function hydrate($value)
{
$result = $value;
Expand All @@ -49,7 +49,7 @@ public function hydrate($value)
}
return $result;
}

private function findEntity($field1)
{
$result = null;
Expand Down
6 changes: 3 additions & 3 deletions test/TestAsset/HydratorStrategyEntityA.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class HydratorStrategyEntityA implements InputFilterAwareInterface
{
public $entities; // public to make testing easier!
private $inputFilter; // used to test forms

public function __construct()
{
$this->entities = array();
Expand All @@ -46,14 +46,14 @@ public function getInputFilter()
$input = new Input();
$input->setName('entities');
$input->setRequired(false);

$this->inputFilter = new InputFilter();
$this->inputFilter->add($input);
}

return $this->inputFilter;
}

public function setInputFilter(InputFilterInterface $inputFilter)
{
$this->inputFilter = $inputFilter;
Expand Down
10 changes: 5 additions & 5 deletions test/TestAsset/HydratorStrategyEntityB.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,29 @@ class HydratorStrategyEntityB
{
private $field1;
private $field2;

public function __construct($field1, $field2)
{
$this->field1 = $field1;
$this->field2 = $field2;
}

public function getField1()
{
return $this->field1;
}

public function getField2()
{
return $this->field2;
}

public function setField1($value)
{
$this->field1 = $value;
return $this;
}

public function setField2($value)
{
$this->field2 = $value;
Expand Down

0 comments on commit a22bdcb

Please sign in to comment.