protected function _generateArgs( $args, $definitions, &$callbacks = array() ) {
		foreach ( $definitions as $field => $generator ) {
			if ( isset( $args[ $field ] ) ) {
				continue;
			}

			if ( is_scalar( $generator ) ) {
				$args[ $field ] = $generator;
			} elseif ( $generator instanceof AfterCreateCallback ) {
				$callbacks[ $field ] = $generator;
			} elseif ( $generator instanceof Sequence ) {
				$args[ $field ] = $generator->next();
			} else {
				return new \WP_Error( 'invalid_argument', 'Factory default value should be either a scalar or an generator object.' );
			}
		}

		return $args;
	}
protected function _generateArgs( $args, $definitions, &$callbacks = array() ) {
		foreach ( $definitions as $field => $generator ) {
			if ( isset( $args[ $field ] ) ) {
				continue;
			}

			if ( is_scalar( $generator ) ) {
				$args[ $field ] = $generator;
			} elseif ( $generator instanceof AfterCreateCallback ) {
				$callbacks[ $field ] = $generator;
			} elseif ( $generator instanceof Sequence ) {
				$args[ $field ] = $generator->next();
			} else {
				return new \WP_Error( 'invalid_argument', 'Factory default value should be either a scalar or an generator object.' );
			}
		}

		return $args;
	}
protected function _generateArgs ( $ args , $ definitions , & $ callbacks = array ( ) ) { foreach ( $ definitions as $ field => $ generator ) { if ( isset ( $ args [ $ field ] ) ) { continue ; } if ( is_scalar ( $ generator ) ) { $ args [ $ field ] = $ generator ; } elseif ( $ generator instanceof AfterCreateCallback ) { $ callbacks [ $ field ] = $ generator ; } elseif ( $ generator instanceof Sequence ) { $ args [ $ field ] = $ generator -> next ( ) ; } else { return new \ WP_Error ( 'invalid_argument' , 'Factory default value should be either a scalar or an generator object.' ) ; } } return $ args ; }
Generates arguments for a new object.

@since 1.0.0

@access protected
@param array $args The initial set of arguments.
@param array $definitions The definitions for auto generated properties.
@param array $callbacks The array of callbacks.
@return array|\WP_Error The array of arguments on success, otherwise a WP_Error object.
Generates arguments for a new object .