src/TypedClass.php
protected function _massageBlockInput(&$in)
	{
		if (is_string($in)) {
			$in          = json_decode($in);
			$jsonLastErr = json_last_error();
			if ($jsonLastErr !== JSON_ERROR_NONE) {
				throw new InvalidArgumentException(
					'invalid input type (string); tried as JSON: ' . json_last_error_msg(),
					$jsonLastErr
				);
			}
		}

		switch (gettype($in)) {
			case 'object':
				break;

			case 'array':
				//	Test to see if it's an indexed or an associative array.
				//	Leave associative array as is.
				//	Copy indexed array by position to a named array
				if (!empty($in) && array_values($in) === $in) {
					$newArr   = [];
					$minCount = min(count($in), $this->_count);
					for ($i = 0; $i < $minCount; ++$i) {
						$newArr[$this->_publicNames[$i]] = $in[$i];
					}

					$in = $newArr;
				}
				break;

			case 'null':
			case 'NULL':
				$in = [];
				break;

			case 'bool':
			case 'boolean':
				/** A 'false' is returned by MySQL:PDO for "no results" */
				if (false === $in) {
					/** Change false to empty array. */
					$in = [];
					break;
				}
			//	A boolean 'true' falls through.

			default:
				throw new InvalidArgumentException('invalid input type: ' . gettype($in));
		}
	}
protected function _massageBlockInput(&$in)
	{
		if (is_string($in)) {
			$in          = json_decode($in);
			$jsonLastErr = json_last_error();
			if ($jsonLastErr !== JSON_ERROR_NONE) {
				throw new InvalidArgumentException(
					'invalid input type (string); tried as JSON: ' . json_last_error_msg(),
					$jsonLastErr
				);
			}
		}

		switch (gettype($in)) {
			case 'object':
				break;

			case 'array':
				//	Test to see if it's an indexed or an associative array.
				//	Leave associative array as is.
				//	Copy indexed array by position to a named array
				if (!empty($in) && array_values($in) === $in) {
					$newArr   = [];
					$minCount = min(count($in), $this->_count);
					for ($i = 0; $i < $minCount; ++$i) {
						$newArr[$this->_publicNames[$i]] = $in[$i];
					}

					$in = $newArr;
				}
				break;

			case 'null':
			case 'NULL':
				$in = [];
				break;

			case 'bool':
			case 'boolean':
				/** A 'false' is returned by MySQL:PDO for "no results" */
				if (false === $in) {
					/** Change false to empty array. */
					$in = [];
					break;
				}
			//	A boolean 'true' falls through.

			default:
				throw new InvalidArgumentException('invalid input type: ' . gettype($in));
		}
	}
Check if the input data is good or needs to be massaged.

Indexed arrays ARE COPIED BY POSITION starting with the first sudo-public
property (property names not starting with an underscore). Extra values
are ignored. Unused properties are unchanged.

@param $in

@return object|array
@throws InvalidArgumentException