<commit_before><?php

namespace WsdlToPhp\PackageGenerator\File;

use WsdlToPhp\PackageGenerator\Model\Struct as StructModel;
use WsdlToPhp\PhpGenerator\Element\PhpMethod;
use WsdlToPhp\PhpGenerator\Element\PhpFunctionParameter;
use WsdlToPhp\PackageGenerator\Container\PhpElement\Method as MethodContainer;

class Operation extends AbstractOperation
{
    /**
     * @param MethodContainer $methods
     * @return Operation
     */
    public function addMainMethod(MethodContainer $methods)
    {
        $phpMethod = new PhpMethod($this->getMethod()->getMethodName());
        $this
            ->defineParameters($phpMethod)
            ->defineBody($phpMethod);
        $methods->add($phpMethod);
        return $this;
    }
    /**
     * @param PhpMethod $method
     * @return Operation
     */
    protected function defineParameters(PhpMethod $method)
    {
        return $this
            ->defineParametersFromArray($method)
            ->defineParametersFromModel($method)
            ->defineParametersFromString($method);
    }
    /**
     * @param PhpMethod $method
     * @return Operation
     */
    protected function defineParametersFromArray(PhpMethod $method)
    {
        if ($this->isParameterTypeAnArray()) {
            $parameters = array();
            foreach ($this->getParameterTypeArrayTypes() as $parameterName => $parameterType) {
                $parameters[] = $this->getMethodParameter($this->getParameterName($parameterName), $parameterType);
            }
            $method->setParameters($parameters);
        }
        return $this;
    }
    /**
     * @param PhpMethod $method
     * @return Operation
     */
    protected function defineParametersFromModel(PhpMethod $method)
    {
        if ($this->isParameterTypeAModel()) {
            if ($this->getParameterTypeModel()->getAttributes(true, true)->count() > 0) {
                $method->setParameters(array(
                    $this->getMethodParameter($this->getParameterName($this->getParameterTypeModel()->getPackagedName()), $this->getParameterTypeModel()->getPackagedName(true))
                ));
            }

        }
        return $this;
    }
    /**
     * @param PhpMethod $method
     * @return Operation
     */
    protected function defineParametersFromString(PhpMethod $method)
    {
        if ($this->isParameterTypeAString() && !$this->isParameterTypeAModel()) {<commit_msg>update method call<commit_after><?php

namespace WsdlToPhp\PackageGenerator\File;

use WsdlToPhp\PackageGenerator\Model\Struct as StructModel;
use WsdlToPhp\PhpGenerator\Element\PhpMethod;
use WsdlToPhp\PhpGenerator\Element\PhpFunctionParameter;
use WsdlToPhp\PackageGenerator\Container\PhpElement\Method as MethodContainer;

class Operation extends AbstractOperation
{
    /**
     * @param MethodContainer $methods
     * @return Operation
     */
    public function addMainMethod(MethodContainer $methods)
    {
        $phpMethod = new PhpMethod($this->getMethod()->getMethodName());
        $this
            ->defineParameters($phpMethod)
            ->defineBody($phpMethod);
        $methods->add($phpMethod);
        return $this;
    }
    /**
     * @param PhpMethod $method
     * @return Operation
     */
    protected function defineParameters(PhpMethod $method)
    {
        return $this
            ->defineParametersFromArray($method)
            ->defineParametersFromModel($method)
            ->defineParametersFromString($method);
    }
    /**
     * @param PhpMethod $method
     * @return Operation
     */
    protected function defineParametersFromArray(PhpMethod $method)
    {
        if ($this->isParameterTypeAnArray()) {
            $parameters = array();
            foreach ($this->getParameterTypeArrayTypes(true) as $parameterName => $parameterType) {
                $parameters[] = $this->getMethodParameter($this->getParameterName($parameterName), $parameterType);
            }
            $method->setParameters($parameters);
        }
        return $this;
    }
    /**
     * @param PhpMethod $method
     * @return Operation
     */
    protected function defineParametersFromModel(PhpMethod $method)
    {
        if ($this->isParameterTypeAModel()) {
            if ($this->getParameterTypeModel()->getAttributes(true, true)->count() > 0) {
                $method->setParameters(array(
                    $this->getMethodParameter($this->getParameterName($this->getParameterTypeModel()->getPackagedName()), $this->getParameterTypeModel()->getPackagedName(true))
                ));
            }

        }
        return $this;
    }
    /**
     * @param PhpMethod $method
     * @return Operation
     */
    protected function defineParametersFromString(PhpMethod $method)
    {
        if ($this->isParameterTypeAString() && !$this->isParameterTypeAModel()) {
{'fraction_non_alphanumeric': 0.11989213856046463, 'fraction_numerical': 0.00041485169052063887, 'mean_word_length': 2.6781083142639206, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 59, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2595189', 'n_tokens_mistral': 1281, 'n_tokens_neox': 1258, 'n_words': 216}