for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* YAWIK
*
* @filesource
* @license MIT
* @copyright 2013 - 2017 Cross Solution <http://cross-solution.de>
*/
/** */
namespace Jobs\Form\Hydrator\Strategy;
use Zend\Hydrator\Strategy\StrategyInterface;
* ${CARET}
* @author Mathias Gelhausen <[email protected]>
* @todo write test
class JobManagerStrategy implements StrategyInterface
{
* @var array
private $metaData = [];
public function extract($value)
$this->metaData = $value;
$value
array
$metaData
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..
if (!isset($value['organizations:managers'])) { return []; }
$ids = [];
foreach ($value['organizations:managers'] as $manager) {
$ids[] = $manager['id'];
}
return $ids;
* Converts the given value so that it can be hydrated by the hydrator.
* @param mixed $value The original value.
* @param array $data (optional) The original data for context.
$data
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter $italy is not defined by the method finale(...).
$italy
finale(...)
/** * @param array $germany * @param array $island * @param array $italy */ function finale($germany, $island) { return "2:1"; }
The most likely cause is that the parameter was removed, but the annotation was not.
* @return mixed Returns the value that should be hydrated.
public function hydrate($value)
$metaData = $this->metaData;
$managers = [];
if ('__empty__' == $value) {
unset($metaData['organizations:managers']);
} else {
foreach ($value as $manager) {
list($id, $name, $email) = explode('|', $manager, 3);
$managers[] = [
'id' => $id,
'name' => $name,
'email' => $email,
];
$metaData['organizations:managers'] = $managers;
return $metaData;
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..