for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Dgame\Soap\Hydrator;
use Dgame\Object\ObjectFacade;
use Dgame\Soap\AssignableInterface;
use ICanBoogie\Inflector;
/**
* Class Hydrate
* @package Dgame\Soap\Hydrator
*/
final class Hydrate extends ObjectFacade
{
* @param string $class
*
* @return Hydrate
\self
This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.
@return
public static function new(string $class): self
return new self(new $class());
}
* @param Hydrate $hydrat
$hydrat
This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.
@param
It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.
* @return bool
public function append(self $hydrat): bool
return $this->assignValue($hydrat->getClassName(), $hydrat->getObject());
* @param AssignableInterface $assignable
public function assign(AssignableInterface $assignable): bool
if ($assignable->hasValue()) {
return $this->assignValue($assignable->getName(), $assignable->getValue());
return false;
* @param string $name
* @param mixed $value
public function assignValue(string $name, $value): bool
$names = [
Inflector::get()->camelize($name, Inflector::DOWNCASE_FIRST_LETTER),
Inflector::get()->camelize($name, Inflector::UPCASE_FIRST_LETTER)
];
foreach ($names as $name) {
if ($this->setValueByMethod($name, $value) || $this->setValueByProperty($name, $value)) {
return true;
* @return string
public function getClassName(): string
return $this->getReflection()->getShortName();
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.