"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "public_html/lists/base/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateIntervalToArrayTransformer.php" between
phplist-3.4.5.tgz and phplist-3.4.6.tgz

About: phpList is a one-way email announcement delivery system for newsletters, publicity lists, notifications, and many other uses (requires PHP and MySQL).

DateIntervalToArrayTransformer.php  (phplist-3.4.5.tgz):DateIntervalToArrayTransformer.php  (phplist-3.4.6.tgz)
skipping to change at line 109 skipping to change at line 109
$result = array_intersect_key($result, array_flip($this->fields)); $result = array_intersect_key($result, array_flip($this->fields));
return $result; return $result;
} }
/** /**
* Transforms an interval array into a normalized date interval. * Transforms an interval array into a normalized date interval.
* *
* @param array $value Interval array * @param array $value Interval array
* *
* @return \DateInterval Normalized date interval * @return \DateInterval|null Normalized date interval
* *
* @throws UnexpectedTypeException if the given value is not an array * @throws UnexpectedTypeException if the given value is not an array
* @throws TransformationFailedException if the value could not be transform ed * @throws TransformationFailedException if the value could not be transform ed
*/ */
public function reverseTransform($value) public function reverseTransform($value)
{ {
if (null === $value) { if (null === $value) {
return; return null;
} }
if (!\is_array($value)) { if (!\is_array($value)) {
throw new UnexpectedTypeException($value, 'array'); throw new UnexpectedTypeException($value, 'array');
} }
if ('' === implode('', $value)) { if ('' === implode('', $value)) {
return; return null;
} }
$emptyFields = []; $emptyFields = [];
foreach ($this->fields as $field) { foreach ($this->fields as $field) {
if (!isset($value[$field])) { if (!isset($value[$field])) {
$emptyFields[] = $field; $emptyFields[] = $field;
} }
} }
if (\count($emptyFields) > 0) { if (\count($emptyFields) > 0) {
throw new TransformationFailedException(sprintf('The fields "%s" sho uld not be empty', implode('", "', $emptyFields))); throw new TransformationFailedException(sprintf('The fields "%s" sho uld not be empty', implode('", "', $emptyFields)));
} }
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)