{@inheritdoc}

@suppress PhanParamTooManyInternal
969074
public function fetchAll($fetch_style = null, $fetch_argument = null, $ctor_args = null)
    {
        if ($fetch_style === null) {
            return parent::fetchAll();
        }

        if ($fetch_argument === null) {
            return parent::fetchAll($fetch_style);
        }

        if ($ctor_args === null) {
            return parent::fetchAll($fetch_style, $fetch_argument);
        }

        return parent::fetchAll($fetch_style, $fetch_argument, $ctor_args);
    }
700521
private function _setParams()
	{
		foreach ($_GET as $key => $value) {
			$this->_params[$key] = $this->_sanitize($value);
		}

		foreach ($_POST as $key => $value) {
			$_POST[$key] = $this->_sanitize($value);
		}

		$nbElements = count($this->_requestVars);
		if ($nbElements > 3) {
			$i = 2;
			while ($i < $nbElements and $i + 1 < $nbElements) {
				if (ctype_digit($this->_requestVars[$i])) {
					$i += 2;
					continue;
				}

				$this->_params[$this->_requestVars[$i]] = $this->_sanitize($this->_requestVars[$i + 1]);
				$i += 2;
			}
		}

		if ($nbElements > 2) {
			$i = 2;
			while ($i < $nbElements) {
				$this->_params[$i - 2] = $this->_sanitize($this->_requestVars[$i]);
				$i++;
			}
		}

		return $this;
	}
1281272
@SuppressWarnings("unchecked")
	@Override
	public T clobParam(final String paramName, final Reader value, final int len) {
		context().clobParam(paramName, value, len);
		return (T) this;
	}
1244076
protected function fromArrayProperty($v, $p, $pn, $policy,
                                         Reader $ar,
                                         PolicyResolver $pr,
                                         EntityManagerInterface $em,
                                         \ReflectionClass $refClass) {
        $setter = $policy->setter ?: 'set'.ucfirst($pn);
        $getter = $policy->getter ?: 'get'.ucfirst($pn);
            
        if($policy instanceof Policy\Interfaces\CustomFrom) {
            if(call_user_func_array($policy->closure, [$v, $pn, $this, $em])) { return; }
        }
            
        // ========== SCALAR TYPES ==========
        if($column = $ar->getPropertyAnnotation($p, 'Doctrine\ORM\Mapping\Column')) {
            $oldV = $this->$getter();

            if($policy instanceof Policy\Interfaces\DenyUnsetFrom) {
                if($v === null) { return; } // deny set to null
                if(!$pr->isNumberType($column->type) && !$v) { 
                    // numbers can never be "empty": deny unset for non-numbers only
                    return; 
                }
            }
            
            if($policy instanceof Policy\Interfaces\DenyNewFrom) {
                if($pr->isNumberType($column->type)) {
                    // numbers can never be "empty": deny new for nullable only
                    if($oldV === null) { return; }
                } else if($v && !$oldV) { 
                    return; // deny new for other types
                }
            }
            
            if($policy instanceof Policy\Interfaces\DenyUpdateFrom) {
                if($pr->isNumberType($column->type)) { 
                    // numbers can never be "empty": deny update for non-nullable only
                    if($v !== null && $oldV !== null) { return; }
                } else if($v && $oldV) { 
                    return; // deny update for other types
                }
            }
            
            switch($column->type) {
                case 'string':
                case 'text':
                case 'guid':
                    if(is_string($v)) { $this->$setter($v); return; } break;
                case 'object':
                case 'array':
                    if(! $pr->hasOption(PolicyResolver::OPT_IGNORE_CVE_2015_0231)) {
                        throw new Exceptions\FromArrayException('Column type "'.$column->type.'" is disabled due to CVE-2015-0231.'
                                                                .'Use PolicyResolver::IGNORE_CVE_2015_0231 to ignore.');
                    }
                case 'simple_array':
                    if(is_array($v)) {
                        // @see https://github.com/doctrine/doctrine2/issues/4673
                        if((count($v) === 0) && !$column->nullable && $pr->hasOption(PolicyResolver::SIMPLE_ARRAY_FIX)) {
                            $this->$setter([null]);
                            return;
                        }
                        $this->$setter($v); return;
                    } break;
                case 'json_array':  if(is_array($v)) { $this->$setter($v); return; } break;
                case 'blob':
                    if(is_resource($v) && get_resource_type($v) == 'stream') {
                        $this->$setter($v);
                        return;
                    } else if(is_string($v)) {
                        $stream = fopen('php://memory','r+');
                        fwrite($stream, $v);
                        rewind($stream);
                        $this->$setter($stream);
                        return;
                    }
                    break;
                case 'integer':
                case 'smallint':    if(is_integer($v)) { $this->$setter($v); return; } break;
                case 'bigint':      if(is_numeric($v)) { $this->$setter($v); return; } break;
                case 'boolean':     if(is_bool($v)) { $this->$setter($v); return; } break;
                case 'decimal':     if(is_numeric($v)) { $this->$setter($v); return; } break;
                case 'float':       if(is_integer($v) || is_double($v)) { $this->$setter((double)$v); return; } break;
                case 'date':
                case 'time':
                case 'datetime':
                case 'detetimez':
                    $dt = $v;
                    if($dt) {
                        if(is_string($dt)) {
                            $dt = \DateTime::createFromFormat('Y-m-d\TH:i:s+', substr($dt, 0, 19), new \DateTimeZone('UTC'));
                        }
                        if(! $dt instanceof \DateTime) {
                            throw new Exceptions\FromArrayException('Field "'.$pn.'" must be an ISO8601 string'.($column->nullable ? ' or null' : ''));
                        }
                    } else if($column->nullable || $pr->hasOption(PolicyResolver::ALLOW_NON_NULLABLE)) {
                        $dt = null;
                    } else {
                        throw new Exceptions\FromArrayException('Field "'.$pn.'" must be an ISO8601 string');
                    }
                    $this->$setter($dt);
                    return;
            }
            if($v === null) {
                if($column->nullable || $pr->hasOption(PolicyResolver::ALLOW_NON_NULLABLE)) {
                    $this->$setter(null);
                    return;
                } else {
                    throw new Exceptions\FromArrayException('Field "'.$pn.'" cannot be null. Use PolicyResolver::ALLOW_NON_NULLABLE to ignore.');
                }
            }
            throw new Exceptions\FromArrayException('Field "'.$pn.'" must be a type of "'.$column->type.'"');
        
        // ========== RELATIONS ==========
        } else if($association = static::getPropertyAssociation($p, $ar)) {
            $this->fromArrayRelation($v, $p, $pn, $getter, $setter, $association, $policy, $ar, $pr, $em, $refClass);
            
        // ========== NON-DOCTRINE TYPE ==========
        } else {
            $this->$setter($v);
        }
    }
497732
public function resolve(
        ValueInterface $value,
        FixtureInterface $fixture,
        ResolvedFixtureSet $fixtureSet,
        array $scope,
        GenerationContext $context
    ): ResolvedValueWithFixtureSet {
        if (null === $this->argumentResolver) {
            throw ResolverNotFoundExceptionFactory::createUnexpectedCall(__METHOD__);
        }

        $functionCall = $value->getFunctionCall();
        $arguments = $functionCall->getArguments();
        foreach ($arguments as $index => $argument) {
            if ($argument instanceof ValueInterface) {
                $resolvedSet = $this->argumentResolver->resolve($argument, $fixture, $fixtureSet, $scope, $context);

                $arguments[$index] = $resolvedSet->getValue();
                $fixtureSet = $resolvedSet->getSet();
            }
        }

        $context->markAsNeedsCompleteGeneration();
        $fixtureReferenceResult = $this->argumentResolver->resolve($value->getReference(), $fixture, $fixtureSet, $scope, $context);
        $context->unmarkAsNeedsCompleteGeneration();

        /** @var ResolvedFixtureSet $fixtureSet */
        list($instance, $fixtureSet) = [$fixtureReferenceResult->getValue(), $fixtureReferenceResult->getSet()];

        try {
            $resolvedValue = $instance->{$functionCall->getName()}(...$arguments);
        } catch (\Throwable $exception) {
            if (false === method_exists($instance, $functionCall->getName())) {
                throw NoSuchMethodExceptionFactory::createForFixture($fixture, $value);
            }

            throw UnresolvableValueExceptionFactory::create($value, 0, $exception);
        }

        return new ResolvedValueWithFixtureSet(
            $resolvedValue,
            $fixtureSet
        );
    }
792317
@Override
	public int setParameter(final PreparedStatement preparedStatement, final int index,
			final BindParameterMapperManager parameterMapperManager) throws SQLException {
		return setOutParameter((CallableStatement) preparedStatement, index);
	}
32410
public function bindExecuteLastInsertId($query, $parameters = [])
    {
        $statement = $this->link->prepare($query);

        foreach ($parameters as $index => $paramProperties) {
            if (is_object($paramProperties)) {
                $paramProperties = (array) $paramProperties;
            }

            if (is_array($paramProperties)) {
                $statement->bindValue(
                    (int) $index + 1,
                    $paramProperties['value'],
                    $paramProperties['param']
                );
            } else {
                $statement->bindValue((int) $index + 1, $paramProperties);
            }
        }

        $statement->execute();

        return $this->link->lastInsertId();
    }
1201759
private function prepare()
    {
        $constantParameters = $this->uriParser->predefinedParameters();
        array_map([$this, 'prepareConstant'], $constantParameters);

        $this->filter();
        $this->sort();

        return $this;
    }
592633
public void setParam(String type, String file, String fileName, String name, String value, String disposition, String contentID, Boolean oRemoveAfterSend)
	    throws PageException {
	if (file != null) {
	    boolean removeAfterSend = (oRemoveAfterSend == null) ? remove : oRemoveAfterSend.booleanValue();

	    setMimeattach(file, fileName, type, disposition, contentID, removeAfterSend);
	}
	else {
	    if (name.equalsIgnoreCase("bcc")) setBcc(value);
	    else if (name.equalsIgnoreCase("cc")) setCc(value);
	    else if (name.equalsIgnoreCase("charset")) setCharset(CharsetUtil.toCharset(value, null));
	    else if (name.equalsIgnoreCase("failto")) setFailto(value);
	    else if (name.equalsIgnoreCase("from")) setFrom(value);
	    else if (name.equalsIgnoreCase("mailerid")) setMailerid(value);
	    else if (name.equalsIgnoreCase("mimeattach")) setMimeattach(value);
	    else if (name.equalsIgnoreCase("priority")) setPriority(value);
	    else if (name.equalsIgnoreCase("replyto")) setReplyto(value);
	    else if (name.equalsIgnoreCase("subject")) setSubject(value);
	    else if (name.equalsIgnoreCase("to")) setTo(value);

	    else smtp.addHeader(name, value);
	}
    }
1322189
public function execute(array $input_parameters = array()) {
		foreach ($input_parameters as $parameter => &$variable) {
			$this->bindParam($parameter, $variable);
		}

		$res = @oci_execute($this->stmt, $this->ociPdoAdapter->getCommitMode());
		$this->checkError($res);

		for ($i = 0; $i < $this->columnCount(); $i++) {
			$cm = $this->getColumnMeta($i);
			if (in_array($cm['native_type'], array('BLOB', 'CLOB'))) {
				array_push($this->_lobColumnsNum, $i);
				array_push($this->_lobColumnsName, $cm['name']);
			}
		}

		if (!empty($this->_lobs)) {
			foreach ($this->_lobs as &$value) {
				if ($value['input']) {
					$res = @$value['lob']->free();
					$this->checkError($res);
				}
				else {
					$value['var'] = $this->lobToStream($value['lob']);
				}
			}
			$this->_lobs = array();
			$this->_lobsCount = 0;

			$res = true;
		}

		if (!is_null($this->_cursor)) {
			$this->closeCursor();
			$this->stmt = $this->_cursor;
			$this->_cursor = null;
			$this->execute();
		}

		return $res;
	}
498273
function inheritParams(currentParams, newParams, $current, $to) {
  var parents = ancestors($current, $to), parentParams, inherited = {}, inheritList = [];

  for (var i in parents) {
    if (!parents[i].params) continue;
    // This test allows compatibility with 0.2.x and 0.3.x (optional and object params)
    parentParams = isArray(parents[i].params) ? parents[i].params : objectKeys(parents[i].params);
    if (!parentParams.length) continue;

    for (var j in parentParams) {
      if (arraySearch(inheritList, parentParams[j]) >= 0) continue;
      inheritList.push(parentParams[j]);
      inherited[parentParams[j]] = currentParams[parentParams[j]];
    }
  }
  return extend({}, inherited, newParams);
}
1070662
protected function processObject(Parameter $param, &$value)
    {
        // Ensure that the array is associative and not numerically indexed
        if (!isset($value[0]) && ($properties = $param->getProperties())) {
            $knownProperties = array();
            foreach ($properties as $property) {
                $name = $property->getName();
                $sentAs = $property->getWireName();
                $knownProperties[$name] = 1;
                if ($property->getData('xmlAttribute')) {
                    $this->processXmlAttribute($property, $value);
                } elseif (isset($value[$sentAs])) {
                    $this->recursiveProcess($property, $value[$sentAs]);
                    if ($name != $sentAs) {
                        $value[$name] = $value[$sentAs];
                        unset($value[$sentAs]);
                    }
                }
            }

            // Remove any unknown and potentially unsafe properties
            if ($param->getAdditionalProperties() === false) {
                $value = array_intersect_key($value, $knownProperties);
            }
        }
    }
1086186
protected function bindParametersFromContainer()
    {
        if ($this->parametersBound) {
            return;
        }
        $parameters = $this->parameterContainer->getNamedArray();
        foreach ($parameters as $name => &$value) {
            // if param has no errata, PDO will detect the right type
            $type = null;

            if ($this->parameterContainer->offsetHasErrata($name)) {
                switch ($this->parameterContainer->offsetGetErrata($name)) {
                    case ParameterContainer::TYPE_INTEGER:
                        $type = \PDO::PARAM_INT;
                        break;
                    case ParameterContainer::TYPE_NULL:
                        $type = \PDO::PARAM_NULL;
                        break;
                    case ParameterContainer::TYPE_DOUBLE:
                        $value = (float)$value;
                        break;
                    case ParameterContainer::TYPE_LOB:
                        $type = \PDO::PARAM_LOB;
                        break;
                }
            }

            // Parameter is named or positional, value is reference
            $parameter = is_int($name) ? ($name + 1) : $name;
            $this->resource->bindParam($parameter, $value, $type);
        }
    }
610230
protected function fromArrayRelation($v, $p, $pn, $getter, $setter,
                                                $association, $policy,
                                                Reader $ar,
                                                PolicyResolver $pr,
                                                EntityManagerInterface $em,
                                                \ReflectionClass $refClass) {
        if($v === null) { // Sub-entity as null value
            if($association instanceof OneToMany || $association instanceof ManyToMany) {
                throw new Exceptions\FromArrayException('Field "'.$pn.'" must be a Collection');
            } else if($policy instanceof Policy\Interfaces\DenyUnsetFrom
                      && ($this->$getter() !== null)) { // cannot unset Entity with this policy
                return;
            }
            $this->$setter(null);
            return;
        }
        if(is_array($v)) {
            $idField = 'id';
            $class = static::getEntityFullName($refClass, $association->targetEntity);
            if(!is_subclass_of($class, 'Indaxia\OTR\ITransformable')) {
                throw new Exceptions\FromArrayException('Entity "'.$class.'" must implement ITransformable interface');
            }
            $subPolicy = $policy;
            if($policy instanceof Policy\Interfaces\DenyFrom) {
                $subPolicy = (new Policy\From\Auto())->insideOf($policy);
            }
            
            // sub-Entity
            if($association instanceof OneToOne || $association instanceof ManyToOne)
            {
                $this->fromArrayRelationEntity($v, $p, $pn, $getter, $setter, $association, $policy,
                                   $ar, $pr, $em, $refClass, $idField, $class, $subPolicy);
            
            // Collection
            } else if(($association instanceof OneToMany || $association instanceof ManyToMany)
                      && isset($v['__meta'])
                      && is_array($v['__meta'])
                      && isset($v['collection'])
                      && is_array($v['collection'])) { // OneToMany, ManyToMany
                $this->fromArrayRelationCollection($v, $p, $pn, $getter, $setter, $association, $policy,
                                                   $ar, $pr, $em, $refClass, $idField, $class, $subPolicy);
            }
        } else {
            throw new Exceptions\FromArrayException('Field "'.$pn.'" must be an Entity representation or contain "collection" field');
        }
    }
332161
function bindAndExecute() {
		$conn = $this->connection;

		if ($conn === null) {
			throw new RuntimeException('bindAndExecute cannot be called on a QueryStatement without a connection.');
		}
		if ($conn instanceof DBMSSQL && $conn->getDriver() === 'dblib' && function_exists('mb_detect_encoding')) {
			return $conn->query($this->__toString());
		}
		if ($conn instanceof DBSQLite) {
			return $conn->query($this->__toString());
		}

		$string = self::embedIdentifiers($this->getString(), array_values($this->identifiers), $conn);

		$result = $conn->prepare($string);
		foreach ($this->getParams() as $key => $value) {
			$pdo_type = PDO::PARAM_STR;
			if (is_int($value)) {
				$pdo_type = PDO::PARAM_INT;
			} elseif (is_null($value)) {
				$pdo_type = PDO::PARAM_NULL;
			} elseif (is_bool($value)) {
				$value = $value ? 1 : 0;
				$pdo_type = PDO::PARAM_INT;
			}
			$result->bindValue($key + 1, $value, $pdo_type);
		}
		$result->execute();
		return $result;
	}
523877
protected function bindNamedParameters(): void
    {
        foreach ($this->getValues() as $key => $value) {
            $value = $this->toScalar($value);
            $this->getWrappedStatement()->bindValue(sprintf(':%s', $key), $value, $this->getPdoType($value));
        }
    }
655209
@Override
	public SqlContext clobParamIfAbsent(final String paramName, final Reader value, final int len) {
		if (!hasParam(paramName)) {
			clobParam(paramName, value, len);
		}
		return this;
	}