Your project must not contain invalid function or method calls 347

More information: https://insight.symfony.com/what-we-analyse/php.invalid_call

  1. protected OutputInterface $output;
  2. protected function configure(): void
  3. {
  4. $this->addOption(
    Call to an undefined method WsdlToPhp\PackageGenerator\Command\AbstractCommand::addOption().
    Last edited by Mikaël DELSOL
  5. 'force',
  6. null,
  7. InputOption::VALUE_NONE,
  8. 'If true, then package is really generated otherwise debug information are displayed'
  9. );
  1. return true === (bool) $this->getOptionValue('force');
  2. }
  3. protected function writeLn($messages, int $type = OutputInterface::OUTPUT_NORMAL): void
  4. {
  5. $this->output->writeln($messages, $type);
    Parameter #1 $messages of method Symfony\Component\Console\Output\OutputInterface::writeln() expects iterable|string, mixed given.
    Last edited by Mikael DELSOL
  6. }
  7. protected function getOptionValue(string $name)
  8. {
  9. return $this->input->getOption($name);
  1. public function resolveGeneratorOptionsConfigPath(): ?string
  2. {
  3. $path = null;
  4. $possibilities = $this->getGeneratorOptionsPossibilities();
  5. foreach ($possibilities as $possibility) {
  6. if (!empty($possibility) && is_file($possibility)) {
    Parameter #1 $filename of function is_file expects string, mixed given.
    Last edited by Mikaël DELSOL
  7. $path = $possibility;
  8. break;
  9. }
  10. }
  1. }
  2. protected function configure(): void
  3. {
  4. parent::configure();
  5. $this
    Cannot call method setDescription() on mixed.
    Last edited by Mikaël DELSOL
  6. ->setName('generate:package')
  7. ->setDescription('Generate package based on options')
  8. ->addOption(
  9. 'urlorpath',
  10. null,
  1. }
  2. protected function configure(): void
  3. {
  4. parent::configure();
  5. $this
    Cannot call method addOption() on mixed.
    Last edited by Mikaël DELSOL
  6. ->setName('generate:package')
  7. ->setDescription('Generate package based on options')
  8. ->addOption(
  9. 'urlorpath',
  10. null,
  1. }
  2. protected function configure(): void
  3. {
  4. parent::configure();
  5. $this
    Call to an undefined method WsdlToPhp\PackageGenerator\Command\GeneratePackageCommand::setName().
    Last edited by Mikaël DELSOL
  6. ->setName('generate:package')
  7. ->setDescription('Generate package based on options')
  8. ->addOption(
  9. 'urlorpath',
  10. null,
  1. foreach ($this->getPackageGenerationCommandLineOptions() as $optionName => $generatorOptionName) {
  2. if (is_null($optionValue = $this->formatOptionValue($this->input->getOption($optionName)))) {
  3. continue;
  4. }
  5. $generatorOptions->setOptionValue($generatorOptionName, $optionValue);
    Parameter #1 $optionName of method WsdlToPhp\PackageGenerator\ConfigurationReader\GeneratorOptions::setOptionValue() expects string, mixed given.
    Last edited by Mikaël DELSOL
  6. }
  7. $this->generatorOptions = $generatorOptions;
  8. return $this;
  9. }
  1. $this->parseReservedKeywords($filename);
  2. }
  3. public function is(string $keyword): bool
  4. {
  5. return in_array($keyword, $this->keywords[self::CASE_SENSITIVE_KEY], true) || in_array(mb_strtolower($keyword), $this->keywords[self::CASE_INSENSITIVE_KEY], true);
    Parameter #2 $haystack of function in_array expects array, mixed given.
    Last edited by Mikaël DELSOL
  6. }
  7. protected function parseReservedKeywords(string $filename): AbstractReservedWord
  8. {
  9. $allKeywords = $this->parseSimpleArray($filename, self::MAIN_KEY);
  1. protected function parseReservedKeywords(string $filename): AbstractReservedWord
  2. {
  3. $allKeywords = $this->parseSimpleArray($filename, self::MAIN_KEY);
  4. $caseSensitiveKeywords = $allKeywords[self::CASE_SENSITIVE_KEY];
  5. $caseInsensitiveKeywords = array_map('strtolower', $allKeywords[self::CASE_INSENSITIVE_KEY]);
    Parameter #2 $array of function array_map expects array, mixed given.
    Last edited by Mikael DELSOL
  6. $this->keywords = array_merge_recursive($this->keywords, [
  7. self::CASE_SENSITIVE_KEY => $caseSensitiveKeywords,
  8. self::CASE_INSENSITIVE_KEY => $caseInsensitiveKeywords,
  9. ]);
  1. protected function parseReservedKeywords(string $filename): AbstractReservedWord
  2. {
  3. $allKeywords = $this->parseSimpleArray($filename, self::MAIN_KEY);
  4. $caseSensitiveKeywords = $allKeywords[self::CASE_SENSITIVE_KEY];
  5. $caseInsensitiveKeywords = array_map('strtolower', $allKeywords[self::CASE_INSENSITIVE_KEY]);
    Parameter #1 $callback of function array_map expects (callable(mixed): mixed)|null, 'strtolower' given.
    Last edited by Mikael DELSOL
  6. $this->keywords = array_merge_recursive($this->keywords, [
  7. self::CASE_SENSITIVE_KEY => $caseSensitiveKeywords,
  8. self::CASE_INSENSITIVE_KEY => $caseInsensitiveKeywords,
  9. ]);
  1. protected function loadYaml(string $filename)
  2. {
  3. $ymlParser = new Parser();
  4. return $ymlParser->parse(file_get_contents($filename));
    Parameter #1 $value of method Symfony\Component\Yaml\Parser::parse() expects string, string|false given.
    Last edited by Mikaël DELSOL
  5. }
  6. /**
  7. * @throws \InvalidArgumentException
  8. */
  1. * @throws \InvalidArgumentException
  2. */
  3. protected function parseSimpleArray(string $filename, string $mainKey): array
  4. {
  5. $values = $this->loadYaml($filename);
  6. if (!array_key_exists($mainKey, $values)) {
    Parameter #2 $search of function array_key_exists expects array, mixed given.
    Last edited by Mikael DELSOL
  7. throw new \InvalidArgumentException(sprintf('Unable to find section "%s" in "%s"', $mainKey, $filename), __LINE__);
  8. }
  9. return $values[$mainKey];
  10. }
  1. {
  2. if (!array_key_exists($optionName, $this->options)) {
  3. throw new \InvalidArgumentException(sprintf('Invalid option name "%s", possible options: %s', $optionName, implode(', ', array_keys($this->options))), __LINE__);
  4. }
  5. return array_key_exists('value', $this->options[$optionName]) ? $this->options[$optionName]['value'] : $this->options[$optionName]['default'];
    Parameter #2 $search of function array_key_exists expects array, mixed given.
    Last edited by Mikael DELSOL
  6. }
  7. public function setOptionValue(string $optionName, $optionValue, array $values = []): self
  8. {
  9. if (!array_key_exists($optionName, $this->options)) {
  1. if (!array_key_exists($optionName, $this->options)) {
  2. $this->options[$optionName] = [
  3. 'value' => $optionValue,
  4. 'values' => $values,
  5. ];
  6. } elseif (!empty($this->options[$optionName]['values']) && !in_array($optionValue, $this->options[$optionName]['values'], true)) {
    Parameter #2 $haystack of function in_array expects array, mixed given.
    Last edited by Mikael DELSOL
  7. throw new \InvalidArgumentException(sprintf('Invalid value "%s" for option "%s", possible values: %s', $optionValue, $optionName, implode(', ', $this->options[$optionName]['values'])), __LINE__);
  8. } else {
  9. $this->options[$optionName]['value'] = $optionValue;
  10. }
  1. $this->options[$optionName] = [
  2. 'value' => $optionValue,
  3. 'values' => $values,
  4. ];
  5. } elseif (!empty($this->options[$optionName]['values']) && !in_array($optionValue, $this->options[$optionName]['values'], true)) {
  6. throw new \InvalidArgumentException(sprintf('Invalid value "%s" for option "%s", possible values: %s', $optionValue, $optionName, implode(', ', $this->options[$optionName]['values'])), __LINE__);
    Parameter #2 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikaël DELSOL
  7. } else {
  8. $this->options[$optionName]['value'] = $optionValue;
  9. }
  10. return $this;
  1. $this->options[$optionName] = [
  2. 'value' => $optionValue,
  3. 'values' => $values,
  4. ];
  5. } elseif (!empty($this->options[$optionName]['values']) && !in_array($optionValue, $this->options[$optionName]['values'], true)) {
  6. throw new \InvalidArgumentException(sprintf('Invalid value "%s" for option "%s", possible values: %s', $optionValue, $optionName, implode(', ', $this->options[$optionName]['values'])), __LINE__);
    Parameter #2 $pieces of function implode expects array, mixed given.
    Last edited by Mikaël DELSOL
  7. } else {
  8. $this->options[$optionName]['value'] = $optionValue;
  9. }
  10. return $this;
  1. return __DIR__.'/../resources/config/generator_options.yml';
  2. }
  3. public static function methodNameToOptionName(string $name): string
  4. {
  5. return strtolower(trim(preg_replace(StructValue::MATCH_PATTERN, StructValue::REPLACEMENT_PATTERN, substr($name, 3)), '_'));
    Parameter #1 $str of function trim expects string, string|null given.
    Last edited by Mikaël DELSOL
  6. }
  7. public function setAddComments(array $addComments = []): self
  8. {
  9. /**
  1. /**
  2. * If array is type array("author:john Doe","Release:1",).
  3. */
  4. $comments = [];
  5. foreach ($addComments as $index => $value) {
  6. if (is_numeric($index) && mb_strpos($value, ':') > 0) {
    Parameter #1 $haystack of function mb_strpos expects string, mixed given.
    Last edited by Mikaël DELSOL
  7. [$tag, $val] = explode(':', $value);
  8. $comments[$tag] = $val;
  9. } else {
  10. $comments[$index] = $value;
  11. }
  1. * If array is type array("author:john Doe","Release:1",).
  2. */
  3. $comments = [];
  4. foreach ($addComments as $index => $value) {
  5. if (is_numeric($index) && mb_strpos($value, ':') > 0) {
  6. [$tag, $val] = explode(':', $value);
    Parameter #2 $str of function explode expects string, mixed given.
    Last edited by Mikaël DELSOL
  7. $comments[$tag] = $val;
  8. } else {
  9. $comments[$index] = $value;
  10. }
  11. }
  1. /**
  2. * If array is type array("config.value:true","require:library/src",).
  3. */
  4. $settings = [];
  5. foreach ($composerSettings as $index => $value) {
  6. if (is_numeric($index) && mb_strpos($value, ':') > 0) {
    Parameter #1 $haystack of function mb_strpos expects string, mixed given.
    Last edited by Mikaël DELSOL
  7. $path = implode('', array_slice(explode(':', $value), 0, 1));
  8. $val = implode(':', array_slice(explode(':', $value), 1));
  9. self::dotNotationToArray($path, $val, $settings);
  10. } else {
  11. $settings[$index] = $value;
  1. * If array is type array("config.value:true","require:library/src",).
  2. */
  3. $settings = [];
  4. foreach ($composerSettings as $index => $value) {
  5. if (is_numeric($index) && mb_strpos($value, ':') > 0) {
  6. $path = implode('', array_slice(explode(':', $value), 0, 1));
    Parameter #2 $str of function explode expects string, mixed given.
    Last edited by Mikael DELSOL
  7. $val = implode(':', array_slice(explode(':', $value), 1));
  8. self::dotNotationToArray($path, $val, $settings);
  9. } else {
  10. $settings[$index] = $value;
  11. }
  1. */
  2. $settings = [];
  3. foreach ($composerSettings as $index => $value) {
  4. if (is_numeric($index) && mb_strpos($value, ':') > 0) {
  5. $path = implode('', array_slice(explode(':', $value), 0, 1));
  6. $val = implode(':', array_slice(explode(':', $value), 1));
    Parameter #2 $str of function explode expects string, mixed given.
    Last edited by Mikael DELSOL
  7. self::dotNotationToArray($path, $val, $settings);
  8. } else {
  9. $settings[$index] = $value;
  10. }
  11. }
  1. protected int $offset = 0;
  2. public function offsetExists($offset): bool
  3. {
  4. $element = array_slice($this->objects, $offset, 1);
    Parameter #2 $offset of function array_slice expects int, mixed given.
    Last edited by Mikael DELSOL
  5. return !empty($element);
  6. }
  7. /**
  1. * @return mixed
  2. */
  3. #[\ReturnTypeWillChange]
  4. public function offsetGet($offset)
  5. {
  6. $element = array_slice($this->objects, $offset, 1);
    Parameter #2 $offset of function array_slice expects int, mixed given.
    Last edited by Mikael DELSOL
  7. return $this->offsetExists($offset) ? array_shift($element) : null;
  8. }
  9. /**
  1. #[\ReturnTypeWillChange]
  2. public function offsetUnset($offset): void
  3. {
  4. if ($this->offsetExists($offset)) {
  5. unset($this->objects[$this->getObjectKey($this->offsetGet($offset))]);
    Parameter #1 $object of method WsdlToPhp\PackageGenerator\Container\AbstractObjectContainer::getObjectKey() expects object, mixed given.
    Last edited by Mikael DELSOL
  6. }
  7. }
  8. /**
  9. * @return mixed
  1. {
  2. if (!is_scalar($value)) {
  3. throw new \InvalidArgumentException(sprintf('Value "%s" can\'t be used to get an object from "%s"', is_object($value) ? get_class($value) : var_export($value, true), get_class($this)), __LINE__);
  4. }
  5. return array_key_exists($value, $this->objects) ? $this->objects[$value] : null;
    Parameter #1 $key of function array_key_exists expects int|string, bool|float|int|string given.
    Last edited by Mikaël DELSOL
  6. }
  7. public function jsonSerialize(): array
  8. {
  9. return array_values($this->objects);
  1. public function addService(string $serviceName, string $methodName, $methodParameter, $methodReturn): Service
  2. {
  3. if (!$this->get($serviceName) instanceof Model) {
  4. $this->add(new Model($this->generator, $serviceName));
  5. }
  6. $serviceMethod = $this->get($serviceName)->getMethod($methodName);
    Cannot call method getMethod() on mixed.
    Last edited by Mikael DELSOL
  7. // Service method does not already exist, register it
  8. if (!$serviceMethod instanceof MethodModel) {
  9. $this->get($serviceName)->addMethod($methodName, $methodParameter, $methodReturn);
  10. }
  1. }
  2. $serviceMethod = $this->get($serviceName)->getMethod($methodName);
  3. // Service method does not already exist, register it
  4. if (!$serviceMethod instanceof MethodModel) {
  5. $this->get($serviceName)->addMethod($methodName, $methodParameter, $methodReturn);
    Cannot call method addMethod() on mixed.
    Last edited by Mikael DELSOL
  6. }
  7. // Service method exists with a different signature, register it too by identifying the service functions as non unique functions
  8. elseif ($methodParameter !== $serviceMethod->getParameterType()) {
  9. $serviceMethod->setUnique(false);
  10. $this->get($serviceName)->addMethod($methodName, $methodParameter, $methodReturn, false);
  1. $this->get($serviceName)->addMethod($methodName, $methodParameter, $methodReturn);
  2. }
  3. // Service method exists with a different signature, register it too by identifying the service functions as non unique functions
  4. elseif ($methodParameter !== $serviceMethod->getParameterType()) {
  5. $serviceMethod->setUnique(false);
  6. $this->get($serviceName)->addMethod($methodName, $methodParameter, $methodReturn, false);
    Cannot call method addMethod() on mixed.
    Last edited by Mikael DELSOL
  7. }
  8. return $this;
  9. }
  1. $methods = new Method($this->generator);
  2. /** @var Model $service */
  3. foreach ($this->objects as $service) {
  4. foreach ($service->getMethods() as $method) {
  5. $methods->add($method);
    Parameter #1 $object of method WsdlToPhp\PackageGenerator\Container\AbstractObjectContainer::add() expects object, mixed given.
    Last edited by Mikael DELSOL
  6. }
  7. }
  8. return $methods;
  9. }
  1. public function addStruct(string $structName, bool $isStruct = true, string $structType = ''): self
  2. {
  3. if (null === (empty($structType) ? $this->get($structName) : $this->getByType($structName, $structType))) {
  4. $model = new Model($this->generator, $structName, $isStruct);
  5. $this->add($model->setInheritance($structType));
    Parameter #1 $object of method WsdlToPhp\PackageGenerator\Container\Model\Struct::add() expects WsdlToPhp\PackageGenerator\Model\Struct, WsdlToPhp\PackageGenerator\Model\AbstractModel given.
    Last edited by Mikaël DELSOL
  6. }
  7. return $this;
  8. }
  1. return array_key_exists($key, $this->objects) ? $this->objects[$key] : null;
  2. }
  3. public function getObjectKeyWithType(object $object, string $type): string
  4. {
  5. return $this->getTypeKey($this->getObjectKey($object), $type);
    Parameter #1 $name of method WsdlToPhp\PackageGenerator\Container\Model\Struct::getTypeKey() expects string, mixed given.
    Last edited by Mikaël DELSOL
  6. }
  7. public function getObjectKeyWithVirtual(object $object): string
  8. {
  9. return $this->getVirtualKey($this->getObjectKey($object));
  1. return $this->getTypeKey($this->getObjectKey($object), $type);
  2. }
  3. public function getObjectKeyWithVirtual(object $object): string
  4. {
  5. return $this->getVirtualKey($this->getObjectKey($object));
    Parameter #1 $name of method WsdlToPhp\PackageGenerator\Container\Model\Struct::getVirtualKey() expects string, mixed given.
    Last edited by Mikaël DELSOL
  6. }
  7. /**
  8. * The key must not conflict with possible key values.
  9. */
  1. public function getFileDestination(bool $withSrc = true): string
  2. {
  3. return sprintf(
  4. '%s%s%s',
  5. $this->getDestinationFolder($withSrc),
  6. $this->getModel()->getSubDirectory(),
    Cannot call method getSubDirectory() on WsdlToPhp\PackageGenerator\Model\AbstractModel|null.
    Last edited by Mikaël DELSOL
  7. !empty($this->getModel()->getSubDirectory()) ? '/' : ''
  8. );
  9. }
  10. public function getDestinationFolder(bool $withSrc = true): string
  1. {
  2. return sprintf(
  3. '%s%s%s',
  4. $this->getDestinationFolder($withSrc),
  5. $this->getModel()->getSubDirectory(),
  6. !empty($this->getModel()->getSubDirectory()) ? '/' : ''
    Cannot call method getSubDirectory() on WsdlToPhp\PackageGenerator\Model\AbstractModel|null.
    Last edited by Mikaël DELSOL
  7. );
  8. }
  9. public function getDestinationFolder(bool $withSrc = true): string
  10. {
  1. return $this->model;
  2. }
  3. public function getModelFromStructAttribute(?StructAttributeModel $attribute = null): ?StructModel
  4. {
  5. return $this->getStructAttribute($attribute)->getTypeStruct();
    Cannot call method getTypeStruct() on WsdlToPhp\PackageGenerator\Model\StructAttribute|null.
    Last edited by Mikaël DELSOL
  6. }
  7. public function getRestrictionFromStructAttribute(?StructAttributeModel $attribute = null): ?StructModel
  8. {
  9. $model = $this->getModelFromStructAttribute($attribute);
  1. throw new \InvalidArgumentException('Could not find any valid StructAttribute');
  2. }
  3. $attributeType = $this->getStructAttributeType($attribute, true, $returnArrayType);
  4. if (XsdTypes::instance($this->getGenerator()->getOptionXsdTypesPath())->isXsd($attributeType)) {
  5. $attributeType = self::getPhpType($attributeType, $this->getGenerator()->getOptionXsdTypesPath());
    Parameter #2 $xsdTypesPath of static method WsdlToPhp\PackageGenerator\File\AbstractModelFile::getPhpType() expects null, string given.
    Last edited by Mikaël DELSOL
  6. }
  7. return $attributeType;
  8. }
  1. *
  2. * @return mixed
  3. */
  4. public static function getValidType($type, $xsdTypesPath = null, $fallback = null)
  5. {
  6. return XsdTypes::instance($xsdTypesPath)->isXsd(str_replace('[]', '', $type)) ? $fallback : $type;
    Parameter #3 $subject of function str_replace expects array<string>|string, mixed given.
    Last edited by Mikaël DELSOL
  7. }
  8. /**
  9. * See http://php.net/manual/fr/language.oop5.typehinting.php for these cases
  10. * Also see http://www.w3schools.com/schema/schema_dtypes_numeric.asp.
  1. *
  2. * @return mixed
  3. */
  4. public static function getPhpType($type, $xsdTypesPath = null, $fallback = self::TYPE_STRING)
  5. {
  6. return XsdTypes::instance($xsdTypesPath)->isXsd(str_replace('[]', '', $type)) ? XsdTypes::instance($xsdTypesPath)->phpType($type) : $fallback;
    Parameter #3 $subject of function str_replace expects array<string>|string, mixed given.
    Last edited by Mikaël DELSOL
  7. }
  8. protected function addAnnotationBlock(): AbstractModelFile
  9. {
  10. $this->getFile()->addAnnotationBlockElement($this->getClassAnnotationBlock());
  1. *
  2. * @return mixed
  3. */
  4. public static function getPhpType($type, $xsdTypesPath = null, $fallback = self::TYPE_STRING)
  5. {
  6. return XsdTypes::instance($xsdTypesPath)->isXsd(str_replace('[]', '', $type)) ? XsdTypes::instance($xsdTypesPath)->phpType($type) : $fallback;
    Parameter #1 $xsdType of method WsdlToPhp\PackageGenerator\ConfigurationReader\XsdTypes::phpType() expects string, mixed given.
    Last edited by Mikaël DELSOL
  7. }
  8. protected function addAnnotationBlock(): AbstractModelFile
  9. {
  10. $this->getFile()->addAnnotationBlockElement($this->getClassAnnotationBlock());
  1. {
  2. $packageName = $this->getPackageName();
  3. if (!empty($packageName)) {
  4. $block->addChild(new PhpAnnotation(self::ANNOTATION_PACKAGE, $packageName));
  5. }
  6. if (count($this->getModel()->getDocSubPackages()) > 0) {
    Cannot call method getDocSubPackages() on WsdlToPhp\PackageGenerator\Model\AbstractModel|null.
    Last edited by Mikael DELSOL
  7. $block->addChild(new PhpAnnotation(self::ANNOTATION_SUB_PACKAGE, implode(',', $this->getModel()->getDocSubPackages())));
  8. }
  9. return $this;
  10. }
  1. $packageName = $this->getPackageName();
  2. if (!empty($packageName)) {
  3. $block->addChild(new PhpAnnotation(self::ANNOTATION_PACKAGE, $packageName));
  4. }
  5. if (count($this->getModel()->getDocSubPackages()) > 0) {
  6. $block->addChild(new PhpAnnotation(self::ANNOTATION_SUB_PACKAGE, implode(',', $this->getModel()->getDocSubPackages())));
    Cannot call method getDocSubPackages() on WsdlToPhp\PackageGenerator\Model\AbstractModel|null.
    Last edited by Mikael DELSOL
  7. }
  8. return $this;
  9. }
  1. return $block;
  2. }
  3. protected function getClassDeclarationLine(): string
  4. {
  5. return sprintf($this->getClassDeclarationLineText(), $this->getModel()->getName(), $this->getModel()->getContextualPart());
    Cannot call method getName() on WsdlToPhp\PackageGenerator\Model\AbstractModel|null.
    Last edited by Mikael DELSOL
  6. }
  7. protected function getClassDeclarationLineText(): string
  8. {
  9. return 'This class stands for %s %s';
  1. return $block;
  2. }
  3. protected function getClassDeclarationLine(): string
  4. {
  5. return sprintf($this->getClassDeclarationLineText(), $this->getModel()->getName(), $this->getModel()->getContextualPart());
    Cannot call method getContextualPart() on WsdlToPhp\PackageGenerator\Model\AbstractModel|null.
    Last edited by Mikael DELSOL
  6. }
  7. protected function getClassDeclarationLineText(): string
  8. {
  9. return 'This class stands for %s %s';
  1. return $block;
  2. }
  3. protected function getClassDeclarationLine(): string
  4. {
  5. return sprintf($this->getClassDeclarationLineText(), $this->getModel()->getName(), $this->getModel()->getContextualPart());
    Parameter #2 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikael DELSOL
  6. }
  7. protected function getClassDeclarationLineText(): string
  8. {
  9. return 'This class stands for %s %s';
  1. return 'This class stands for %s %s';
  2. }
  3. protected function defineModelAnnotationsFromWsdl(PhpAnnotationBlock $block, ?AbstractModel $model = null): self
  4. {
  5. FileUtils::defineModelAnnotationsFromWsdl($block, $model instanceof AbstractModel ? $model : $this->getModel());
    Parameter #2 $model of static method WsdlToPhp\PackageGenerator\File\Utils::defineModelAnnotationsFromWsdl() expects WsdlToPhp\PackageGenerator\Model\AbstractModel, WsdlToPhp\PackageGenerator\Model\AbstractModel|null given.
    Last edited by Mikael DELSOL
  6. return $this;
  7. }
  8. protected function addClassElement(): AbstractModelFile
  1. return $this;
  2. }
  3. protected function addClassElement(): AbstractModelFile
  4. {
  5. $class = new PhpClass($this->getModel()->getPackagedName(), $this->getModel()->isAbstract(), '' === $this->getModel()->getExtendsClassName() ? null : $this->getModel()->getExtendsClassName());
    Cannot call method getPackagedName() on WsdlToPhp\PackageGenerator\Model\AbstractModel|null.
    Last edited by Mikaël DELSOL
  6. $this
  7. ->defineConstants($class)
  8. ->defineProperties($class)
  9. ->defineMethods($class)
  10. ->getFile()
  1. return $this;
  2. }
  3. protected function addClassElement(): AbstractModelFile
  4. {
  5. $class = new PhpClass($this->getModel()->getPackagedName(), $this->getModel()->isAbstract(), '' === $this->getModel()->getExtendsClassName() ? null : $this->getModel()->getExtendsClassName());
    Cannot call method getExtendsClassName() on WsdlToPhp\PackageGenerator\Model\AbstractModel|null.
    Last edited by Mikaël DELSOL
  6. $this
  7. ->defineConstants($class)
  8. ->defineProperties($class)
  9. ->defineMethods($class)
  10. ->getFile()
  1. return $this;
  2. }
  3. protected function addClassElement(): AbstractModelFile
  4. {
  5. $class = new PhpClass($this->getModel()->getPackagedName(), $this->getModel()->isAbstract(), '' === $this->getModel()->getExtendsClassName() ? null : $this->getModel()->getExtendsClassName());
    Cannot call method isAbstract() on WsdlToPhp\PackageGenerator\Model\AbstractModel|null.
    Last edited by Mikaël DELSOL
  6. $this
  7. ->defineConstants($class)
  8. ->defineProperties($class)
  9. ->defineMethods($class)
  10. ->getFile()
  1. return $this;
  2. }
  3. protected function defineNamespace(): self
  4. {
  5. if (!empty($this->getModel()->getNamespace())) {
    Cannot call method getNamespace() on WsdlToPhp\PackageGenerator\Model\AbstractModel|null.
    Last edited by Mikaël DELSOL
  6. $this->getFile()->setNamespace($this->getModel()->getNamespace());
  7. }
  8. return $this;
  9. }
  1. }
  2. protected function defineNamespace(): self
  3. {
  4. if (!empty($this->getModel()->getNamespace())) {
  5. $this->getFile()->setNamespace($this->getModel()->getNamespace());
    Cannot call method getNamespace() on WsdlToPhp\PackageGenerator\Model\AbstractModel|null.
    Last edited by Mikael DELSOL
  6. }
  7. return $this;
  8. }
  1. return $this;
  2. }
  3. protected function defineUseStatements(): self
  4. {
  5. if (!empty($this->getModel()->getExtends())) {
    Cannot call method getExtends() on WsdlToPhp\PackageGenerator\Model\AbstractModel|null.
    Last edited by Mikaël DELSOL
  6. $this->getFile()->addUse($this->getModel()->getExtends(), null, true);
  7. }
  8. return $this;
  9. }
  1. }
  2. protected function defineUseStatements(): self
  3. {
  4. if (!empty($this->getModel()->getExtends())) {
  5. $this->getFile()->addUse($this->getModel()->getExtends(), null, true);
    Cannot call method getExtends() on WsdlToPhp\PackageGenerator\Model\AbstractModel|null.
    Last edited by Mikael DELSOL
  6. }
  7. return $this;
  8. }
  1. protected function defineConstants(PhpClass $class): self
  2. {
  3. $constants = new Constant($this->getGenerator());
  4. $this->fillClassConstants($constants);
  5. foreach ($constants as $constant) {
  6. $annotationBlock = $this->getConstantAnnotationBlock($constant);
    Parameter #1 $constant of method WsdlToPhp\PackageGenerator\File\AbstractModelFile::getConstantAnnotationBlock() expects WsdlToPhp\PhpGenerator\Element\PhpConstant, mixed given.
    Last edited by Mikael DELSOL
  7. if (!empty($annotationBlock)) {
  8. $class->addAnnotationBlockElement($annotationBlock);
  9. }
  10. $class->addConstantElement($constant);
  11. }
  1. foreach ($constants as $constant) {
  2. $annotationBlock = $this->getConstantAnnotationBlock($constant);
  3. if (!empty($annotationBlock)) {
  4. $class->addAnnotationBlockElement($annotationBlock);
  5. }
  6. $class->addConstantElement($constant);
    Parameter #1 $constant of method WsdlToPhp\PhpGenerator\Component\AbstractComponent::addConstantElement() expects WsdlToPhp\PhpGenerator\Element\PhpConstant, mixed given.
    Last edited by Mikael DELSOL
  7. }
  8. return $this;
  9. }
  1. protected function defineProperties(PhpClass $class): self
  2. {
  3. $properties = new Property($this->getGenerator());
  4. $this->fillClassProperties($properties);
  5. foreach ($properties as $property) {
  6. $annotationBlock = $this->getPropertyAnnotationBlock($property);
    Parameter #1 $property of method WsdlToPhp\PackageGenerator\File\AbstractModelFile::getPropertyAnnotationBlock() expects WsdlToPhp\PhpGenerator\Element\PhpProperty, mixed given.
    Last edited by Mikael DELSOL
  7. if (!empty($annotationBlock)) {
  8. $class->addAnnotationBlockElement($annotationBlock);
  9. }
  10. $class->addPropertyElement($property);
  11. }
  1. foreach ($properties as $property) {
  2. $annotationBlock = $this->getPropertyAnnotationBlock($property);
  3. if (!empty($annotationBlock)) {
  4. $class->addAnnotationBlockElement($annotationBlock);
  5. }
  6. $class->addPropertyElement($property);
    Parameter #1 $property of method WsdlToPhp\PhpGenerator\Component\PhpClass::addPropertyElement() expects WsdlToPhp\PhpGenerator\Element\PhpProperty, mixed given.
    Last edited by Mikael DELSOL
  7. }
  8. return $this;
  9. }
  1. protected function defineMethods(PhpClass $class): self
  2. {
  3. $this->methods = new Method($this->getGenerator());
  4. $this->fillClassMethods();
  5. foreach ($this->methods as $method) {
  6. $annotationBlock = $this->getMethodAnnotationBlock($method);
    Parameter #1 $method of method WsdlToPhp\PackageGenerator\File\AbstractModelFile::getMethodAnnotationBlock() expects WsdlToPhp\PhpGenerator\Element\PhpMethod, mixed given.
    Last edited by Mikael DELSOL
  7. if (!empty($annotationBlock)) {
  8. $class->addAnnotationBlockElement($annotationBlock);
  9. }
  10. $class->addMethodElement($method);
  11. }
  1. foreach ($this->methods as $method) {
  2. $annotationBlock = $this->getMethodAnnotationBlock($method);
  3. if (!empty($annotationBlock)) {
  4. $class->addAnnotationBlockElement($annotationBlock);
  5. }
  6. $class->addMethodElement($method);
    Parameter #1 $method of method WsdlToPhp\PhpGenerator\Component\PhpClass::addMethodElement() expects WsdlToPhp\PhpGenerator\Element\PhpMethod, mixed given.
    Last edited by Mikael DELSOL
  7. }
  8. return $this;
  9. }
  1. protected function getStructAttributeTypeGetAnnotation(?StructAttributeModel $attribute = null, bool $returnArrayType = true, bool $nullableItemType = false): string
  2. {
  3. $attribute = $this->getStructAttribute($attribute);
  4. if ($attribute->isXml()) {
    Cannot call method isXml() on WsdlToPhp\PackageGenerator\Model\StructAttribute|null.
    Last edited by Mikaël DELSOL
  5. return '\DOMDocument|string|null';
  6. }
  7. return sprintf(
  8. '%s%s%s',
  1. }
  2. return sprintf(
  3. '%s%s%s',
  4. $this->getStructAttributeTypeAsPhpType($attribute, false),
  5. $this->useBrackets($attribute, $returnArrayType) ? '[]' : '',
    Parameter #1 $attribute of method WsdlToPhp\PackageGenerator\File\AbstractModelFile::useBrackets() expects WsdlToPhp\PackageGenerator\Model\StructAttribute, WsdlToPhp\PackageGenerator\Model\StructAttribute|null given.
    Last edited by Mikaël DELSOL
  6. !$nullableItemType && !$attribute->isNullable() && ($attribute->isRequired() || $attribute->isArray() || $attribute->isList()) ? '' : '|null'
  7. );
  8. }
  9. protected function getStructAttributeTypeSetAnnotation(StructAttributeModel $attribute, bool $returnArrayType = true, bool $itemType = false): string
  1. return sprintf(
  2. '%s%s%s',
  3. $this->getStructAttributeTypeAsPhpType($attribute, false),
  4. $this->useBrackets($attribute, $returnArrayType) ? '[]' : '',
  5. !$nullableItemType && !$attribute->isNullable() && ($attribute->isRequired() || $attribute->isArray() || $attribute->isList()) ? '' : '|null'
    Cannot call method isRequired() on WsdlToPhp\PackageGenerator\Model\StructAttribute|null.
    Last edited by Mikaël DELSOL
  6. );
  7. }
  8. protected function getStructAttributeTypeSetAnnotation(StructAttributeModel $attribute, bool $returnArrayType = true, bool $itemType = false): string
  9. {
  1. return sprintf(
  2. '%s%s%s',
  3. $this->getStructAttributeTypeAsPhpType($attribute, false),
  4. $this->useBrackets($attribute, $returnArrayType) ? '[]' : '',
  5. !$nullableItemType && !$attribute->isNullable() && ($attribute->isRequired() || $attribute->isArray() || $attribute->isList()) ? '' : '|null'
    Cannot call method isArray() on WsdlToPhp\PackageGenerator\Model\StructAttribute|null.
    Last edited by Mikaël DELSOL
  6. );
  7. }
  8. protected function getStructAttributeTypeSetAnnotation(StructAttributeModel $attribute, bool $returnArrayType = true, bool $itemType = false): string
  9. {
  1. return sprintf(
  2. '%s%s%s',
  3. $this->getStructAttributeTypeAsPhpType($attribute, false),
  4. $this->useBrackets($attribute, $returnArrayType) ? '[]' : '',
  5. !$nullableItemType && !$attribute->isNullable() && ($attribute->isRequired() || $attribute->isArray() || $attribute->isList()) ? '' : '|null'
    Cannot call method isList() on WsdlToPhp\PackageGenerator\Model\StructAttribute|null.
    Last edited by Mikaël DELSOL
  6. );
  7. }
  8. protected function getStructAttributeTypeSetAnnotation(StructAttributeModel $attribute, bool $returnArrayType = true, bool $itemType = false): string
  9. {
  1. return sprintf(
  2. '%s%s%s',
  3. $this->getStructAttributeTypeAsPhpType($attribute, false),
  4. $this->useBrackets($attribute, $returnArrayType) ? '[]' : '',
  5. !$nullableItemType && !$attribute->isNullable() && ($attribute->isRequired() || $attribute->isArray() || $attribute->isList()) ? '' : '|null'
    Cannot call method isNullable() on WsdlToPhp\PackageGenerator\Model\StructAttribute|null.
    Last edited by Mikaël DELSOL
  6. );
  7. }
  8. protected function getStructAttributeTypeSetAnnotation(StructAttributeModel $attribute, bool $returnArrayType = true, bool $itemType = false): string
  9. {
  1. return $this->method;
  2. }
  3. protected function getParameterTypeModel(): ?StructModel
  4. {
  5. return $this->isParameterTypeAString() ? $this->getGenerator()->getStructByName($this->getMethod()->getParameterType()) : null;
    Parameter #1 $structName of method WsdlToPhp\PackageGenerator\Generator\Generator::getStructByName() expects string, mixed given.
    Last edited by Mikaël DELSOL
  6. }
  7. protected function isParameterTypeEmpty(): bool
  8. {
  9. $parameterType = $this->getMethod()->getParameterType();
  1. }
  2. foreach ($parameterTypes as $parameterName => $parameterType) {
  3. $type = $methodUsage ? null : AbstractModelFile::TYPE_STRING;
  4. if (($model = $this->getGenerator()->getStructByName($parameterType)) instanceof StructModel) {
    Parameter #1 $structName of method WsdlToPhp\PackageGenerator\Generator\Generator::getStructByName() expects string, mixed given.
    Last edited by Mikaël DELSOL
  5. if ($model->isStruct() && !$model->isRestriction()) {
  6. $type = $model->getPackagedName(true);
  7. } elseif (!$model->isStruct() && $model->isArray()) {
  8. if ($methodUsage) {
  9. $type = AbstractModelFile::TYPE_ARRAY;
  1. protected function getMethodParameter(string $name, ?string $type = null): PhpFunctionParameter
  2. {
  3. try {
  4. return new PhpFunctionParameter($name, PhpFunctionParameter::NO_VALUE, $type);
  5. } catch (\InvalidArgumentException $exception) {
  6. throw new \InvalidArgumentException(sprintf('Unable to create function parameter for method "%s" with type "%s" and name "%s"', $this->getMethod()->getName(), var_export($type, true), $name), __LINE__, $exception);
    Parameter #2 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikaël DELSOL
  7. }
  8. }
  9. protected function getModelByName(string $name): ?StructModel
  10. {
in src/File/ClassMap.php, line 72
  1. protected function addMethodBody(PhpMethod $method): self
  2. {
  3. if ($this->getGenerator()->getStructs()->count() > 0) {
  4. $method->addChild('return [');
  5. foreach ($this->getGenerator()->getStructs() as $struct) {
  6. $this->addStructToClassMapList($method, $struct);
    Parameter #2 $struct of method WsdlToPhp\PackageGenerator\File\ClassMap::addStructToClassMapList() expects WsdlToPhp\PackageGenerator\Model\Struct, mixed given.
    Last edited by Mikael DELSOL
  7. }
  8. $method->addChild('];');
  9. }
  10. return $this;
in src/File/ClassMap.php, line 83
  1. }
  2. protected function addStructToClassMapList(PhpMethod $method, StructModel $struct): self
  3. {
  4. if ($struct->isStruct() && !$struct->isRestriction()) {
  5. $method->addChild($method->getIndentedString(sprintf('\'%s\' => \'%s\',', $struct->getName(), $this->getStructName($struct)), 1));
    Parameter #2 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikael DELSOL
  6. }
  7. return $this;
  8. }
in src/File/Composer.php, line 40
  1. }
  2. protected function writeFile(): void
  3. {
  4. $composer = new Application();
  5. $composer->setAutoExit(false);
    Call to an undefined method Composer\Console\Application::setAutoExit().
    Last edited by Mikael DELSOL
  6. $composer->run(new ArrayInput([
  7. 'command' => 'init',
  8. '--verbose' => true,
  9. '--no-interaction' => true,
  10. '--name' => $this->getGenerator()->getOptionComposerName(),
in src/File/Composer.php, line 46
  1. $composer->run(new ArrayInput([
  2. 'command' => 'init',
  3. '--verbose' => true,
  4. '--no-interaction' => true,
  5. '--name' => $this->getGenerator()->getOptionComposerName(),
  6. '--description' => sprintf('Package generated from %s using wsdltophp/packagegenerator', $this->getGenerator()->getWsdl()->getName()),
    Cannot call method getName() on WsdlToPhp\PackageGenerator\Model\Wsdl|null.
    Last edited by Mikael DELSOL
  7. '--require' => [
  8. 'php:>=7.4',
  9. 'ext-dom:*',
  10. 'ext-mbstring:*',
  11. 'ext-soap:*',
in src/File/Composer.php, line 46
  1. $composer->run(new ArrayInput([
  2. 'command' => 'init',
  3. '--verbose' => true,
  4. '--no-interaction' => true,
  5. '--name' => $this->getGenerator()->getOptionComposerName(),
  6. '--description' => sprintf('Package generated from %s using wsdltophp/packagegenerator', $this->getGenerator()->getWsdl()->getName()),
    Parameter #2 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikael DELSOL
  7. '--require' => [
  8. 'php:>=7.4',
  9. 'ext-dom:*',
  10. 'ext-mbstring:*',
  11. 'ext-soap:*',
in src/File/Composer.php, line 123
  1. protected function getComposerFileContent(): array
  2. {
  3. $content = [];
  4. $composerFilePath = $this->getComposerFilePath();
  5. if (!empty($composerFilePath)) {
  6. $content = json_decode(file_get_contents($composerFilePath), true);
    Parameter #1 $json of function json_decode expects string, string|false given.
    Last edited by Mikael DELSOL
  7. }
  8. return $content;
  9. }
  1. protected function defineParametersFromArray(PhpMethod $method): self
  2. {
  3. if ($this->isParameterTypeAnArray()) {
  4. $parameters = [];
  5. foreach ($this->getParameterTypeArrayTypes(true) as $parameterName => $parameterType) {
  6. $parameters[] = $this->getMethodParameter($this->getParameterName($parameterName), $parameterType);
    Parameter #2 $type of method WsdlToPhp\PackageGenerator\File\AbstractOperation::getMethodParameter() expects string|null, mixed given.
    Last edited by Mikael DELSOL
  7. }
  8. $method->setParameters($parameters);
  9. }
  10. return $this;
  1. }
  2. protected function defineParametersFromModel(PhpMethod $method): self
  3. {
  4. if ($this->isParameterTypeAModel()) {
  5. if ($this->getParameterTypeModel()->getAttributes(true, true)->count() > 0) {
    Cannot call method getAttributes() on WsdlToPhp\PackageGenerator\Model\Struct|null.
    Last edited by Mikael DELSOL
  6. $method->setParameters([
  7. $this->getMethodParameter($this->getParameterName($this->getParameterTypeModel()->getPackagedName()), $this->getParameterTypeModel()->getPackagedName(true)),
  8. ]);
  9. }
  10. }
  1. protected function defineParametersFromModel(PhpMethod $method): self
  2. {
  3. if ($this->isParameterTypeAModel()) {
  4. if ($this->getParameterTypeModel()->getAttributes(true, true)->count() > 0) {
  5. $method->setParameters([
  6. $this->getMethodParameter($this->getParameterName($this->getParameterTypeModel()->getPackagedName()), $this->getParameterTypeModel()->getPackagedName(true)),
    Cannot call method getPackagedName() on WsdlToPhp\PackageGenerator\Model\Struct|null.
    Last edited by Mikaël DELSOL
  7. ]);
  8. }
  9. }
  10. return $this;
  1. protected function defineParametersFromString(PhpMethod $method): self
  2. {
  3. if ($this->isParameterTypeAString() && !$this->isParameterTypeAModel()) {
  4. $method->setParameters([
  5. $this->getMethodParameter($this->getParameterName($this->getMethod()->getParameterType())),
    Parameter #1 $name of method WsdlToPhp\PackageGenerator\File\AbstractOperation::getParameterName() expects string, mixed given.
    Last edited by Mikaël DELSOL
  6. ]);
  7. }
  8. return $this;
  9. }
  1. return $this;
  2. }
  3. protected function getSoapCallName(): string
  4. {
  5. return sprintf('%s(\'%s\'%s', self::SOAP_CALL_NAME, $this->getMethod()->getName(), $this->getOperationCallParametersStarting());
    Parameter #3 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikaël DELSOL
  6. }
  7. protected function getOperationCallParameters(PhpMethod $method): string
  8. {
  9. $parameters = [];
in src/File/Operation.php, line 115
  1. }
  2. protected function getOperationCallParameterName(PhpFunctionParameter $parameter, PhpMethod $method): string
  3. {
  4. $cloneParameter = clone $parameter;
  5. $cloneParameter->setType(null);
    Parameter #1 $type of method WsdlToPhp\PhpGenerator\Element\PhpFunctionParameter::setType() expects string|WsdlToPhp\PhpGenerator\Element\PhpClass, null given.
    Last edited by Mikael DELSOL
  6. return sprintf('%s%s', PhpMethod::BREAK_LINE_CHAR, $method->getIndentedString(sprintf('%s,', $cloneParameter->getPhpDeclaration()), 1));
  7. }
  8. }
  1. return $this;
  2. }
  3. protected function addOperationMethodDeclaration(PhpAnnotationBlock $annotationBlock): self
  4. {
  5. $annotationBlock->addChild(sprintf('Method to call the operation originally named %s', $this->getMethod()->getName()));
    Parameter #2 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikael DELSOL
  6. if (!$this->getMethod()->isUnique()) {
  7. $annotationBlock->addChild('This method has been renamed because it is defined several times but with different signature');
  8. }
  9. return $this;
  1. $soapHeaderNamespaces = $this->getMethod()->getMetaValue(TagHeader::META_SOAP_HEADER_NAMESPACES, []);
  2. $soapHeaders = $this->getMethod()->getMetaValue(TagHeader::META_SOAP_HEADERS, []);
  3. if (!empty($soapHeaderNames) && !empty($soapHeaderTypes) && !empty($soapHeaderNamespaces)) {
  4. $annotationBlock
  5. ->addChild('Meta information extracted from the WSDL')
  6. ->addChild(new PhpAnnotation(PhpAnnotation::NO_NAME, sprintf('- SOAPHeaderNames: %s', implode(', ', $soapHeaderNames)), AbstractModelFile::ANNOTATION_LONG_LENGTH))
    Parameter #2 $pieces of function implode expects array, mixed given.
    Last edited by Mikael DELSOL
  7. ->addChild(new PhpAnnotation(PhpAnnotation::NO_NAME, sprintf('- SOAPHeaderNamespaces: %s', implode(', ', $soapHeaderNamespaces)), AbstractModelFile::ANNOTATION_LONG_LENGTH))
  8. ->addChild(new PhpAnnotation(PhpAnnotation::NO_NAME, sprintf('- SOAPHeaderTypes: %s', implode(', ', $this->getSoapHeaderTypesTypes($soapHeaderTypes))), AbstractModelFile::ANNOTATION_LONG_LENGTH))
  9. ->addChild(new PhpAnnotation(PhpAnnotation::NO_NAME, sprintf('- SOAPHeaders: %s', implode(', ', $soapHeaders)), AbstractModelFile::ANNOTATION_LONG_LENGTH))
  10. ;
  11. }
  1. $soapHeaders = $this->getMethod()->getMetaValue(TagHeader::META_SOAP_HEADERS, []);
  2. if (!empty($soapHeaderNames) && !empty($soapHeaderTypes) && !empty($soapHeaderNamespaces)) {
  3. $annotationBlock
  4. ->addChild('Meta information extracted from the WSDL')
  5. ->addChild(new PhpAnnotation(PhpAnnotation::NO_NAME, sprintf('- SOAPHeaderNames: %s', implode(', ', $soapHeaderNames)), AbstractModelFile::ANNOTATION_LONG_LENGTH))
  6. ->addChild(new PhpAnnotation(PhpAnnotation::NO_NAME, sprintf('- SOAPHeaderNamespaces: %s', implode(', ', $soapHeaderNamespaces)), AbstractModelFile::ANNOTATION_LONG_LENGTH))
    Parameter #2 $pieces of function implode expects array, mixed given.
    Last edited by Mikael DELSOL
  7. ->addChild(new PhpAnnotation(PhpAnnotation::NO_NAME, sprintf('- SOAPHeaderTypes: %s', implode(', ', $this->getSoapHeaderTypesTypes($soapHeaderTypes))), AbstractModelFile::ANNOTATION_LONG_LENGTH))
  8. ->addChild(new PhpAnnotation(PhpAnnotation::NO_NAME, sprintf('- SOAPHeaders: %s', implode(', ', $soapHeaders)), AbstractModelFile::ANNOTATION_LONG_LENGTH))
  9. ;
  10. }
  11. FileUtils::defineModelAnnotationsFromWsdl($annotationBlock, $this->getMethod(), [
  1. if (!empty($soapHeaderNames) && !empty($soapHeaderTypes) && !empty($soapHeaderNamespaces)) {
  2. $annotationBlock
  3. ->addChild('Meta information extracted from the WSDL')
  4. ->addChild(new PhpAnnotation(PhpAnnotation::NO_NAME, sprintf('- SOAPHeaderNames: %s', implode(', ', $soapHeaderNames)), AbstractModelFile::ANNOTATION_LONG_LENGTH))
  5. ->addChild(new PhpAnnotation(PhpAnnotation::NO_NAME, sprintf('- SOAPHeaderNamespaces: %s', implode(', ', $soapHeaderNamespaces)), AbstractModelFile::ANNOTATION_LONG_LENGTH))
  6. ->addChild(new PhpAnnotation(PhpAnnotation::NO_NAME, sprintf('- SOAPHeaderTypes: %s', implode(', ', $this->getSoapHeaderTypesTypes($soapHeaderTypes))), AbstractModelFile::ANNOTATION_LONG_LENGTH))
    Parameter #1 $soapHeaderTypes of method WsdlToPhp\PackageGenerator\File\OperationAnnotationBlock::getSoapHeaderTypesTypes() expects array, mixed given.
    Last edited by Mikael DELSOL
  7. ->addChild(new PhpAnnotation(PhpAnnotation::NO_NAME, sprintf('- SOAPHeaders: %s', implode(', ', $soapHeaders)), AbstractModelFile::ANNOTATION_LONG_LENGTH))
  8. ;
  9. }
  10. FileUtils::defineModelAnnotationsFromWsdl($annotationBlock, $this->getMethod(), [
  11. TagHeader::META_SOAP_HEADER_NAMES,
  1. $annotationBlock
  2. ->addChild('Meta information extracted from the WSDL')
  3. ->addChild(new PhpAnnotation(PhpAnnotation::NO_NAME, sprintf('- SOAPHeaderNames: %s', implode(', ', $soapHeaderNames)), AbstractModelFile::ANNOTATION_LONG_LENGTH))
  4. ->addChild(new PhpAnnotation(PhpAnnotation::NO_NAME, sprintf('- SOAPHeaderNamespaces: %s', implode(', ', $soapHeaderNamespaces)), AbstractModelFile::ANNOTATION_LONG_LENGTH))
  5. ->addChild(new PhpAnnotation(PhpAnnotation::NO_NAME, sprintf('- SOAPHeaderTypes: %s', implode(', ', $this->getSoapHeaderTypesTypes($soapHeaderTypes))), AbstractModelFile::ANNOTATION_LONG_LENGTH))
  6. ->addChild(new PhpAnnotation(PhpAnnotation::NO_NAME, sprintf('- SOAPHeaders: %s', implode(', ', $soapHeaders)), AbstractModelFile::ANNOTATION_LONG_LENGTH))
    Parameter #2 $pieces of function implode expects array, mixed given.
    Last edited by Mikaël DELSOL
  7. ;
  8. }
  9. FileUtils::defineModelAnnotationsFromWsdl($annotationBlock, $this->getMethod(), [
  10. TagHeader::META_SOAP_HEADER_NAMES,
  11. TagHeader::META_SOAP_HEADER_NAMESPACES,
  1. protected function getSoapHeaderTypesTypes(array $soapHeaderTypes): array
  2. {
  3. $soapHeaderTypesTypes = [];
  4. foreach ($soapHeaderTypes as $soapHeaderType) {
  5. $soapHeaderTypesTypes[] = $this->getSoapHeaderTypeType($soapHeaderType, true);
    Parameter #1 $soapHeaderType of method WsdlToPhp\PackageGenerator\File\OperationAnnotationBlock::getSoapHeaderTypeType() expects string, mixed given.
    Last edited by Mikael DELSOL
  6. }
  7. return $soapHeaderTypesTypes;
  8. }
  1. protected function addOperationMethodParamFromArray(PhpAnnotationBlock $annotationBlock): self
  2. {
  3. if ($this->isParameterTypeAnArray()) {
  4. foreach ($this->getParameterTypeArrayTypes() as $parameterName => $parameterType) {
  5. $annotationBlock->addChild($this->getOperationMethodParam($parameterType, $this->getParameterName($parameterName)));
    Parameter #1 $type of method WsdlToPhp\PackageGenerator\File\OperationAnnotationBlock::getOperationMethodParam() expects string, mixed given.
    Last edited by Mikael DELSOL
  6. }
  7. }
  8. return $this;
  9. }
  1. }
  2. protected function addOperationMethodParamFromModel(PhpAnnotationBlock $annotationBlock): self
  3. {
  4. if ($this->isParameterTypeAModel()) {
  5. $annotationBlock->addChild($this->getOperationMethodParam($this->getParameterTypeModel()->getPackagedName(true), $this->getParameterName($this->getParameterTypeModel()->getPackagedName())));
    Cannot call method getPackagedName() on WsdlToPhp\PackageGenerator\Model\Struct|null.
    Last edited by Mikael DELSOL
  6. }
  7. return $this;
  8. }
  1. }
  2. protected function addOperationMethodParamFromString(PhpAnnotationBlock $annotationBlock): self
  3. {
  4. if ($this->isParameterTypeAString() && !$this->isParameterTypeAModel()) {
  5. $annotationBlock->addChild($this->getOperationMethodParam($this->getMethod()->getParameterType(), lcfirst($this->getMethod()->getParameterType())));
    Parameter #1 $type of method WsdlToPhp\PackageGenerator\File\OperationAnnotationBlock::getOperationMethodParam() expects string, mixed given.
    Last edited by Mikael DELSOL
  6. }
  7. return $this;
  8. }
  1. }
  2. protected function addOperationMethodParamFromString(PhpAnnotationBlock $annotationBlock): self
  3. {
  4. if ($this->isParameterTypeAString() && !$this->isParameterTypeAModel()) {
  5. $annotationBlock->addChild($this->getOperationMethodParam($this->getMethod()->getParameterType(), lcfirst($this->getMethod()->getParameterType())));
    Parameter #1 $str of function lcfirst expects string, mixed given.
    Last edited by Mikael DELSOL
  6. }
  7. return $this;
  8. }
in src/File/Service.php, line 51
  1. if (is_null($returnType)) {
  2. return 'null';
  3. }
  4. if ((($struct = $generator->getStructByName($returnType)) instanceof StructModel) && !$struct->isRestriction()) {
    Parameter #1 $structName of method WsdlToPhp\PackageGenerator\Generator\Generator::getStructByName() expects string, mixed given.
    Last edited by Mikaël DELSOL
  5. if ($struct->isStruct()) {
  6. $returnType = $struct->getPackagedName(true);
  7. } elseif ($struct->isArray()) {
  8. if (($structInheritance = $struct->getInheritanceStruct()) instanceof StructModel) {
  9. $returnType = sprintf('%s[]', $structInheritance->getPackagedName(true));
in src/File/Service.php, line 106
  1. protected function defineUseStatements(): AbstractModelFile
  2. {
  3. $this->getFile()->addUse(\SoapFault::class);
  4. /** @var Method $method */
  5. foreach ($this->getModel()->getMethods() as $method) {
    Cannot call method getMethods() on WsdlToPhp\PackageGenerator\Model\Service|null.
    Last edited by Mikaël DELSOL
  6. $soapHeaderTypes = $method->getMetaValue(TagHeader::META_SOAP_HEADER_TYPES, []);
  7. if (!is_array($soapHeaderTypes)) {
  8. continue;
  9. }
  10. foreach ($soapHeaderTypes as $soapHeaderType) {
in src/File/Service.php, line 112
  1. $soapHeaderTypes = $method->getMetaValue(TagHeader::META_SOAP_HEADER_TYPES, []);
  2. if (!is_array($soapHeaderTypes)) {
  3. continue;
  4. }
  5. foreach ($soapHeaderTypes as $soapHeaderType) {
  6. $model = $this->getModelByName($soapHeaderType);
    Parameter #1 $name of method WsdlToPhp\PackageGenerator\File\AbstractModelFile::getModelByName() expects string, mixed given.
    Last edited by Mikaël DELSOL
  7. if (!$model instanceof StructModel) {
  8. continue;
  9. }
  10. if (!$model->isRestriction()) {
  11. continue;
in src/File/Service.php, line 145
  1. ;
  2. }
  3. protected function addSoapHeaderMethods(): self
  4. {
  5. foreach ($this->getModel()->getMethods() as $method) {
    Cannot call method getMethods() on WsdlToPhp\PackageGenerator\Model\Service|null.
    Last edited by Mikael DELSOL
  6. $this->addSoapHeaderFromMethod($method);
  7. }
  8. return $this;
  9. }
in src/File/Service.php, line 146
  1. }
  2. protected function addSoapHeaderMethods(): self
  3. {
  4. foreach ($this->getModel()->getMethods() as $method) {
  5. $this->addSoapHeaderFromMethod($method);
    Parameter #1 $method of method WsdlToPhp\PackageGenerator\File\Service::addSoapHeaderFromMethod() expects WsdlToPhp\PackageGenerator\Model\Method, mixed given.
    Last edited by Mikaël DELSOL
  6. }
  7. return $this;
  8. }
in src/File/Service.php, line 159
  1. $soapHeaderNames = $method->getMetaValue(TagHeader::META_SOAP_HEADER_NAMES, []);
  2. $soapHeaderNamespaces = $method->getMetaValue(TagHeader::META_SOAP_HEADER_NAMESPACES, []);
  3. $soapHeaderTypes = $method->getMetaValue(TagHeader::META_SOAP_HEADER_TYPES, []);
  4. if (is_array($soapHeaderNames) && is_array($soapHeaderNamespaces) && is_array($soapHeaderTypes)) {
  5. foreach ($soapHeaderNames as $index => $soapHeaderName) {
  6. $methodName = $this->getSoapHeaderMethodName($soapHeaderName);
    Parameter #1 $soapHeaderName of method WsdlToPhp\PackageGenerator\File\Service::getSoapHeaderMethodName() expects string, mixed given.
    Last edited by Mikaël DELSOL
  7. if (is_null($this->methods->get($methodName))) {
  8. $soapHeaderNamespace = array_key_exists($index, $soapHeaderNamespaces) ? $soapHeaderNamespaces[$index] : null;
  9. $soapHeaderType = array_key_exists($index, $soapHeaderTypes) ? $soapHeaderTypes[$index] : null;
  10. $this->methods->add($this->getSoapHeaderMethod($methodName, $soapHeaderName, $soapHeaderNamespace, $soapHeaderType));
  11. }
in src/File/Service.php, line 163
  1. foreach ($soapHeaderNames as $index => $soapHeaderName) {
  2. $methodName = $this->getSoapHeaderMethodName($soapHeaderName);
  3. if (is_null($this->methods->get($methodName))) {
  4. $soapHeaderNamespace = array_key_exists($index, $soapHeaderNamespaces) ? $soapHeaderNamespaces[$index] : null;
  5. $soapHeaderType = array_key_exists($index, $soapHeaderTypes) ? $soapHeaderTypes[$index] : null;
  6. $this->methods->add($this->getSoapHeaderMethod($methodName, $soapHeaderName, $soapHeaderNamespace, $soapHeaderType));
    Parameter #2 $soapHeaderName of method WsdlToPhp\PackageGenerator\File\Service::getSoapHeaderMethod() expects string, mixed given.
    Last edited by Mikaël DELSOL
  7. }
  8. }
  9. }
  10. return $this;
in src/File/Service.php, line 163
  1. foreach ($soapHeaderNames as $index => $soapHeaderName) {
  2. $methodName = $this->getSoapHeaderMethodName($soapHeaderName);
  3. if (is_null($this->methods->get($methodName))) {
  4. $soapHeaderNamespace = array_key_exists($index, $soapHeaderNamespaces) ? $soapHeaderNamespaces[$index] : null;
  5. $soapHeaderType = array_key_exists($index, $soapHeaderTypes) ? $soapHeaderTypes[$index] : null;
  6. $this->methods->add($this->getSoapHeaderMethod($methodName, $soapHeaderName, $soapHeaderNamespace, $soapHeaderType));
    Parameter #3 $soapHeaderNamespace of method WsdlToPhp\PackageGenerator\File\Service::getSoapHeaderMethod() expects string, mixed given.
    Last edited by Mikaël DELSOL
  7. }
  8. }
  9. }
  10. return $this;
in src/File/Service.php, line 163
  1. foreach ($soapHeaderNames as $index => $soapHeaderName) {
  2. $methodName = $this->getSoapHeaderMethodName($soapHeaderName);
  3. if (is_null($this->methods->get($methodName))) {
  4. $soapHeaderNamespace = array_key_exists($index, $soapHeaderNamespaces) ? $soapHeaderNamespaces[$index] : null;
  5. $soapHeaderType = array_key_exists($index, $soapHeaderTypes) ? $soapHeaderTypes[$index] : null;
  6. $this->methods->add($this->getSoapHeaderMethod($methodName, $soapHeaderName, $soapHeaderNamespace, $soapHeaderType));
    Parameter #4 $soapHeaderType of method WsdlToPhp\PackageGenerator\File\Service::getSoapHeaderMethod() expects string, mixed given.
    Last edited by Mikaël DELSOL
  7. }
  8. }
  9. }
  10. return $this;
in src/File/Service.php, line 189
  1. $rules->applyRules(lcfirst($soapHeaderName));
  2. $firstParameter->setModel($model);
  3. }
  4. $method->addChild(sprintf('return $this->%s($%s, \'%s\', $%s, $%s, $%s);', self::METHOD_SET_HEADER_PREFIX, self::PARAM_SET_HEADER_NAMESPACE, $soapHeaderName, lcfirst($soapHeaderName), self::PARAM_SET_HEADER_MUSTUNDERSTAND, self::PARAM_SET_HEADER_ACTOR));
  5. } catch (\InvalidArgumentException $exception) {
  6. throw new \InvalidArgumentException(sprintf('Unable to create function parameter for service "%s" with type "%s"', $this->getModel()->getName(), var_export($this->getTypeFromName($soapHeaderName), true)), __LINE__, $exception);
    Cannot call method getName() on WsdlToPhp\PackageGenerator\Model\Service|null.
    Last edited by Mikaël DELSOL
  7. }
  8. return $method;
  9. }
in src/File/Service.php, line 189
  1. $rules->applyRules(lcfirst($soapHeaderName));
  2. $firstParameter->setModel($model);
  3. }
  4. $method->addChild(sprintf('return $this->%s($%s, \'%s\', $%s, $%s, $%s);', self::METHOD_SET_HEADER_PREFIX, self::PARAM_SET_HEADER_NAMESPACE, $soapHeaderName, lcfirst($soapHeaderName), self::PARAM_SET_HEADER_MUSTUNDERSTAND, self::PARAM_SET_HEADER_ACTOR));
  5. } catch (\InvalidArgumentException $exception) {
  6. throw new \InvalidArgumentException(sprintf('Unable to create function parameter for service "%s" with type "%s"', $this->getModel()->getName(), var_export($this->getTypeFromName($soapHeaderName), true)), __LINE__, $exception);
    Parameter #2 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikaël DELSOL
  7. }
  8. return $method;
  9. }
in src/File/Service.php, line 199
  1. protected function getTypeFromName(string $name): ?string
  2. {
  3. return self::getPhpType(
  4. $this->getStructAttributeTypeAsPhpType(new StructAttributeModel($this->generator, 'any', $name)),
  5. $this->getGenerator()->getOptionXsdTypesPath(),
    Parameter #2 $xsdTypesPath of static method WsdlToPhp\PackageGenerator\File\AbstractModelFile::getPhpType() expects null, string given.
    Last edited by Mikaël DELSOL
  6. $this->getStructAttributeTypeAsPhpType(new StructAttributeModel($this->generator, 'any', $name))
  7. );
  8. }
  9. protected function getSoapHeaderMethodName(string $soapHeaderName): string
in src/File/Service.php, line 211
  1. return sprintf('%s%s', self::METHOD_SET_HEADER_PREFIX, ucfirst($soapHeaderName));
  2. }
  3. protected function addOperationsMethods(): self
  4. {
  5. foreach ($this->getModel()->getMethods() as $method) {
    Cannot call method getMethods() on WsdlToPhp\PackageGenerator\Model\Service|null.
    Last edited by Mikael DELSOL
  6. $this->addMainMethod($method);
  7. }
  8. return $this;
  9. }
in src/File/Service.php, line 212
  1. }
  2. protected function addOperationsMethods(): self
  3. {
  4. foreach ($this->getModel()->getMethods() as $method) {
  5. $this->addMainMethod($method);
    Parameter #1 $method of method WsdlToPhp\PackageGenerator\File\Service::addMainMethod() expects WsdlToPhp\PackageGenerator\Model\Method, mixed given.
    Last edited by Mikaël DELSOL
  6. }
  7. return $this;
  8. }
in src/File/Service.php, line 269
  1. ->addChild(new PhpAnnotation(self::ANNOTATION_THROWS, \InvalidArgumentException::class))
  2. ;
  3. }
  4. }
  5. $annotationBlock
  6. ->addChild(new PhpAnnotation(self::ANNOTATION_USES, sprintf('%s::%s()', $this->getModel()->getExtends(true), self::METHOD_SET_HEADER_PREFIX)))
    Cannot call method getExtends() on WsdlToPhp\PackageGenerator\Model\Service|null.
    Last edited by Mikaël DELSOL
  7. ->addChild(new PhpAnnotation(self::ANNOTATION_PARAM, sprintf('%s $%s', $firstParameterType, $firstParameter->getName())))
  8. ->addChild(new PhpAnnotation(self::ANNOTATION_PARAM, sprintf('%s $%s', self::TYPE_STRING, self::PARAM_SET_HEADER_NAMESPACE)))
  9. ->addChild(new PhpAnnotation(self::ANNOTATION_PARAM, sprintf('%s $%s', self::TYPE_BOOL, self::PARAM_SET_HEADER_MUSTUNDERSTAND)))
  10. ->addChild(new PhpAnnotation(self::ANNOTATION_PARAM, sprintf('%s|null $%s', self::TYPE_STRING, self::PARAM_SET_HEADER_ACTOR)))
  11. ->addChild(new PhpAnnotation(self::ANNOTATION_RETURN, $this->getModel()->getPackagedName(true)))
in src/File/Service.php, line 274
  1. ->addChild(new PhpAnnotation(self::ANNOTATION_USES, sprintf('%s::%s()', $this->getModel()->getExtends(true), self::METHOD_SET_HEADER_PREFIX)))
  2. ->addChild(new PhpAnnotation(self::ANNOTATION_PARAM, sprintf('%s $%s', $firstParameterType, $firstParameter->getName())))
  3. ->addChild(new PhpAnnotation(self::ANNOTATION_PARAM, sprintf('%s $%s', self::TYPE_STRING, self::PARAM_SET_HEADER_NAMESPACE)))
  4. ->addChild(new PhpAnnotation(self::ANNOTATION_PARAM, sprintf('%s $%s', self::TYPE_BOOL, self::PARAM_SET_HEADER_MUSTUNDERSTAND)))
  5. ->addChild(new PhpAnnotation(self::ANNOTATION_PARAM, sprintf('%s|null $%s', self::TYPE_STRING, self::PARAM_SET_HEADER_ACTOR)))
  6. ->addChild(new PhpAnnotation(self::ANNOTATION_RETURN, $this->getModel()->getPackagedName(true)))
    Cannot call method getPackagedName() on WsdlToPhp\PackageGenerator\Model\Service|null.
    Last edited by Mikaël DELSOL
  7. ;
  8. }
  9. return $this;
  10. }
in src/File/Service.php, line 294
  1. }
  2. protected function addAnnotationBlockForgetResultMethod(PhpAnnotationBlock $annotationBlock): self
  3. {
  4. $annotationBlock
  5. ->addChild('Returns the result')->addChild(new PhpAnnotation(self::ANNOTATION_SEE, sprintf('%s::getResult()', $this->getModel()->getExtends(true))))
    Cannot call method getExtends() on WsdlToPhp\PackageGenerator\Model\Service|null.
    Last edited by Mikael DELSOL
  6. ->addChild(new PhpAnnotation(self::ANNOTATION_RETURN, $this->getServiceReturnTypes()))
  7. ;
  8. return $this;
  9. }
in src/File/Service.php, line 304
  1. }
  2. protected function getServiceReturnTypes(): string
  3. {
  4. $returnTypes = [];
  5. foreach ($this->getModel()->getMethods() as $method) {
    Cannot call method getMethods() on WsdlToPhp\PackageGenerator\Model\Service|null.
    Last edited by Mikael DELSOL
  6. $returnTypes[] = self::getOperationMethodReturnType($method, $this->getGenerator());
  7. }
  8. natcasesort($returnTypes);
  9. return implode('|', array_unique($returnTypes));
in src/File/Service.php, line 305
  1. protected function getServiceReturnTypes(): string
  2. {
  3. $returnTypes = [];
  4. foreach ($this->getModel()->getMethods() as $method) {
  5. $returnTypes[] = self::getOperationMethodReturnType($method, $this->getGenerator());
    Parameter #1 $method of static method WsdlToPhp\PackageGenerator\File\Service::getOperationMethodReturnType() expects WsdlToPhp\PackageGenerator\Model\Method, mixed given.
    Last edited by Mikael DELSOL
  6. }
  7. natcasesort($returnTypes);
  8. return implode('|', array_unique($returnTypes));
  9. }
in src/File/Struct.php, line 76
  1. return null;
  2. }
  3. protected function getModelAttributes(): StructAttributeContainer
  4. {
  5. return $this->getModel()->getProperAttributes(true);
    Cannot call method getProperAttributes() on WsdlToPhp\PackageGenerator\Model\Struct|null.
    Last edited by Mikaël DELSOL
  6. }
  7. protected function fillClassProperties(PropertyContainer $properties): void
  8. {
  9. /** @var StructAttributeModel $attribute */
in src/File/Struct.php, line 110
  1. protected function getPropertyAnnotationBlock(PhpProperty $property): ?PhpAnnotationBlock
  2. {
  3. $annotationBlock = new PhpAnnotationBlock();
  4. $annotationBlock->addChild(sprintf('The %s', $property->getName()));
  5. $attribute = $this->getModel()->getAttribute($property->getName());
    Cannot call method getAttribute() on WsdlToPhp\PackageGenerator\Model\Struct|null.
    Last edited by Mikael DELSOL
  6. if (!$attribute instanceof StructAttributeModel) {
  7. $attribute = $this->getModel()->getAttributeByCleanName($property->getName());
  8. }
  9. if ($attribute instanceof StructAttributeModel) {
  10. $this->defineModelAnnotationsFromWsdl($annotationBlock, $attribute);
in src/File/Struct.php, line 112
  1. {
  2. $annotationBlock = new PhpAnnotationBlock();
  3. $annotationBlock->addChild(sprintf('The %s', $property->getName()));
  4. $attribute = $this->getModel()->getAttribute($property->getName());
  5. if (!$attribute instanceof StructAttributeModel) {
  6. $attribute = $this->getModel()->getAttributeByCleanName($property->getName());
    Cannot call method getAttributeByCleanName() on WsdlToPhp\PackageGenerator\Model\Struct|null.
    Last edited by Mikael DELSOL
  7. }
  8. if ($attribute instanceof StructAttributeModel) {
  9. $this->defineModelAnnotationsFromWsdl($annotationBlock, $attribute);
  10. $annotationBlock->addChild(new PhpAnnotation(self::ANNOTATION_VAR, $this->getStructAttributeTypeGetAnnotation($attribute)));
  11. }
in src/File/Struct.php, line 148
  1. $count = $this->getModelAttributes()->count();
  2. foreach ($this->getModelAttributes() as $index => $attribute) {
  3. if (0 === $index) {
  4. $method->addChild('$this');
  5. }
  6. $this->addStructMethodConstructBodyForAttribute($method, $attribute, $count - 1 === $index);
    Parameter #2 $attribute of method WsdlToPhp\PackageGenerator\File\Struct::addStructMethodConstructBodyForAttribute() expects WsdlToPhp\PackageGenerator\Model\StructAttribute, mixed given.
    Last edited by Mikael DELSOL
  7. }
  8. return $this;
  9. }
in src/File/Struct.php, line 166
  1. protected function getStructMethodParametersValues(): array
  2. {
  3. $parametersValues = [];
  4. foreach ($this->getModelAttributes() as $attribute) {
  5. $parametersValues[] = $this->getStructMethodParameter($attribute);
    Parameter #1 $attribute of method WsdlToPhp\PackageGenerator\File\Struct::getStructMethodParameter() expects WsdlToPhp\PackageGenerator\Model\StructAttribute, mixed given.
    Last edited by Mikaël DELSOL
  6. }
  7. return $parametersValues;
  8. }
in src/File/Struct.php, line 200
  1. $attribute->isRequired() && !$attribute->isAChoice() ? AssignedValueElementInterface::NO_VALUE : (($attribute->isRequired() && !$attribute->isNullable()) ? $defaultValue ?? null : $defaultValue),
  2. $type,
  3. $attribute
  4. );
  5. } catch (\InvalidArgumentException $exception) {
  6. throw new \InvalidArgumentException(sprintf('Unable to create function parameter for struct "%s" with type "%s" for attribute "%s"', $this->getModel()->getName(), var_export($this->getStructAttributeTypeAsPhpType($attribute), true), $attribute->getName()), __LINE__, $exception);
    Cannot call method getName() on WsdlToPhp\PackageGenerator\Model\Struct|null.
    Last edited by Mikaël DELSOL
  7. }
  8. }
  9. protected function addStructMethodsSetAndGet(): self
  10. {
in src/File/Struct.php, line 200
  1. $attribute->isRequired() && !$attribute->isAChoice() ? AssignedValueElementInterface::NO_VALUE : (($attribute->isRequired() && !$attribute->isNullable()) ? $defaultValue ?? null : $defaultValue),
  2. $type,
  3. $attribute
  4. );
  5. } catch (\InvalidArgumentException $exception) {
  6. throw new \InvalidArgumentException(sprintf('Unable to create function parameter for struct "%s" with type "%s" for attribute "%s"', $this->getModel()->getName(), var_export($this->getStructAttributeTypeAsPhpType($attribute), true), $attribute->getName()), __LINE__, $exception);
    Parameter #2 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikaël DELSOL
  7. }
  8. }
  9. protected function addStructMethodsSetAndGet(): self
  10. {
in src/File/Struct.php, line 200
  1. $attribute->isRequired() && !$attribute->isAChoice() ? AssignedValueElementInterface::NO_VALUE : (($attribute->isRequired() && !$attribute->isNullable()) ? $defaultValue ?? null : $defaultValue),
  2. $type,
  3. $attribute
  4. );
  5. } catch (\InvalidArgumentException $exception) {
  6. throw new \InvalidArgumentException(sprintf('Unable to create function parameter for struct "%s" with type "%s" for attribute "%s"', $this->getModel()->getName(), var_export($this->getStructAttributeTypeAsPhpType($attribute), true), $attribute->getName()), __LINE__, $exception);
    Parameter #4 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikaël DELSOL
  7. }
  8. }
  9. protected function addStructMethodsSetAndGet(): self
  10. {
in src/File/Struct.php, line 208
  1. protected function addStructMethodsSetAndGet(): self
  2. {
  3. foreach ($this->getModelAttributes() as $attribute) {
  4. $this
  5. ->addStructMethodGet($attribute)
    Parameter #1 $attribute of method WsdlToPhp\PackageGenerator\File\Struct::addStructMethodGet() expects WsdlToPhp\PackageGenerator\Model\StructAttribute, mixed given.
    Last edited by Mikaël DELSOL
  6. ->addStructMethodSet($attribute)
  7. ->addStructMethodAddTo($attribute)
  8. ;
  9. }
in src/File/Struct.php, line 209
  1. protected function addStructMethodsSetAndGet(): self
  2. {
  3. foreach ($this->getModelAttributes() as $attribute) {
  4. $this
  5. ->addStructMethodGet($attribute)
  6. ->addStructMethodSet($attribute)
    Parameter #1 $attribute of method WsdlToPhp\PackageGenerator\File\Struct::addStructMethodSet() expects WsdlToPhp\PackageGenerator\Model\StructAttribute, mixed given.
    Last edited by Mikaël DELSOL
  7. ->addStructMethodAddTo($attribute)
  8. ;
  9. }
  10. return $this;
in src/File/Struct.php, line 210
  1. {
  2. foreach ($this->getModelAttributes() as $attribute) {
  3. $this
  4. ->addStructMethodGet($attribute)
  5. ->addStructMethodSet($attribute)
  6. ->addStructMethodAddTo($attribute)
    Parameter #1 $attribute of method WsdlToPhp\PackageGenerator\File\Struct::addStructMethodAddTo() expects WsdlToPhp\PackageGenerator\Model\StructAttribute, mixed given.
    Last edited by Mikaël DELSOL
  7. ;
  8. }
  9. return $this;
  10. }
in src/File/Struct.php, line 242
  1. $this->applyRules($method, $attribute, 'item', true);
  2. if ($attribute->nameIsClean()) {
  3. $assignment = sprintf('$this->%s[] = $item;', $attribute->getCleanName());
  4. } else {
  5. $assignment = sprintf('$this->%s[] = $this->{\'%s\'}[] = $item;', $attribute->getCleanName(), addslashes($attribute->getName()));
    Parameter #1 $str of function addslashes expects string, mixed given.
    Last edited by Mikaël DELSOL
  6. }
  7. $method
  8. ->addChild($assignment)
  9. ->addChild('')
in src/File/Struct.php, line 269
  1. protected function addStructMethodSetBody(PhpMethod $method, StructAttributeModel $attribute): self
  2. {
  3. $parameters = $method->getParameters();
  4. $parameter = array_shift($parameters);
  5. $parameterName = is_string($parameter) ? $parameter : $parameter->getName();
    Cannot call method getName() on WsdlToPhp\PhpGenerator\Element\PhpFunctionParameter|null.
    Last edited by Mikaël DELSOL
  6. return $this
  7. ->applyRules($method, $attribute, $parameterName)
  8. ->addStructMethodSetBodyAssignment($method, $attribute, $parameterName)
  9. ->addStructMethodSetBodyReturn($method)
in src/File/Struct.php, line 283
  1. protected function addStructMethodSetBodyAssignment(PhpMethod $method, StructAttributeModel $attribute, string $parameterName): self
  2. {
  3. if ($attribute->getRemovableFromRequest() || $attribute->isAChoice()) {
  4. $method
  5. ->addChild(sprintf('if (is_null($%1$s) || (is_array($%1$s) && empty($%1$s))) {', $parameterName))
  6. ->addChild($method->getIndentedString(sprintf('unset($this->%1$s%2$s);', $attribute->getCleanName(), $attribute->nameIsClean() ? '' : sprintf(', $this->{\'%s\'}', addslashes($attribute->getName()))), 1))
    Parameter #1 $str of function addslashes expects string, mixed given.
    Last edited by Mikael DELSOL
  7. ->addChild('} else {')
  8. ->addChild($method->getIndentedString($this->getStructMethodSetBodyAssignment($attribute, $parameterName), 1))
  9. ->addChild('}')
  10. ;
  11. } else {
in src/File/Struct.php, line 317
  1. $prefix = '';
  2. $parameterName = sprintf('($%1$s instanceof \DOMDocument) ? $%1$s->saveXML($%1$s->hasChildNodes() ? $%1$s->childNodes->item(0) : null) : $%1$s', $parameterName);
  3. }
  4. if ($attribute->nameIsClean()) {
  5. $assignment = sprintf('$this->%s = %s%s;', $attribute->getName(), $prefix, $parameterName);
    Parameter #2 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikaël DELSOL
  6. } else {
  7. $assignment = sprintf('$this->%s = $this->{\'%s\'} = %s%s;', $attribute->getCleanName(), addslashes($attribute->getName()), $prefix, $parameterName);
  8. }
  9. return $assignment;
in src/File/Struct.php, line 319
  1. }
  2. if ($attribute->nameIsClean()) {
  3. $assignment = sprintf('$this->%s = %s%s;', $attribute->getName(), $prefix, $parameterName);
  4. } else {
  5. $assignment = sprintf('$this->%s = $this->{\'%s\'} = %s%s;', $attribute->getCleanName(), addslashes($attribute->getName()), $prefix, $parameterName);
    Parameter #1 $str of function addslashes expects string, mixed given.
    Last edited by Mikaël DELSOL
  6. }
  7. return $assignment;
  8. }
in src/File/Struct.php, line 374
  1. $attribute->getGetterName(),
  2. $this->getStructMethodGetParameters($attribute),
  3. $returnType
  4. );
  5. if ($attribute->nameIsClean()) {
  6. $thisAccess = sprintf('%s', $attribute->getName());
    Parameter #2 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikael DELSOL
  7. } else {
  8. $thisAccess = sprintf('{\'%s\'}', addslashes($attribute->getName()));
  9. }
  10. $this->addStructMethodGetBody($method, $attribute, $thisAccess);
  11. $this->methods->add($method);
in src/File/Struct.php, line 376
  1. $returnType
  2. );
  3. if ($attribute->nameIsClean()) {
  4. $thisAccess = sprintf('%s', $attribute->getName());
  5. } else {
  6. $thisAccess = sprintf('{\'%s\'}', addslashes($attribute->getName()));
    Parameter #1 $str of function addslashes expects string, mixed given.
    Last edited by Mikael DELSOL
  7. }
  8. $this->addStructMethodGetBody($method, $attribute, $thisAccess);
  9. $this->methods->add($method);
  10. return $this;
in src/File/Struct.php, line 433
  1. }
  2. protected function getStructMethodConstructAnnotationBlock(): PhpAnnotationBlock
  3. {
  4. $annotationBlock = new PhpAnnotationBlock([
  5. sprintf('Constructor method for %s', $this->getModel()->getName()),
    Cannot call method getName() on WsdlToPhp\PackageGenerator\Model\Struct|null.
    Last edited by Mikael DELSOL
  6. ]);
  7. $this->addStructPropertiesToAnnotationBlock($annotationBlock);
  8. return $annotationBlock;
  9. }
in src/File/Struct.php, line 433
  1. }
  2. protected function getStructMethodConstructAnnotationBlock(): PhpAnnotationBlock
  3. {
  4. $annotationBlock = new PhpAnnotationBlock([
  5. sprintf('Constructor method for %s', $this->getModel()->getName()),
    Parameter #2 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikael DELSOL
  6. ]);
  7. $this->addStructPropertiesToAnnotationBlock($annotationBlock);
  8. return $annotationBlock;
  9. }
in src/File/Struct.php, line 456
  1. /**
  2. * Since properties can be duplicated with different case, we assume that _\d+ is replaceable by an empty string as methods are "duplicated" with this suffix.
  3. */
  4. $parameterName = preg_replace('/(_\d+)/', '', $parameterName);
  5. $attribute = $this->getModel()->getAttribute($parameterName);
    Cannot call method getAttribute() on WsdlToPhp\PackageGenerator\Model\Struct|null.
    Last edited by Mikael DELSOL
  6. if (!$attribute instanceof StructAttributeModel) {
  7. $attribute = $this->getModel()->getAttributeByCleanName($parameterName);
  8. }
  9. if (!$attribute instanceof StructAttributeModel) {
  10. $parameterName = lcfirst($parameterName);
in src/File/Struct.php, line 458
  1. * Since properties can be duplicated with different case, we assume that _\d+ is replaceable by an empty string as methods are "duplicated" with this suffix.
  2. */
  3. $parameterName = preg_replace('/(_\d+)/', '', $parameterName);
  4. $attribute = $this->getModel()->getAttribute($parameterName);
  5. if (!$attribute instanceof StructAttributeModel) {
  6. $attribute = $this->getModel()->getAttributeByCleanName($parameterName);
    Cannot call method getAttributeByCleanName() on WsdlToPhp\PackageGenerator\Model\Struct|null.
    Last edited by Mikael DELSOL
  7. }
  8. if (!$attribute instanceof StructAttributeModel) {
  9. $parameterName = lcfirst($parameterName);
  10. $attribute = $this->getModel()->getAttribute($parameterName);
  11. if (!$attribute instanceof StructAttributeModel) {
in src/File/Struct.php, line 461
  1. $attribute = $this->getModel()->getAttribute($parameterName);
  2. if (!$attribute instanceof StructAttributeModel) {
  3. $attribute = $this->getModel()->getAttributeByCleanName($parameterName);
  4. }
  5. if (!$attribute instanceof StructAttributeModel) {
  6. $parameterName = lcfirst($parameterName);
    Parameter #1 $str of function lcfirst expects string, string|null given.
    Last edited by Mikael DELSOL
  7. $attribute = $this->getModel()->getAttribute($parameterName);
  8. if (!$attribute instanceof StructAttributeModel) {
  9. $attribute = $this->getModel()->getAttributeByCleanName($parameterName);
  10. }
  11. }
in src/File/Struct.php, line 462
  1. if (!$attribute instanceof StructAttributeModel) {
  2. $attribute = $this->getModel()->getAttributeByCleanName($parameterName);
  3. }
  4. if (!$attribute instanceof StructAttributeModel) {
  5. $parameterName = lcfirst($parameterName);
  6. $attribute = $this->getModel()->getAttribute($parameterName);
    Cannot call method getAttribute() on WsdlToPhp\PackageGenerator\Model\Struct|null.
    Last edited by Mikael DELSOL
  7. if (!$attribute instanceof StructAttributeModel) {
  8. $attribute = $this->getModel()->getAttributeByCleanName($parameterName);
  9. }
  10. }
  11. $setValueAnnotation = '%s %s value';
in src/File/Struct.php, line 464
  1. }
  2. if (!$attribute instanceof StructAttributeModel) {
  3. $parameterName = lcfirst($parameterName);
  4. $attribute = $this->getModel()->getAttribute($parameterName);
  5. if (!$attribute instanceof StructAttributeModel) {
  6. $attribute = $this->getModel()->getAttributeByCleanName($parameterName);
    Cannot call method getAttributeByCleanName() on WsdlToPhp\PackageGenerator\Model\Struct|null.
    Last edited by Mikael DELSOL
  7. }
  8. }
  9. $setValueAnnotation = '%s %s value';
  10. $annotationBlock = new PhpAnnotationBlock();
  11. if ($attribute instanceof StructAttributeModel) {
in src/File/Struct.php, line 473
  1. $annotationBlock = new PhpAnnotationBlock();
  2. if ($attribute instanceof StructAttributeModel) {
  3. $annotationBlock->addChild(sprintf($setValueAnnotation, ucfirst($setOrGet), $parameterName));
  4. $this->addStructMethodsSetAndGetAnnotationBlockFromStructAttribute($setOrGet, $annotationBlock, $attribute);
  5. } elseif (!$attribute) {
  6. $annotationBlock->addChild(sprintf($setValueAnnotation, ucfirst($setOrGet), lcfirst($parameterName)));
    Parameter #1 $str of function lcfirst expects string, string|null given.
    Last edited by Mikael DELSOL
  7. $this->addStructMethodsSetAndGetAnnotationBlockFromScalar($setOrGet, $annotationBlock, $parameterName);
  8. }
  9. return $annotationBlock;
  10. }
in src/File/Struct.php, line 474
  1. if ($attribute instanceof StructAttributeModel) {
  2. $annotationBlock->addChild(sprintf($setValueAnnotation, ucfirst($setOrGet), $parameterName));
  3. $this->addStructMethodsSetAndGetAnnotationBlockFromStructAttribute($setOrGet, $annotationBlock, $attribute);
  4. } elseif (!$attribute) {
  5. $annotationBlock->addChild(sprintf($setValueAnnotation, ucfirst($setOrGet), lcfirst($parameterName)));
  6. $this->addStructMethodsSetAndGetAnnotationBlockFromScalar($setOrGet, $annotationBlock, $parameterName);
    Parameter #3 $attributeName of method WsdlToPhp\PackageGenerator\File\Struct::addStructMethodsSetAndGetAnnotationBlockFromScalar() expects string, string|null given.
    Last edited by Mikael DELSOL
  7. }
  8. return $annotationBlock;
  9. }
in src/File/Struct.php, line 551
  1. protected function addStructMethodsSetAnnotationBlock(PhpAnnotationBlock $annotationBlock, string $type, string $name): self
  2. {
  3. $annotationBlock
  4. ->addChild(new PhpAnnotation(self::ANNOTATION_PARAM, sprintf('%s $%s', $type, $name)))
  5. ->addChild(new PhpAnnotation(self::ANNOTATION_RETURN, $this->getModel()->getPackagedName(true)))
    Cannot call method getPackagedName() on WsdlToPhp\PackageGenerator\Model\Struct|null.
    Last edited by Mikaël DELSOL
  6. ;
  7. return $this;
  8. }
in src/File/Struct.php, line 587
  1. }
  2. protected function addStructPropertiesToAnnotationBlockUses(PhpAnnotationBlock $annotationBlock): self
  3. {
  4. foreach ($this->getModelAttributes() as $attribute) {
  5. $annotationBlock->addChild(new PhpAnnotation(self::ANNOTATION_USES, sprintf('%s::%s()', $this->getModel()->getPackagedName(), $attribute->getSetterName())));
    Cannot call method getSetterName() on mixed.
    Last edited by Mikael DELSOL
  6. }
  7. return $this;
  8. }
in src/File/Struct.php, line 587
  1. }
  2. protected function addStructPropertiesToAnnotationBlockUses(PhpAnnotationBlock $annotationBlock): self
  3. {
  4. foreach ($this->getModelAttributes() as $attribute) {
  5. $annotationBlock->addChild(new PhpAnnotation(self::ANNOTATION_USES, sprintf('%s::%s()', $this->getModel()->getPackagedName(), $attribute->getSetterName())));
    Cannot call method getPackagedName() on WsdlToPhp\PackageGenerator\Model\Struct|null.
    Last edited by Mikael DELSOL
  6. }
  7. return $this;
  8. }
in src/File/Struct.php, line 587
  1. }
  2. protected function addStructPropertiesToAnnotationBlockUses(PhpAnnotationBlock $annotationBlock): self
  3. {
  4. foreach ($this->getModelAttributes() as $attribute) {
  5. $annotationBlock->addChild(new PhpAnnotation(self::ANNOTATION_USES, sprintf('%s::%s()', $this->getModel()->getPackagedName(), $attribute->getSetterName())));
    Parameter #3 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikael DELSOL
  6. }
  7. return $this;
  8. }
in src/File/Struct.php, line 596
  1. }
  2. protected function addStructPropertiesToAnnotationBlockParams(PhpAnnotationBlock $annotationBlock): self
  3. {
  4. foreach ($this->getModelAttributes() as $attribute) {
  5. $annotationBlock->addChild(new PhpAnnotation(self::ANNOTATION_PARAM, sprintf('%s $%s', $this->getStructAttributeTypeSetAnnotation($attribute, false), lcfirst($attribute->getCleanName()))));
    Parameter #1 $str of function lcfirst expects string, mixed given.
    Last edited by Mikaël DELSOL
  6. }
  7. return $this;
  8. }
in src/File/Struct.php, line 596
  1. }
  2. protected function addStructPropertiesToAnnotationBlockParams(PhpAnnotationBlock $annotationBlock): self
  3. {
  4. foreach ($this->getModelAttributes() as $attribute) {
  5. $annotationBlock->addChild(new PhpAnnotation(self::ANNOTATION_PARAM, sprintf('%s $%s', $this->getStructAttributeTypeSetAnnotation($attribute, false), lcfirst($attribute->getCleanName()))));
    Parameter #1 $attribute of method WsdlToPhp\PackageGenerator\File\AbstractModelFile::getStructAttributeTypeSetAnnotation() expects WsdlToPhp\PackageGenerator\Model\StructAttribute, mixed given.
    Last edited by Mikaël DELSOL
  6. }
  7. return $this;
  8. }
in src/File/Struct.php, line 596
  1. }
  2. protected function addStructPropertiesToAnnotationBlockParams(PhpAnnotationBlock $annotationBlock): self
  3. {
  4. foreach ($this->getModelAttributes() as $attribute) {
  5. $annotationBlock->addChild(new PhpAnnotation(self::ANNOTATION_PARAM, sprintf('%s $%s', $this->getStructAttributeTypeSetAnnotation($attribute, false), lcfirst($attribute->getCleanName()))));
    Cannot call method getCleanName() on mixed.
    Last edited by Mikaël DELSOL
  6. }
  7. return $this;
  8. }
in src/File/Struct.php, line 608
  1. {
  2. $methodParameters = $method->getParameters();
  3. /** @var PhpFunctionParameter $firstParameter */
  4. $firstParameter = array_shift($methodParameters);
  5. $attribute = $this->getModel()->getAttribute($firstParameter->getModel()->getName());
    Cannot call method getName() on WsdlToPhp\PackageGenerator\Model\AbstractModel|null.
    Last edited by Mikaël DELSOL
  6. $annotationBlock = new PhpAnnotationBlock();
  7. if ($attribute instanceof StructAttributeModel) {
  8. $model = $this->getRestrictionFromStructAttribute($attribute);
  9. $annotationBlock->addChild(sprintf('Add item to %s value', $attribute->getCleanName()));
  10. if ($model instanceof StructModel) {
in src/File/Struct.php, line 608
  1. {
  2. $methodParameters = $method->getParameters();
  3. /** @var PhpFunctionParameter $firstParameter */
  4. $firstParameter = array_shift($methodParameters);
  5. $attribute = $this->getModel()->getAttribute($firstParameter->getModel()->getName());
    Cannot call method getAttribute() on WsdlToPhp\PackageGenerator\Model\Struct|null.
    Last edited by Mikaël DELSOL
  6. $annotationBlock = new PhpAnnotationBlock();
  7. if ($attribute instanceof StructAttributeModel) {
  8. $model = $this->getRestrictionFromStructAttribute($attribute);
  9. $annotationBlock->addChild(sprintf('Add item to %s value', $attribute->getCleanName()));
  10. if ($model instanceof StructModel) {
in src/File/Struct.php, line 622
  1. ;
  2. }
  3. $annotationBlock
  4. ->addChild(new PhpAnnotation(self::ANNOTATION_THROWS, \InvalidArgumentException::class))
  5. ->addChild(new PhpAnnotation(self::ANNOTATION_PARAM, sprintf('%s $item', $this->getStructAttributeTypeSetAnnotation($attribute, false, true))))
  6. ->addChild(new PhpAnnotation(self::ANNOTATION_RETURN, $this->getModel()->getPackagedName(true)))
    Cannot call method getPackagedName() on WsdlToPhp\PackageGenerator\Model\Struct|null.
    Last edited by Mikaël DELSOL
  7. ;
  8. }
  9. return $annotationBlock;
  10. }
  1. return $this->addArrayMethodGenericMethod(
  2. self::METHOD_GET_ATTRIBUTE_NAME,
  3. sprintf(
  4. 'return \'%s\';',
  5. $model
    Parameter #2 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikaël DELSOL
  6. ->getAttributes()
  7. ->offsetGet(0)
  8. ->getName()
  9. ),
  10. [],
  1. return $this->addArrayMethodGenericMethod(
  2. self::METHOD_GET_ATTRIBUTE_NAME,
  3. sprintf(
  4. 'return \'%s\';',
  5. $model
    Cannot call method getName() on mixed.
    Last edited by Mikaël DELSOL
  6. ->getAttributes()
  7. ->offsetGet(0)
  8. ->getName()
  9. ),
  10. [],
  1. $model = $this->getModel();
  2. return new PhpAnnotationBlock([
  3. 'Returns the attribute name',
  4. new PhpAnnotation(self::ANNOTATION_SEE, sprintf('%s::%s()', $model->getExtends(true), self::METHOD_GET_ATTRIBUTE_NAME)),
  5. new PhpAnnotation(self::ANNOTATION_RETURN, sprintf('string %s', $model->getAttributes()->offsetGet(0)->getName())),
    Cannot call method getName() on mixed.
    Last edited by Mikaël DELSOL
  6. ]);
  7. }
  8. protected function getArrayMethodCurrentAnnotationBlock(): PhpAnnotationBlock
  9. {
  1. $model = $this->getModel();
  2. return new PhpAnnotationBlock([
  3. 'Returns the attribute name',
  4. new PhpAnnotation(self::ANNOTATION_SEE, sprintf('%s::%s()', $model->getExtends(true), self::METHOD_GET_ATTRIBUTE_NAME)),
  5. new PhpAnnotation(self::ANNOTATION_RETURN, sprintf('string %s', $model->getAttributes()->offsetGet(0)->getName())),
    Parameter #2 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikaël DELSOL
  6. ]);
  7. }
  8. protected function getArrayMethodCurrentAnnotationBlock(): PhpAnnotationBlock
  9. {
  1. protected function getArrayMethodAddAnnotationBlock(): PhpAnnotationBlock
  2. {
  3. return new PhpAnnotationBlock([
  4. 'Add element to array',
  5. new PhpAnnotation(self::ANNOTATION_SEE, sprintf('%s::add()', $this->getModel()->getExtends(true))),
    Cannot call method getExtends() on WsdlToPhp\PackageGenerator\Model\Struct|null.
    Last edited by Mikael DELSOL
  6. new PhpAnnotation(self::ANNOTATION_THROWS, \InvalidArgumentException::class),
  7. new PhpAnnotation(self::ANNOTATION_PARAM, sprintf('%s $item', $this->getStructAttributeType(null, true, false))),
  8. new PhpAnnotation(self::ANNOTATION_RETURN, sprintf('%s', $this->getModel()->getPackagedName(true))),
  9. ]);
  10. }
  1. return new PhpAnnotationBlock([
  2. 'Add element to array',
  3. new PhpAnnotation(self::ANNOTATION_SEE, sprintf('%s::add()', $this->getModel()->getExtends(true))),
  4. new PhpAnnotation(self::ANNOTATION_THROWS, \InvalidArgumentException::class),
  5. new PhpAnnotation(self::ANNOTATION_PARAM, sprintf('%s $item', $this->getStructAttributeType(null, true, false))),
  6. new PhpAnnotation(self::ANNOTATION_RETURN, sprintf('%s', $this->getModel()->getPackagedName(true))),
    Cannot call method getPackagedName() on WsdlToPhp\PackageGenerator\Model\Struct|null.
    Last edited by Mikael DELSOL
  7. ]);
  8. }
  9. protected function getArrayMethodGenericAnnotationBlock(string $name, string $description, $param = null): PhpAnnotationBlock
  10. {
  1. protected function getArrayMethodGenericAnnotationBlock(string $name, string $description, $param = null): PhpAnnotationBlock
  2. {
  3. $annotationBlock = new PhpAnnotationBlock([
  4. $description,
  5. new PhpAnnotation(self::ANNOTATION_SEE, sprintf('%s::%s()', $this->getModel()->getExtends(true), $name)),
    Cannot call method getExtends() on WsdlToPhp\PackageGenerator\Model\Struct|null.
    Last edited by Mikael DELSOL
  6. ]);
  7. if (!empty($param)) {
  8. $annotationBlock->addChild(new PhpAnnotation(self::ANNOTATION_PARAM, $param));
  9. }
  1. return $annotationBlock;
  2. }
  3. protected function getArrayMethodBody(string $method, $var = ''): string
  4. {
  5. return sprintf('return parent::%s(%s);', $method, $var);
    Parameter #3 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikael DELSOL
  6. }
  7. }
  1. protected function fillClassConstants(ConstantContainer $constants): void
  2. {
  3. /** @var StructModel $model */
  4. $model = $this->getModel();
  5. foreach ($model->getValues() as $value) {
  6. $constants->add(new PhpConstant($value->getCleanName(), $value->getValue()));
    Cannot call method getCleanName() on mixed.
    Last edited by Mikael DELSOL
  7. }
  8. }
  9. protected function defineUseStatements(): self
  10. {
  1. protected function fillClassConstants(ConstantContainer $constants): void
  2. {
  3. /** @var StructModel $model */
  4. $model = $this->getModel();
  5. foreach ($model->getValues() as $value) {
  6. $constants->add(new PhpConstant($value->getCleanName(), $value->getValue()));
    Cannot call method getValue() on mixed.
    Last edited by Mikael DELSOL
  7. }
  8. }
  9. protected function defineUseStatements(): self
  10. {
  1. }
  2. protected function getConstantAnnotationBlock(PhpConstant $constant): ?PhpAnnotationBlock
  3. {
  4. $block = new PhpAnnotationBlock([
  5. sprintf('Constant for value \'%s\'', $constant->getValue()),
    Parameter #2 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikael DELSOL
  6. ]);
  7. /** @var StructModel $model */
  8. $model = $this->getModel();
  9. if (($value = $model->getValue($constant->getValue())) instanceof StructValueModel) {
  1. /** @var StructModel $model */
  2. $model = $this->getModel();
  3. if (($value = $model->getValue($constant->getValue())) instanceof StructValueModel) {
  4. $this->defineModelAnnotationsFromWsdl($block, $value);
  5. }
  6. $block->addChild(new PhpAnnotation(self::ANNOTATION_RETURN, sprintf('string \'%s\'', $constant->getValue())));
    Parameter #2 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikael DELSOL
  7. return $block;
  8. }
  9. protected function fillClassMethods(): void
  1. {
  2. $method = new PhpMethod(self::METHOD_GET_VALID_VALUES, [], self::TYPE_ARRAY, PhpMethod::ACCESS_PUBLIC, false, true);
  3. $validValues = $this->getEnumMethodValues();
  4. $method->addChild('return [');
  5. foreach ($validValues as $validValue) {
  6. $method->addChild(sprintf('%s,', $method->getIndentedString($validValue, 1)));
    Parameter #1 $string of method WsdlToPhp\PhpGenerator\Element\AbstractElement::getIndentedString() expects string, mixed given.
    Last edited by Mikael DELSOL
  7. }
  8. $method->addChild('];');
  9. return $method;
  10. }
  1. $values = [];
  2. /** @var StructModel $model */
  3. $model = $this->getModel();
  4. foreach ($model->getValues() as $value) {
  5. $values[] = sprintf('self::%s', $value->getCleanName());
    Cannot call method getCleanName() on mixed.
    Last edited by Mikael DELSOL
  6. }
  7. return $values;
  8. }
  1. $values = [];
  2. /** @var StructModel $model */
  3. $model = $this->getModel();
  4. foreach ($model->getValues() as $value) {
  5. $values[] = sprintf('self::%s', $value->getCleanName());
    Parameter #2 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikael DELSOL
  6. }
  7. return $values;
  8. }
in src/File/Tutorial.php, line 55
  1. }
  2. public function addContent(): self
  3. {
  4. foreach ($this->getGenerator()->getServices(true) as $service) {
  5. $serviceVariableName = lcfirst($service->getName());
    Parameter #1 $str of function lcfirst expects string, mixed given.
    Last edited by Mikael DELSOL
  6. $this->addAnnotationBlockFromService($service)->addServiceDeclaration($serviceVariableName, $service)->addServiceSoapHeadersDefinitions($serviceVariableName, $service)->addContentFromService($serviceVariableName, $service);
  7. }
  8. return $this;
  9. }
in src/File/Tutorial.php, line 55
  1. }
  2. public function addContent(): self
  3. {
  4. foreach ($this->getGenerator()->getServices(true) as $service) {
  5. $serviceVariableName = lcfirst($service->getName());
    Cannot call method getName() on mixed.
    Last edited by Mikael DELSOL
  6. $this->addAnnotationBlockFromService($service)->addServiceDeclaration($serviceVariableName, $service)->addServiceSoapHeadersDefinitions($serviceVariableName, $service)->addContentFromService($serviceVariableName, $service);
  7. }
  8. return $this;
  9. }
in src/File/Tutorial.php, line 56
  1. public function addContent(): self
  2. {
  3. foreach ($this->getGenerator()->getServices(true) as $service) {
  4. $serviceVariableName = lcfirst($service->getName());
  5. $this->addAnnotationBlockFromService($service)->addServiceDeclaration($serviceVariableName, $service)->addServiceSoapHeadersDefinitions($serviceVariableName, $service)->addContentFromService($serviceVariableName, $service);
    Parameter #2 $service of method WsdlToPhp\PackageGenerator\File\Tutorial::addContentFromService() expects WsdlToPhp\PackageGenerator\Model\Service, mixed given.
    Last edited by Mikael DELSOL
  6. }
  7. return $this;
  8. }
in src/File/Tutorial.php, line 56
  1. public function addContent(): self
  2. {
  3. foreach ($this->getGenerator()->getServices(true) as $service) {
  4. $serviceVariableName = lcfirst($service->getName());
  5. $this->addAnnotationBlockFromService($service)->addServiceDeclaration($serviceVariableName, $service)->addServiceSoapHeadersDefinitions($serviceVariableName, $service)->addContentFromService($serviceVariableName, $service);
    Parameter #2 $service of method WsdlToPhp\PackageGenerator\File\Tutorial::addServiceSoapHeadersDefinitions() expects WsdlToPhp\PackageGenerator\Model\Service, mixed given.
    Last edited by Mikael DELSOL
  6. }
  7. return $this;
  8. }
in src/File/Tutorial.php, line 56
  1. public function addContent(): self
  2. {
  3. foreach ($this->getGenerator()->getServices(true) as $service) {
  4. $serviceVariableName = lcfirst($service->getName());
  5. $this->addAnnotationBlockFromService($service)->addServiceDeclaration($serviceVariableName, $service)->addServiceSoapHeadersDefinitions($serviceVariableName, $service)->addContentFromService($serviceVariableName, $service);
    Parameter #2 $service of method WsdlToPhp\PackageGenerator\File\Tutorial::addServiceDeclaration() expects WsdlToPhp\PackageGenerator\Model\Service, mixed given.
    Last edited by Mikael DELSOL
  6. }
  7. return $this;
  8. }
in src/File/Tutorial.php, line 56
  1. public function addContent(): self
  2. {
  3. foreach ($this->getGenerator()->getServices(true) as $service) {
  4. $serviceVariableName = lcfirst($service->getName());
  5. $this->addAnnotationBlockFromService($service)->addServiceDeclaration($serviceVariableName, $service)->addServiceSoapHeadersDefinitions($serviceVariableName, $service)->addContentFromService($serviceVariableName, $service);
    Parameter #1 $service of method WsdlToPhp\PackageGenerator\File\Tutorial::addAnnotationBlockFromService() expects WsdlToPhp\PackageGenerator\Model\Service, mixed given.
    Last edited by Mikael DELSOL
  6. }
  7. return $this;
  8. }
in src/File/Tutorial.php, line 72
  1. ->addChild($block, 'In addition, the goal is to show which methods are available and the first needed parameter(s)')
  2. ->addChild($block, 'You have to use an associative array such as:')
  3. ->addChild($block, '- the key must be a constant beginning with WSDL_ from AbstractSoapClientBase class (each generated ServiceType class extends this class)')
  4. ->addChild($block, '- the value must be the corresponding key value (each option matches a {@link http://www.php.net/manual/en/soapclient.soapclient.php} option)')
  5. ->addChild($block, '$options = [')
  6. ->addChild($block, sprintf('%s::WSDL_URL => \'%s\',', AbstractSoapClientBase::class, $this->getGenerator()->getWsdl()->getName()))
    Cannot call method getName() on WsdlToPhp\PackageGenerator\Model\Wsdl|null.
    Last edited by Mikaël DELSOL
  7. ->addChild($block, sprintf('%s::WSDL_TRACE => true,', AbstractSoapClientBase::class))
  8. ->addChild($block, sprintf('%s::WSDL_LOGIN => \'you_secret_login\',', AbstractSoapClientBase::class))
  9. ->addChild($block, sprintf('%s::WSDL_PASSWORD => \'you_secret_password\',', AbstractSoapClientBase::class))
  10. ->addChild($block, '];')
  11. ->addChild($block, 'etc...')
in src/File/Tutorial.php, line 72
  1. ->addChild($block, 'In addition, the goal is to show which methods are available and the first needed parameter(s)')
  2. ->addChild($block, 'You have to use an associative array such as:')
  3. ->addChild($block, '- the key must be a constant beginning with WSDL_ from AbstractSoapClientBase class (each generated ServiceType class extends this class)')
  4. ->addChild($block, '- the value must be the corresponding key value (each option matches a {@link http://www.php.net/manual/en/soapclient.soapclient.php} option)')
  5. ->addChild($block, '$options = [')
  6. ->addChild($block, sprintf('%s::WSDL_URL => \'%s\',', AbstractSoapClientBase::class, $this->getGenerator()->getWsdl()->getName()))
    Parameter #3 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikaël DELSOL
  7. ->addChild($block, sprintf('%s::WSDL_TRACE => true,', AbstractSoapClientBase::class))
  8. ->addChild($block, sprintf('%s::WSDL_LOGIN => \'you_secret_login\',', AbstractSoapClientBase::class))
  9. ->addChild($block, sprintf('%s::WSDL_PASSWORD => \'you_secret_password\',', AbstractSoapClientBase::class))
  10. ->addChild($block, '];')
  11. ->addChild($block, 'etc...')
in src/File/Tutorial.php, line 106
  1. {
  2. $this
  3. ->getFile()
  4. ->getMainElement()
  5. ->addChild('$options = [')
  6. ->addChild($this->getFile()->getMainElement()->getIndentedString(sprintf('WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_URL => \'%s\',', $this->getGenerator()->getWsdl()->getName()), 1))
    Parameter #2 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikaël DELSOL
  7. ->addChild($this->getFile()->getMainElement()->getIndentedString(sprintf('WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_CLASSMAP => %s::%s(),', $this->getGenerator()->getFiles()->getClassmapFile()->getModel()->getPackagedName(true), ClassMap::METHOD_NAME), 1))
  8. ->addChild('];')
  9. ;
  10. return $this;
in src/File/Tutorial.php, line 106
  1. {
  2. $this
  3. ->getFile()
  4. ->getMainElement()
  5. ->addChild('$options = [')
  6. ->addChild($this->getFile()->getMainElement()->getIndentedString(sprintf('WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_URL => \'%s\',', $this->getGenerator()->getWsdl()->getName()), 1))
    Cannot call method getName() on WsdlToPhp\PackageGenerator\Model\Wsdl|null.
    Last edited by Mikaël DELSOL
  7. ->addChild($this->getFile()->getMainElement()->getIndentedString(sprintf('WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_CLASSMAP => %s::%s(),', $this->getGenerator()->getFiles()->getClassmapFile()->getModel()->getPackagedName(true), ClassMap::METHOD_NAME), 1))
  8. ->addChild('];')
  9. ;
  10. return $this;
in src/File/Tutorial.php, line 107
  1. $this
  2. ->getFile()
  3. ->getMainElement()
  4. ->addChild('$options = [')
  5. ->addChild($this->getFile()->getMainElement()->getIndentedString(sprintf('WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_URL => \'%s\',', $this->getGenerator()->getWsdl()->getName()), 1))
  6. ->addChild($this->getFile()->getMainElement()->getIndentedString(sprintf('WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_CLASSMAP => %s::%s(),', $this->getGenerator()->getFiles()->getClassmapFile()->getModel()->getPackagedName(true), ClassMap::METHOD_NAME), 1))
    Cannot call method getPackagedName() on WsdlToPhp\PackageGenerator\Model\AbstractModel|null.
    Last edited by Mikaël DELSOL
  7. ->addChild('];')
  8. ;
  9. return $this;
  10. }
in src/File/Tutorial.php, line 117
  1. }
  2. protected function addAnnotationBlockFromService(ServiceModel $service): self
  3. {
  4. return $this->addAnnotationBlock([
  5. sprintf('Samples for %s ServiceType', $service->getName()),
    Parameter #2 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikael DELSOL
  6. ]);
  7. }
  8. protected function addContentFromService(string $serviceVariableName, ServiceModel $service): self
  9. {
in src/File/Tutorial.php, line 124
  1. }
  2. protected function addContentFromService(string $serviceVariableName, ServiceModel $service): self
  3. {
  4. foreach ($service->getMethods() as $method) {
  5. $this->addAnnotationBlockFromMethod($method)->addContentFromMethod($serviceVariableName, $method);
    Parameter #2 $method of method WsdlToPhp\PackageGenerator\File\Tutorial::addContentFromMethod() expects WsdlToPhp\PackageGenerator\Model\Method, mixed given.
    Last edited by Mikael DELSOL
  6. }
  7. return $this;
  8. }
in src/File/Tutorial.php, line 124
  1. }
  2. protected function addContentFromService(string $serviceVariableName, ServiceModel $service): self
  3. {
  4. foreach ($service->getMethods() as $method) {
  5. $this->addAnnotationBlockFromMethod($method)->addContentFromMethod($serviceVariableName, $method);
    Parameter #1 $method of method WsdlToPhp\PackageGenerator\File\Tutorial::addAnnotationBlockFromMethod() expects WsdlToPhp\PackageGenerator\Model\Method, mixed given.
    Last edited by Mikael DELSOL
  6. }
  7. return $this;
  8. }
in src/File/Tutorial.php, line 141
  1. protected function addServiceSoapHeadersDefinitions(string $serviceVariableName, ServiceModel $service): self
  2. {
  3. $added = [];
  4. foreach ($service->getMethods() as $method) {
  5. $added = array_merge($added, $this->addServiceSoapHeadersDefinition($serviceVariableName, $method, $added));
    Parameter #2 $method of method WsdlToPhp\PackageGenerator\File\Tutorial::addServiceSoapHeadersDefinition() expects WsdlToPhp\PackageGenerator\Model\Method, mixed given.
    Last edited by Mikael DELSOL
  6. }
  7. return $this;
  8. }
in src/File/Tutorial.php, line 157
  1. if (in_array($soapHeaderName, $added, true)) {
  2. continue;
  3. }
  4. $addedNames[] = $soapHeaderName;
  5. $this->getFile()->getMainElement()->addChild(sprintf('$%s->%s%s(%s);', $serviceVariableName, Service::METHOD_SET_HEADER_PREFIX, ucfirst($soapHeaderName), $this->getMethodParameter($soapHeaderName)));
    Parameter #1 $str of function ucfirst expects string, mixed given.
    Last edited by Mikaël DELSOL
  6. }
  7. return $addedNames;
  8. }
in src/File/Tutorial.php, line 157
  1. if (in_array($soapHeaderName, $added, true)) {
  2. continue;
  3. }
  4. $addedNames[] = $soapHeaderName;
  5. $this->getFile()->getMainElement()->addChild(sprintf('$%s->%s%s(%s);', $serviceVariableName, Service::METHOD_SET_HEADER_PREFIX, ucfirst($soapHeaderName), $this->getMethodParameter($soapHeaderName)));
    Parameter #1 $parameterType of method WsdlToPhp\PackageGenerator\File\Tutorial::getMethodParameter() expects string|null, mixed given.
    Last edited by Mikaël DELSOL
  6. }
  7. return $addedNames;
  8. }
in src/File/Tutorial.php, line 190
  1. protected function getMethodParameters(MethodModel $method): string
  2. {
  3. $parameters = [];
  4. if (is_array($method->getParameterType())) {
  5. foreach ($method->getParameterType() as $parameterName => $parameterType) {
  6. $parameters[] = $this->getMethodParameter($parameterType, $parameterName);
    Parameter #1 $parameterType of method WsdlToPhp\PackageGenerator\File\Tutorial::getMethodParameter() expects string|null, mixed given.
    Last edited by Mikael DELSOL
  7. }
  8. } else {
  9. $parameters[] = $this->getMethodParameter($method->getParameterType());
  10. }
in src/File/Tutorial.php, line 193
  1. if (is_array($method->getParameterType())) {
  2. foreach ($method->getParameterType() as $parameterName => $parameterType) {
  3. $parameters[] = $this->getMethodParameter($parameterType, $parameterName);
  4. }
  5. } else {
  6. $parameters[] = $this->getMethodParameter($method->getParameterType());
    Parameter #1 $parameterType of method WsdlToPhp\PackageGenerator\File\Tutorial::getMethodParameter() expects string|null, mixed given.
    Last edited by Mikael DELSOL
  7. }
  8. return implode(', ', $parameters);
  9. }
  1. $method = '';
  2. $checkValueDomain = '';
  3. if (is_numeric($value)) {
  4. $test = '$%1$s %3$s %2$s';
  5. } else {
  6. if (false === mb_strpos($value, '-')) {
    Parameter #1 $haystack of function mb_strpos expects string, mixed given.
    Last edited by Mikaël DELSOL
  7. $method = 'add';
  8. } else {
  9. $method = 'sub';
  10. $value = mb_substr($value, 1);
  11. }
  1. } else {
  2. if (false === mb_strpos($value, '-')) {
  3. $method = 'add';
  4. } else {
  5. $method = 'sub';
  6. $value = mb_substr($value, 1);
    Parameter #1 $str of function mb_substr expects string, mixed given.
    Last edited by Mikaël DELSOL
  7. }
  8. switch ($this->symbol()) {
  9. case self::SYMBOL_MAX_EXCLUSIVE:
  10. case self::SYMBOL_MAX_INCLUSIVE:
  1. break;
  2. }
  3. $test = 'false %5$s mb_strpos((string) $%1$s, \'-\') && ($time = (string) time()) && \DateTime::createFromFormat(\'U\', $time)->%4$s(new \DateInterval(preg_replace(\'/(.*)(\.[0-9]*S)/\', \'$1S\', str_replace(\'-\', \'\', $%1$s)))) %3$s \DateTime::createFromFormat(\'U\', $time)->%4$s(new \DateInterval(preg_replace(\'/(.*)(\.[0-9]*S)/\', \'$1S\', \'%2$s\')))';
  4. }
  5. return sprintf(($itemType ? '' : '!is_null($%1$s) && ').$test, $parameterName, $value, $this->symbol(), $method, $checkValueDomain);
    Parameter #3 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikaël DELSOL
  6. }
  7. final public function exceptionMessageOnTestFailure(string $parameterName, $value, bool $itemType = false): string
  8. {
  9. return sprintf('sprintf(\'Invalid value %%s, the value must be %s %s %s\', var_export($%4$s, true))', is_numeric($value) ? 'numerically' : 'chronologically', $this->comparisonString(), is_array($value) ? implode(',', array_unique($value)) : $value, $parameterName);
  1. return sprintf(($itemType ? '' : '!is_null($%1$s) && ').$test, $parameterName, $value, $this->symbol(), $method, $checkValueDomain);
  2. }
  3. final public function exceptionMessageOnTestFailure(string $parameterName, $value, bool $itemType = false): string
  4. {
  5. return sprintf('sprintf(\'Invalid value %%s, the value must be %s %s %s\', var_export($%4$s, true))', is_numeric($value) ? 'numerically' : 'chronologically', $this->comparisonString(), is_array($value) ? implode(',', array_unique($value)) : $value, $parameterName);
    Parameter #4 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikaël DELSOL
  6. }
  7. }
  1. {
  2. if ($itemType || !$this->getAttribute()->isArray()) {
  3. $test = sprintf(
  4. ($itemType ? '' : '!is_null($%1$s) && ').'mb_strlen((string) $%1$s) %3$s %2$d',
  5. $parameterName,
  6. $value,
    Parameter #3 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikaël DELSOL
  7. $this->symbol()
  8. );
  9. } else {
  10. $this->addArrayValidationMethod($parameterName, $value);
  11. $test = sprintf(
  1. {
  2. if ($itemType || !$this->getAttribute()->isArray()) {
  3. $message = sprintf(
  4. 'sprintf(\'Invalid length of %%s, the number of characters/octets contained by the literal must be %s %s\', mb_strlen((string) $%s))',
  5. $this->comparisonString(),
  6. is_array($value) ? implode(',', array_unique($value)) : $value,
    Parameter #3 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikaël DELSOL
  7. $parameterName
  8. );
  9. } else {
  10. $message = $this->getArrayErrorMessageVariableName($parameterName);
  11. }
  1. final protected function getArrayExceptionMessageOnTestFailure($value): string
  2. {
  3. return sprintf(
  4. 'Invalid length for value(s) %%s, the number of characters/octets contained by the literal must be %s %s',
  5. $this->comparisonString(),
  6. $value
    Parameter #3 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikaël DELSOL
  7. );
  8. }
  9. }
  1. {
  2. return sprintf(
  3. '// %s %s%s',
  4. self::VALIDATION_RULE_COMMENT_SENTENCE,
  5. $this->name(),
  6. is_array($value) ? sprintf('(%s)', implode(', ', array_unique($value))) : (empty($value) ? '' : sprintf('(%s)', $value))
    Parameter #2 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikaël DELSOL
  7. );
  8. }
  9. abstract public function name(): string;
  1. final protected function addArrayValidationMethod(string $parameterName, $value): void
  2. {
  3. $itemName = sprintf(
  4. '%s%sItem',
  5. lcfirst($this->getFile()->getModel()->getCleanName(false)),
    Cannot call method getCleanName() on WsdlToPhp\PackageGenerator\Model\AbstractModel|null.
    Last edited by Mikaël DELSOL
  6. ucfirst($this->getAttribute()->getCleanName())
  7. );
  8. $method = new PhpMethod($this->getValidationMethodName($parameterName), [
  9. new PhpFunctionParameter('values', null, 'array'),
  10. ], AbstractModelFile::TYPE_STRING, PhpMethod::ACCESS_PUBLIC, false, true);
  1. {
  2. $method = new PhpMethod($this->getValidationMethodName($parameterName), [
  3. new PhpFunctionParameter('values', [], '?array'),
  4. ], AbstractModelFile::TYPE_STRING, PhpMethod::ACCESS_PUBLIC, false, true);
  5. $model = $this->getFile()->getRestrictionFromStructAttribute($this->getAttribute());
  6. $itemName = sprintf('%s%sItem', lcfirst($this->getFile()->getModel()->getCleanName(false)), ucfirst($this->getAttribute()->getCleanName()));
    Cannot call method getCleanName() on WsdlToPhp\PackageGenerator\Model\AbstractModel|null.
    Last edited by Mikaël DELSOL
  7. $rules = clone $this->getRules();
  8. if ($model instanceof Struct) {
  9. $rule = $rules->getEnumerationRule();
  10. } else {
  1. {
  2. $attribute = $this->getAttribute();
  3. $struct = $attribute->getOwner();
  4. $choiceAttributes = [];
  5. foreach ($choiceNames as $choiceName) {
  6. if ($choiceName !== $attribute->getName() && $choiceAttribute = $struct->getAttribute($choiceName)) {
    Parameter #1 $attributeName of method WsdlToPhp\PackageGenerator\Model\Struct::getAttribute() expects string, mixed given.
    Last edited by Mikaël DELSOL
  7. $choiceAttributes[] = $choiceAttribute;
  8. }
  9. }
  10. $method = new PhpMethod($this->getValidationMethodName($parameterName), [
  1. $method
  2. ->addChild('];')
  3. ->addChild('try {')
  4. ->addChild($method->getIndentedString('foreach ($properties as $property) {', 1))
  5. ->addChild($method->getIndentedString('if (isset($this->{$property})) {', 2))
  6. ->addChild($method->getIndentedString(sprintf('throw new InvalidArgumentException(sprintf(\'The property %1$s can\\\'t be set as the property %%s is already set. Only one property must be set among these properties: %1$s, %%s.\', $property, implode(\', \', $properties)), __LINE__);', $attribute->getName()), 3))
    Parameter #2 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikaël DELSOL
  7. ->addChild($method->getIndentedString(sprintf('}'), 2))
  8. ->addChild($method->getIndentedString('}', 1))
  9. ->addChild('} catch (InvalidArgumentException $e) {')
  10. ->addChild($method->getIndentedString('$message = $e->getMessage();', 1))
  11. ->addChild('}')
  1. return 'fractionDigits';
  2. }
  3. public function testConditions(string $parameterName, $value, bool $itemType = false): string
  4. {
  5. return sprintf(($itemType ? '' : '!is_null($%1$s) && ').'mb_strlen(mb_substr((string) $%1$s, false !== mb_strpos((string) $%1$s, \'.\') ? mb_strpos((string) $%1$s, \'.\') + 1 : mb_strlen((string) $%1$s))) > %2$d', $parameterName, $value);
    Parameter #3 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikaël DELSOL
  6. }
  7. public function exceptionMessageOnTestFailure(string $parameterName, $value, bool $itemType = false): string
  8. {
  9. return sprintf('sprintf(\'Invalid value %%s, the value must at most contain %1$d fraction digits, %%d given\', var_export($%2$s, true), mb_strlen(mb_substr((string) $%2$s, mb_strpos((string) $%2$s, \'.\') + 1)))', $value, $parameterName);
  1. return sprintf(($itemType ? '' : '!is_null($%1$s) && ').'mb_strlen(mb_substr((string) $%1$s, false !== mb_strpos((string) $%1$s, \'.\') ? mb_strpos((string) $%1$s, \'.\') + 1 : mb_strlen((string) $%1$s))) > %2$d', $parameterName, $value);
  2. }
  3. public function exceptionMessageOnTestFailure(string $parameterName, $value, bool $itemType = false): string
  4. {
  5. return sprintf('sprintf(\'Invalid value %%s, the value must at most contain %1$d fraction digits, %%d given\', var_export($%2$s, true), mb_strlen(mb_substr((string) $%2$s, mb_strpos((string) $%2$s, \'.\') + 1)))', $value, $parameterName);
    Parameter #2 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikaël DELSOL
  6. }
  7. }
  1. $symbol = self::SYMBOL_MAX_EXCLUSIVE;
  2. } else {
  3. $test = 'is_array($%4$s) && count($%4$s) %3$s %2$d';
  4. $symbol = $this->symbol();
  5. }
  6. $test = sprintf($test, $this->getAttribute()->getCleanName(), $value, $symbol, $parameterName);
    Parameter #3 ...$values of function sprintf expects bool|float|int|string|null, array<mixed, mixed>|bool|float|int|string given.
    Last edited by Mikaël DELSOL
  7. }
  8. return $test;
  9. }
  1. $message = 'sprintf(\'You can\\\'t add anymore element to this property that already contains %%s elements, the number of elements contained by the property must be %1$s %2$s\', count($this->%4$s))';
  2. } else {
  3. $message = 'sprintf(\'Invalid count of %%s, the number of elements contained by the property must be %1$s %2$s\', count($%3$s))';
  4. }
  5. return sprintf($message, $this->comparisonString(), is_array($value) ? implode(',', array_unique($value)) : $value, $parameterName, $this->getAttribute()->getCleanName());
    Parameter #3 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikaël DELSOL
  6. }
  7. }
  1. array_map(
  2. static fn ($value): string => addcslashes($value, '\'\/'),
  3. array_map(
  4. static fn ($value): string => empty($value) ? '^$' : $value,
  5. array_map(
  6. 'trim',
    Parameter #1 $callback of function array_map expects (callable(mixed): mixed)|null, 'trim' given.
    Last edited by Mikaël DELSOL
  7. array_filter(
  8. is_array($value) ? $value : [$value],
  9. static fn ($value): bool => !in_array($value, ['true', 'false', true, false], true)
  10. )
  11. )
  1. return 'totalDigits';
  2. }
  3. public function testConditions(string $parameterName, $value, bool $itemType = false): string
  4. {
  5. return sprintf(($itemType ? '' : '!is_null($%1$s) && ').'mb_strlen(preg_replace(\'/(\D)/\', \'\', (string) $%1$s)) > %2$d', $parameterName, $value);
    Parameter #3 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikaël DELSOL
  6. }
  7. public function exceptionMessageOnTestFailure(string $parameterName, $value, bool $itemType = false): string
  8. {
  9. return sprintf('sprintf(\'Invalid value %%s, the value must use at most %1$d digits, "%%d" given\', var_export($%2$s, true), mb_strlen(preg_replace(\'/(\D)/\', \'\', (string) $%2$s)))', $value, $parameterName);
  1. return sprintf(($itemType ? '' : '!is_null($%1$s) && ').'mb_strlen(preg_replace(\'/(\D)/\', \'\', (string) $%1$s)) > %2$d', $parameterName, $value);
  2. }
  3. public function exceptionMessageOnTestFailure(string $parameterName, $value, bool $itemType = false): string
  4. {
  5. return sprintf('sprintf(\'Invalid value %%s, the value must use at most %1$d digits, "%%d" given\', var_export($%2$s, true), mb_strlen(preg_replace(\'/(\D)/\', \'\', (string) $%2$s)))', $value, $parameterName);
    Parameter #2 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikaël DELSOL
  6. }
  7. }
  1. if (!in_array($validationRules, $existingValidationRules)) {
  2. foreach ($validationRules as $validationRuleIndex => $validationRule) {
  3. // avoid having a validation rule that has already been applied to the attribute within the method which is calling the validate method
  4. if (0 === $validationRuleIndex) {
  5. $ruleParts = [];
  6. preg_match(sprintf('/%s\s(\w*)(.*)?/', self::VALIDATION_RULE_COMMENT_SENTENCE), $validationRule, $ruleParts);
    Parameter #2 $subject of function preg_match expects string, mixed given.
    Last edited by Mikaël DELSOL
  7. if (3 === count($ruleParts) && !empty($ruleParts[1]) && $rules->getRule($ruleParts[1]) instanceof AbstractRule && Rules::hasRuleBeenAppliedToAttribute($rules->getRule($ruleParts[1]), $ruleParts[2], $this->getAttribute())) {
  8. continue 2;
  9. }
  10. }
  1. * @param mixed $arguments
  2. * @throws \BadMethodCallException
  3. */
  4. public function __call($name, $arguments)
  5. {
  6. if (($prefix = 'getOption') === substr($name, 0, $length = strlen($prefix)) && empty($arguments)) {
    Parameter #1 $string of function substr expects string, mixed given.
    Last edited by Mikaël DELSOL
  7. $getMethod = 'get'.substr($name, $length);
  8. return $this->options->{$getMethod}();
  9. }
  10. if (($prefix = 'setOption') === substr($name, 0, $length = strlen($prefix)) && 1 === (is_countable($arguments) ? count($arguments) : 0)) {
  1. * @throws \BadMethodCallException
  2. */
  3. public function __call($name, $arguments)
  4. {
  5. if (($prefix = 'getOption') === substr($name, 0, $length = strlen($prefix)) && empty($arguments)) {
  6. $getMethod = 'get'.substr($name, $length);
    Parameter #1 $string of function substr expects string, mixed given.
    Last edited by Mikaël DELSOL
  7. return $this->options->{$getMethod}();
  8. }
  9. if (($prefix = 'setOption') === substr($name, 0, $length = strlen($prefix)) && 1 === (is_countable($arguments) ? count($arguments) : 0)) {
  10. $setMethod = 'set'.substr($name, $length);
  1. if (($prefix = 'getOption') === substr($name, 0, $length = strlen($prefix)) && empty($arguments)) {
  2. $getMethod = 'get'.substr($name, $length);
  3. return $this->options->{$getMethod}();
  4. }
  5. if (($prefix = 'setOption') === substr($name, 0, $length = strlen($prefix)) && 1 === (is_countable($arguments) ? count($arguments) : 0)) {
    Parameter #1 $string of function substr expects string, mixed given.
    Last edited by Mikaël DELSOL
  6. $setMethod = 'set'.substr($name, $length);
  7. $this->options->{$setMethod}(array_shift($arguments));
  8. return $this;
  9. }
  1. $getMethod = 'get'.substr($name, $length);
  2. return $this->options->{$getMethod}();
  3. }
  4. if (($prefix = 'setOption') === substr($name, 0, $length = strlen($prefix)) && 1 === (is_countable($arguments) ? count($arguments) : 0)) {
  5. $setMethod = 'set'.substr($name, $length);
    Parameter #1 $string of function substr expects string, mixed given.
    Last edited by Mikaël DELSOL
  6. $this->options->{$setMethod}(array_shift($arguments));
  7. return $this;
  8. }
  1. return $this->options->{$getMethod}();
  2. }
  3. if (($prefix = 'setOption') === substr($name, 0, $length = strlen($prefix)) && 1 === (is_countable($arguments) ? count($arguments) : 0)) {
  4. $setMethod = 'set'.substr($name, $length);
  5. $this->options->{$setMethod}(array_shift($arguments));
    Parameter #1 $stack of function array_shift expects array, mixed given.
    Last edited by Mikaël DELSOL
  6. return $this;
  7. }
  8. throw new \BadMethodCallException(sprintf('Method %s is undefined', $name));
  1. $this->options->{$setMethod}(array_shift($arguments));
  2. return $this;
  3. }
  4. throw new \BadMethodCallException(sprintf('Method %s is undefined', $name));
    Parameter #2 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikaël DELSOL
  5. }
  6. public function getParsers(): GeneratorParsers
  7. {
  8. return $this->parsers;
  1. $services = $this->containers->getServices();
  2. if ($usingGatherMethods && GeneratorOptions::VALUE_NONE === $this->getOptionGatherMethods()) {
  3. $serviceContainer = new ServiceContainer($this);
  4. $serviceModel = new Service($this, Service::DEFAULT_SERVICE_CLASS_NAME);
  5. foreach ($services as $service) {
  6. foreach ($service->getMethods() as $method) {
    Cannot call method getMethods() on mixed.
    Last edited by Mikael DELSOL
  7. $serviceModel->getMethods()->add($method);
  8. }
  9. }
  10. $serviceContainer->add($serviceModel);
  11. $services = $serviceContainer;
  1. if ($usingGatherMethods && GeneratorOptions::VALUE_NONE === $this->getOptionGatherMethods()) {
  2. $serviceContainer = new ServiceContainer($this);
  3. $serviceModel = new Service($this, Service::DEFAULT_SERVICE_CLASS_NAME);
  4. foreach ($services as $service) {
  5. foreach ($service->getMethods() as $method) {
  6. $serviceModel->getMethods()->add($method);
    Parameter #1 $object of method WsdlToPhp\PackageGenerator\Container\AbstractObjectContainer::add() expects object, mixed given.
    Last edited by Mikael DELSOL
  7. }
  8. }
  9. $serviceContainer->add($serviceModel);
  10. $services = $serviceContainer;
  11. }
  1. return $this;
  2. }
  3. public function getOptionPrefix(bool $ucFirst = true): string
  4. {
  5. return $ucFirst ? ucfirst($this->getOptions()->getPrefix()) : $this->getOptions()->getPrefix();
    Cannot call method getPrefix() on WsdlToPhp\PackageGenerator\ConfigurationReader\GeneratorOptions|null.
    Last edited by Mikael DELSOL
  6. }
  7. public function getOptionSuffix(bool $ucFirst = true): string
  8. {
  9. return $ucFirst ? ucfirst($this->getOptions()->getSuffix()) : $this->getOptions()->getSuffix();
  1. return $ucFirst ? ucfirst($this->getOptions()->getPrefix()) : $this->getOptions()->getPrefix();
  2. }
  3. public function getOptionSuffix(bool $ucFirst = true): string
  4. {
  5. return $ucFirst ? ucfirst($this->getOptions()->getSuffix()) : $this->getOptions()->getSuffix();
    Cannot call method getSuffix() on WsdlToPhp\PackageGenerator\ConfigurationReader\GeneratorOptions|null.
    Last edited by Mikael DELSOL
  6. }
  7. public function setOptionOrigin(string $optionOrigin): self
  8. {
  9. $this->options->setOrigin($optionOrigin);
  1. $decodedJson = json_decode($json, true);
  2. if (JSON_ERROR_NONE === json_last_error()) {
  3. // load options first
  4. $options = GeneratorOptions::instance();
  5. foreach ($decodedJson['options'] as $name => $value) {
  6. $options->setOptionValue($name, $value);
    Parameter #1 $optionName of method WsdlToPhp\PackageGenerator\ConfigurationReader\GeneratorOptions::setOptionValue() expects string, mixed given.
    Last edited by Mikael DELSOL
  7. }
  8. // create generator instance with options
  9. $instance = new self($options);
  10. // load services
  11. foreach ($decodedJson['containers']['services'] as $service) {
  1. }
  2. // create generator instance with options
  3. $instance = new self($options);
  4. // load services
  5. foreach ($decodedJson['containers']['services'] as $service) {
  6. $instance->getContainers()->getServices()->add(self::getModelInstanceFromJsonArrayEntry($instance, $service));
    Parameter #2 $jsonArrayEntry of static method WsdlToPhp\PackageGenerator\Generator\Generator::getModelInstanceFromJsonArrayEntry() expects array, mixed given.
    Last edited by Mikael DELSOL
  7. }
  8. // load structs
  9. foreach ($decodedJson['containers']['structs'] as $struct) {
  10. $instance->getContainers()->getStructs()->add(self::getModelInstanceFromJsonArrayEntry($instance, $struct));
  11. }
  1. foreach ($decodedJson['containers']['services'] as $service) {
  2. $instance->getContainers()->getServices()->add(self::getModelInstanceFromJsonArrayEntry($instance, $service));
  3. }
  4. // load structs
  5. foreach ($decodedJson['containers']['structs'] as $struct) {
  6. $instance->getContainers()->getStructs()->add(self::getModelInstanceFromJsonArrayEntry($instance, $struct));
    Parameter #2 $jsonArrayEntry of static method WsdlToPhp\PackageGenerator\Generator\Generator::getModelInstanceFromJsonArrayEntry() expects array, mixed given.
    Last edited by Mikael DELSOL
  7. }
  8. } else {
  9. throw new \InvalidArgumentException(sprintf('Json is invalid, please check error %s', json_last_error()));
  10. }
  1. foreach ($decodedJson['containers']['services'] as $service) {
  2. $instance->getContainers()->getServices()->add(self::getModelInstanceFromJsonArrayEntry($instance, $service));
  3. }
  4. // load structs
  5. foreach ($decodedJson['containers']['structs'] as $struct) {
  6. $instance->getContainers()->getStructs()->add(self::getModelInstanceFromJsonArrayEntry($instance, $struct));
    Parameter #1 $object of method WsdlToPhp\PackageGenerator\Container\Model\Struct::add() expects WsdlToPhp\PackageGenerator\Model\Struct, WsdlToPhp\PackageGenerator\Model\AbstractModel given.
    Last edited by Mikael DELSOL
  7. }
  8. } else {
  9. throw new \InvalidArgumentException(sprintf('Json is invalid, please check error %s', json_last_error()));
  10. }
  1. /**
  2. * @throws \InvalidArgumentException
  3. */
  4. protected function initDirectory(): self
  5. {
  6. Utils::createDirectory($this->getOptions()->getDestination());
    Cannot call method getDestination() on WsdlToPhp\PackageGenerator\ConfigurationReader\GeneratorOptions|null.
    Last edited by Mikaël DELSOL
  7. if (!is_writable($this->getOptionDestination())) {
  8. throw new \InvalidArgumentException(sprintf('Unable to use dir "%s" as dir does not exists, its creation has been impossible or it\'s not writable', $this->getOptionDestination()), __LINE__);
  9. }
  10. return $this;
  1. ;
  2. }
  3. protected function generateStructsClasses(): GeneratorFiles
  4. {
  5. foreach ($this->getGenerator()->getStructs() as $struct) {
    Cannot call method getStructs() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikaël DELSOL
  6. if (!$struct->isStruct()) {
  7. continue;
  8. }
  9. $this
  1. }
  2. protected function generateStructsClasses(): GeneratorFiles
  3. {
  4. foreach ($this->getGenerator()->getStructs() as $struct) {
  5. if (!$struct->isStruct()) {
    Cannot call method isStruct() on mixed.
    Last edited by Mikael DELSOL
  6. continue;
  7. }
  8. $this
  9. ->getStructFile($struct)
  1. if (!$struct->isStruct()) {
  2. continue;
  3. }
  4. $this
  5. ->getStructFile($struct)
    Parameter #1 $struct of method WsdlToPhp\PackageGenerator\Generator\GeneratorFiles::getStructFile() expects WsdlToPhp\PackageGenerator\Model\Struct, mixed given.
    Last edited by Mikaël DELSOL
  6. ->setModel($struct)
  7. ->write()
  8. ;
  9. }
  1. continue;
  2. }
  3. $this
  4. ->getStructFile($struct)
  5. ->setModel($struct)
    Parameter #1 $model of method WsdlToPhp\PackageGenerator\File\AbstractModelFile::setModel() expects WsdlToPhp\PackageGenerator\Model\AbstractModel, mixed given.
    Last edited by Mikaël DELSOL
  6. ->write()
  7. ;
  8. }
  9. return $this;
  1. return $file;
  2. }
  3. protected function generateServicesClasses(): self
  4. {
  5. foreach ($this->getGenerator()->getServices(true) as $service) {
    Cannot call method getServices() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikael DELSOL
  6. $file = new ServiceFile($this->generator, $service->getPackagedName());
  7. $file->setModel($service)->write();
  8. }
  9. return $this;
  1. }
  2. protected function generateServicesClasses(): self
  3. {
  4. foreach ($this->getGenerator()->getServices(true) as $service) {
  5. $file = new ServiceFile($this->generator, $service->getPackagedName());
    Cannot call method getPackagedName() on mixed.
    Last edited by Mikael DELSOL
  6. $file->setModel($service)->write();
  7. }
  8. return $this;
  9. }
  1. protected function generateServicesClasses(): self
  2. {
  3. foreach ($this->getGenerator()->getServices(true) as $service) {
  4. $file = new ServiceFile($this->generator, $service->getPackagedName());
  5. $file->setModel($service)->write();
    Parameter #1 $model of method WsdlToPhp\PackageGenerator\File\Service::setModel() expects WsdlToPhp\PackageGenerator\Model\AbstractModel, mixed given.
    Last edited by Mikael DELSOL
  6. }
  7. return $this;
  8. }
  1. }
  2. public function doParse(): self
  3. {
  4. foreach ($this->parsers as $parser) {
  5. $parser->parse();
    Cannot call method parse() on mixed.
    Last edited by Mikaël DELSOL
  6. }
  7. return $this;
  8. }
  1. $soapClient = new SoapClient($this->getSoapClientOptions(\SOAP_1_1));
  2. } catch (\SoapFault $fault) {
  3. try {
  4. $soapClient = new SoapClient($this->getSoapClientOptions(\SOAP_1_2));
  5. } catch (\SoapFault $fault) {
  6. throw new \InvalidArgumentException(sprintf('Unable to load WSDL at "%s"!', $this->getGenerator()->getOptionOrigin()), __LINE__, $fault);
    Cannot call method getOptionOrigin() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikaël DELSOL
  7. }
  8. }
  9. return $this->setSoapClient($soapClient);
  10. }
  1. public function getSoapClientOptions(int $soapVersion): array
  2. {
  3. return array_merge([
  4. SoapClientInterface::WSDL_SOAP_VERSION => $soapVersion,
  5. SoapClientInterface::WSDL_URL => $this->getGenerator()->getOptionOrigin(),
    Cannot call method getOptionOrigin() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikaël DELSOL
  6. SoapClientInterface::WSDL_LOGIN => $this->getGenerator()->getOptionBasicLogin(),
  7. SoapClientInterface::WSDL_PROXY_HOST => $this->getGenerator()->getOptionProxyHost(),
  8. SoapClientInterface::WSDL_PROXY_PORT => $this->getGenerator()->getOptionProxyPort(),
  9. SoapClientInterface::WSDL_PASSWORD => $this->getGenerator()->getOptionBasicPassword(),
  10. SoapClientInterface::WSDL_PROXY_LOGIN => $this->getGenerator()->getOptionProxyLogin(),
  1. public function getSoapClientOptions(int $soapVersion): array
  2. {
  3. return array_merge([
  4. SoapClientInterface::WSDL_SOAP_VERSION => $soapVersion,
  5. SoapClientInterface::WSDL_URL => $this->getGenerator()->getOptionOrigin(),
  6. SoapClientInterface::WSDL_LOGIN => $this->getGenerator()->getOptionBasicLogin(),
    Cannot call method getOptionBasicLogin() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikaël DELSOL
  7. SoapClientInterface::WSDL_PROXY_HOST => $this->getGenerator()->getOptionProxyHost(),
  8. SoapClientInterface::WSDL_PROXY_PORT => $this->getGenerator()->getOptionProxyPort(),
  9. SoapClientInterface::WSDL_PASSWORD => $this->getGenerator()->getOptionBasicPassword(),
  10. SoapClientInterface::WSDL_PROXY_LOGIN => $this->getGenerator()->getOptionProxyLogin(),
  11. SoapClientInterface::WSDL_PROXY_PASSWORD => $this->getGenerator()->getOptionProxyPassword(),
  1. {
  2. return array_merge([
  3. SoapClientInterface::WSDL_SOAP_VERSION => $soapVersion,
  4. SoapClientInterface::WSDL_URL => $this->getGenerator()->getOptionOrigin(),
  5. SoapClientInterface::WSDL_LOGIN => $this->getGenerator()->getOptionBasicLogin(),
  6. SoapClientInterface::WSDL_PROXY_HOST => $this->getGenerator()->getOptionProxyHost(),
    Cannot call method getOptionProxyHost() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikaël DELSOL
  7. SoapClientInterface::WSDL_PROXY_PORT => $this->getGenerator()->getOptionProxyPort(),
  8. SoapClientInterface::WSDL_PASSWORD => $this->getGenerator()->getOptionBasicPassword(),
  9. SoapClientInterface::WSDL_PROXY_LOGIN => $this->getGenerator()->getOptionProxyLogin(),
  10. SoapClientInterface::WSDL_PROXY_PASSWORD => $this->getGenerator()->getOptionProxyPassword(),
  11. ], $this->getGenerator()->getOptionSoapOptions());
  1. return array_merge([
  2. SoapClientInterface::WSDL_SOAP_VERSION => $soapVersion,
  3. SoapClientInterface::WSDL_URL => $this->getGenerator()->getOptionOrigin(),
  4. SoapClientInterface::WSDL_LOGIN => $this->getGenerator()->getOptionBasicLogin(),
  5. SoapClientInterface::WSDL_PROXY_HOST => $this->getGenerator()->getOptionProxyHost(),
  6. SoapClientInterface::WSDL_PROXY_PORT => $this->getGenerator()->getOptionProxyPort(),
    Cannot call method getOptionProxyPort() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikaël DELSOL
  7. SoapClientInterface::WSDL_PASSWORD => $this->getGenerator()->getOptionBasicPassword(),
  8. SoapClientInterface::WSDL_PROXY_LOGIN => $this->getGenerator()->getOptionProxyLogin(),
  9. SoapClientInterface::WSDL_PROXY_PASSWORD => $this->getGenerator()->getOptionProxyPassword(),
  10. ], $this->getGenerator()->getOptionSoapOptions());
  11. }
  1. SoapClientInterface::WSDL_SOAP_VERSION => $soapVersion,
  2. SoapClientInterface::WSDL_URL => $this->getGenerator()->getOptionOrigin(),
  3. SoapClientInterface::WSDL_LOGIN => $this->getGenerator()->getOptionBasicLogin(),
  4. SoapClientInterface::WSDL_PROXY_HOST => $this->getGenerator()->getOptionProxyHost(),
  5. SoapClientInterface::WSDL_PROXY_PORT => $this->getGenerator()->getOptionProxyPort(),
  6. SoapClientInterface::WSDL_PASSWORD => $this->getGenerator()->getOptionBasicPassword(),
    Cannot call method getOptionBasicPassword() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikaël DELSOL
  7. SoapClientInterface::WSDL_PROXY_LOGIN => $this->getGenerator()->getOptionProxyLogin(),
  8. SoapClientInterface::WSDL_PROXY_PASSWORD => $this->getGenerator()->getOptionProxyPassword(),
  9. ], $this->getGenerator()->getOptionSoapOptions());
  10. }
  1. SoapClientInterface::WSDL_URL => $this->getGenerator()->getOptionOrigin(),
  2. SoapClientInterface::WSDL_LOGIN => $this->getGenerator()->getOptionBasicLogin(),
  3. SoapClientInterface::WSDL_PROXY_HOST => $this->getGenerator()->getOptionProxyHost(),
  4. SoapClientInterface::WSDL_PROXY_PORT => $this->getGenerator()->getOptionProxyPort(),
  5. SoapClientInterface::WSDL_PASSWORD => $this->getGenerator()->getOptionBasicPassword(),
  6. SoapClientInterface::WSDL_PROXY_LOGIN => $this->getGenerator()->getOptionProxyLogin(),
    Cannot call method getOptionProxyLogin() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikaël DELSOL
  7. SoapClientInterface::WSDL_PROXY_PASSWORD => $this->getGenerator()->getOptionProxyPassword(),
  8. ], $this->getGenerator()->getOptionSoapOptions());
  9. }
  10. public function setSoapClient(SoapClient $soapClient): self
  1. SoapClientInterface::WSDL_LOGIN => $this->getGenerator()->getOptionBasicLogin(),
  2. SoapClientInterface::WSDL_PROXY_HOST => $this->getGenerator()->getOptionProxyHost(),
  3. SoapClientInterface::WSDL_PROXY_PORT => $this->getGenerator()->getOptionProxyPort(),
  4. SoapClientInterface::WSDL_PASSWORD => $this->getGenerator()->getOptionBasicPassword(),
  5. SoapClientInterface::WSDL_PROXY_LOGIN => $this->getGenerator()->getOptionProxyLogin(),
  6. SoapClientInterface::WSDL_PROXY_PASSWORD => $this->getGenerator()->getOptionProxyPassword(),
    Cannot call method getOptionProxyPassword() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikaël DELSOL
  7. ], $this->getGenerator()->getOptionSoapOptions());
  8. }
  9. public function setSoapClient(SoapClient $soapClient): self
  10. {
  1. SoapClientInterface::WSDL_PROXY_HOST => $this->getGenerator()->getOptionProxyHost(),
  2. SoapClientInterface::WSDL_PROXY_PORT => $this->getGenerator()->getOptionProxyPort(),
  3. SoapClientInterface::WSDL_PASSWORD => $this->getGenerator()->getOptionBasicPassword(),
  4. SoapClientInterface::WSDL_PROXY_LOGIN => $this->getGenerator()->getOptionProxyLogin(),
  5. SoapClientInterface::WSDL_PROXY_PASSWORD => $this->getGenerator()->getOptionProxyPassword(),
  6. ], $this->getGenerator()->getOptionSoapOptions());
    Cannot call method getOptionSoapOptions() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikael DELSOL
  7. }
  8. public function setSoapClient(SoapClient $soapClient): self
  9. {
  10. $this->soapClient = $soapClient;
  1. switch ($optionValue) {
  2. case GeneratorOptions::VALUE_END:
  3. $parts = preg_split('/[A-Z]/', ucfirst($string));
  4. $partsCount = is_countable($parts) ? count($parts) : 0;
  5. if (!empty($parts[$partsCount - 1])) {
  6. $elementType = mb_substr($string, mb_strrpos($string, implode('', array_slice($parts, -1))) - 1);
    Parameter #1 $input of function array_slice expects array, list<string>|false given.
    Last edited by Mikaël DELSOL
  7. } else {
  8. for ($i = $partsCount - 1; $i >= 0; --$i) {
  9. $part = trim($parts[$i]);
  10. if (!empty($part)) {
  11. break;
  1. switch ($optionValue) {
  2. case GeneratorOptions::VALUE_END:
  3. $parts = preg_split('/[A-Z]/', ucfirst($string));
  4. $partsCount = is_countable($parts) ? count($parts) : 0;
  5. if (!empty($parts[$partsCount - 1])) {
  6. $elementType = mb_substr($string, mb_strrpos($string, implode('', array_slice($parts, -1))) - 1);
    Parameter #2 $pieces of function implode expects array, mixed given.
    Last edited by Mikaël DELSOL
  7. } else {
  8. for ($i = $partsCount - 1; $i >= 0; --$i) {
  9. $part = trim($parts[$i]);
  10. if (!empty($part)) {
  11. break;
  1. }
  2. public static function getStreamContextOptions(?string $basicAuthLogin = null, ?string $basicAuthPassword = null, ?string $proxyHost = null, $proxyPort = null, ?string $proxyLogin = null, ?string $proxyPassword = null, array $contextOptions = []): array
  3. {
  4. $applyHttpHeader = function (array $contextOptions, string $header): array {
  5. if (!isset($contextOptions['http']['header']) || !in_array($header, $contextOptions['http']['header'])) {
    Parameter #2 $haystack of function in_array expects array, mixed given.
    Last edited by dypa
  6. $contextOptions['http']['header'][] = $header;
  7. }
  8. return $contextOptions;
  9. };
  1. $authorizationHeader = sprintf('Authorization: Basic %s', base64_encode(sprintf('%s:%s', $basicAuthLogin, $basicAuthPassword)));
  2. $contextOptions = $applyHttpHeader($contextOptions, $authorizationHeader);
  3. }
  4. if (!empty($proxyHost)) {
  5. $contextOptions['http']['proxy'] = sprintf('tcp://%s%s', $proxyHost, empty($proxyPort) ? '' : sprintf(':%s', $proxyPort));
    Parameter #2 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by dypa
  6. $proxyAuthorizationHeader = sprintf('Proxy-Authorization: Basic %s', base64_encode(sprintf('%s:%s', $proxyLogin, $proxyPassword)));
  7. $contextOptions = $applyHttpHeader($contextOptions, $proxyAuthorizationHeader);
  8. }
  9. return $contextOptions;
  1. $path = str_replace('/'.$fileBasename, '', $path);
  2. $pathParts = explode('/', $path);
  3. $finalPath = implode('/', $pathParts);
  4. foreach ($destinationParts as $locationPart) {
  5. if ('..' === $locationPart) {
  6. $finalPath = mb_substr($finalPath, 0, mb_strrpos($finalPath, '/', 0));
    Parameter #3 $length of function mb_substr expects int|null, int<0, max>|false given.
    Last edited by Mikaël DELSOL
  7. } else {
  8. $finalPath .= '/'.$locationPart;
  9. }
  10. }
  11. $port = (is_array($parts) && array_key_exists('port', $parts)) ? $parts['port'] : '';
  1. */
  2. public static function cleanString(string $string, bool $keepMultipleUnderscores = true): string
  3. {
  4. $cleanedString = preg_replace('/[^\p{L}\p{N}_]/u', '_', $string);
  5. if (!$keepMultipleUnderscores) {
  6. $cleanedString = preg_replace('/[_]+/', '_', $cleanedString);
    Parameter #3 $subject of function preg_replace expects array<float|int|string>|string, string|null given.
    Last edited by Mikael DELSOL
  7. }
  8. return $cleanedString;
  9. }
  1. }
  2. public static function createDirectory(string $directory, $permissions = 0775): bool
  3. {
  4. if (!is_dir($directory)) {
  5. mkdir($directory, $permissions, true);
    Parameter #2 $mode of function mkdir expects int, mixed given.
    Last edited by Mikael DELSOL
  6. }
  7. return true;
  8. }
  1. try {
  2. $domDocument->loadXML($content, LIBXML_NOERROR);
  3. $this->content = new $contentClass($domDocument, $this->generator);
  4. } catch (\Exception $exception) {
  5. throw new \InvalidArgumentException(sprintf('Unable to load document at "%s"', $this->getName()), __LINE__, $exception);
    Parameter #2 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikaël DELSOL
  6. }
  7. return $this;
  8. }
  1. return $this;
  2. }
  3. public function getInheritedModel(): ?Struct
  4. {
  5. return $this->getGenerator()->getStructByName($this->getInheritance());
    Cannot call method getStructByName() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikaël DELSOL
  6. }
  7. public function getMeta(): array
  8. {
  9. return $this->meta;
  1. public function getMetaValueFirstSet(array $names, $fallback = null)
  2. {
  3. $meta = $this->getMeta();
  4. foreach ($names as $name) {
  5. if (array_key_exists($name, $meta)) {
    Parameter #1 $key of function array_key_exists expects int|string, mixed given.
    Last edited by Mikael DELSOL
  6. return $meta[$name];
  7. }
  8. }
  9. return $fallback;
  1. return $this;
  2. }
  3. public function getCleanName(bool $keepMultipleUnderscores = true): string
  4. {
  5. return self::cleanString($this->getName(), $keepMultipleUnderscores);
    Parameter #1 $string of static method WsdlToPhp\PackageGenerator\Model\AbstractModel::cleanString() expects string, mixed given.
    Last edited by Mikael DELSOL
  6. }
  7. public function getOwner(): ?AbstractModel
  8. {
  9. return $this->owner;
  1. if ($namespaced && !empty($this->getNamespace())) {
  2. $nameParts[] = sprintf('\%s\\', $this->getNamespace());
  3. }
  4. $cleanName = $this->getCleanName();
  5. if (!empty($this->getGenerator()->getOptionPrefix())) {
    Cannot call method getOptionPrefix() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikaël DELSOL
  6. $nameParts[] = $this->getGenerator()->getOptionPrefix();
  7. } else {
  8. $cleanName = self::replacePhpReservedKeyword($cleanName);
  9. }
  1. $nameParts[] = sprintf('\%s\\', $this->getNamespace());
  2. }
  3. $cleanName = $this->getCleanName();
  4. if (!empty($this->getGenerator()->getOptionPrefix())) {
  5. $nameParts[] = $this->getGenerator()->getOptionPrefix();
    Cannot call method getOptionPrefix() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikael DELSOL
  6. } else {
  7. $cleanName = self::replacePhpReservedKeyword($cleanName);
  8. }
  9. $nameParts[] = ucfirst(self::uniqueName($cleanName, $this->getContextualPart()));
  1. } else {
  2. $cleanName = self::replacePhpReservedKeyword($cleanName);
  3. }
  4. $nameParts[] = ucfirst(self::uniqueName($cleanName, $this->getContextualPart()));
  5. if (!empty($this->getGenerator()->getOptionSuffix())) {
    Cannot call method getOptionSuffix() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikaël DELSOL
  6. $nameParts[] = $this->getGenerator()->getOptionSuffix();
  7. }
  8. return implode('', $nameParts);
  9. }
  1. $cleanName = self::replacePhpReservedKeyword($cleanName);
  2. }
  3. $nameParts[] = ucfirst(self::uniqueName($cleanName, $this->getContextualPart()));
  4. if (!empty($this->getGenerator()->getOptionSuffix())) {
  5. $nameParts[] = $this->getGenerator()->getOptionSuffix();
    Cannot call method getOptionSuffix() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikael DELSOL
  6. }
  7. return implode('', $nameParts);
  8. }
  1. }
  2. public function getNamespace(): string
  3. {
  4. $namespaces = [];
  5. $namespace = $this->getGenerator()->getOptionNamespacePrefix();
    Cannot call method getOptionNamespacePrefix() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikael DELSOL
  6. if (!empty($namespace)) {
  7. $namespaces[] = $namespace;
  8. }
  1. }
  2. public function getSubDirectory(): string
  3. {
  4. $subDirectory = '';
  5. if (GeneratorOptions::VALUE_CAT === $this->getGenerator()->getOptionCategory()) {
    Cannot call method getOptionCategory() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikaël DELSOL
  6. $subDirectory = $this->getContextualPart();
  7. }
  8. return $subDirectory;
  9. }
  1. $metaDocumentation = [];
  2. // gather meta
  3. foreach ($meta as $metaItem) {
  4. foreach ($metaItem as $metaName => $metaValue) {
  5. if (self::META_DOCUMENTATION === $metaName) {
  6. $metaDocumentation = array_merge($metaDocumentation, $metaValue);
    Parameter #2 ...$args of function array_merge expects array, mixed given.
    Last edited by Mikaël DELSOL
  7. } elseif (!array_key_exists($metaName, $mergedMeta)) {
  8. $mergedMeta[$metaName] = $metaValue;
  9. } elseif (is_array($mergedMeta[$metaName]) && is_array($metaValue)) {
  10. $mergedMeta[$metaName] = array_merge($mergedMeta[$metaName], $metaValue);
  11. } elseif (is_array($mergedMeta[$metaName])) {
  1. // gather meta
  2. foreach ($meta as $metaItem) {
  3. foreach ($metaItem as $metaName => $metaValue) {
  4. if (self::META_DOCUMENTATION === $metaName) {
  5. $metaDocumentation = array_merge($metaDocumentation, $metaValue);
  6. } elseif (!array_key_exists($metaName, $mergedMeta)) {
    Parameter #1 $key of function array_key_exists expects int|string, mixed given.
    Last edited by Mikaël DELSOL
  7. $mergedMeta[$metaName] = $metaValue;
  8. } elseif (is_array($mergedMeta[$metaName]) && is_array($metaValue)) {
  9. $mergedMeta[$metaName] = array_merge($mergedMeta[$metaName], $metaValue);
  10. } elseif (is_array($mergedMeta[$metaName])) {
  11. $mergedMeta[$metaName][] = $metaValue;
  1. {
  2. if (!array_key_exists('__CLASS__', $args)) {
  3. throw new \InvalidArgumentException(sprintf('__CLASS__ key is missing from "%s"', var_export($args, true)));
  4. }
  5. if (!class_exists($args['__CLASS__'])) {
    Parameter #1 $classname of function class_exists expects string, mixed given.
    Last edited by Mikael DELSOL
  6. throw new \InvalidArgumentException(sprintf('Class "%s" is unknown', $args['__CLASS__']));
  7. }
  8. if (!array_key_exists('name', $args)) {
  9. throw new \InvalidArgumentException(sprintf('name key is missing from "%s"', var_export($args, true)));
  1. if (!array_key_exists('__CLASS__', $args)) {
  2. throw new \InvalidArgumentException(sprintf('__CLASS__ key is missing from "%s"', var_export($args, true)));
  3. }
  4. if (!class_exists($args['__CLASS__'])) {
  5. throw new \InvalidArgumentException(sprintf('Class "%s" is unknown', $args['__CLASS__']));
    Parameter #2 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikaël DELSOL
  6. }
  7. if (!array_key_exists('name', $args)) {
  8. throw new \InvalidArgumentException(sprintf('name key is missing from "%s"', var_export($args, true)));
  9. }
in src/Model/Service.php, line 29
  1. $this->setMethods(new MethodContainer($generator));
  2. }
  3. public function getContextualPart(): string
  4. {
  5. return $this->getGenerator()->getOptionServicesFolder();
    Cannot call method getOptionServicesFolder() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikael DELSOL
  6. }
  7. public function getDocSubPackages(): array
  8. {
  9. return [
in src/Model/Service.php, line 59
  1. return $this->methods->getMethodByName($methodName);
  2. }
  3. public function getExtends(bool $short = false): string
  4. {
  5. $extends = $this->getGenerator()->getOptionSoapClientClass();
    Cannot call method getOptionSoapClientClass() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikael DELSOL
  6. return $short ? Utils::removeNamespace($extends) : $extends;
  7. }
  8. public function getReservedMethodsInstance(?string $filename = null): ServiceReservedMethod
in src/Model/Service.php, line 72
  1. }
  2. public function setMethodsFromSerializedJson(array $methods): void
  3. {
  4. foreach ($methods as $method) {
  5. $this->methods->add(self::instanceFromSerializedJson($this->generator, $method)->setOwner($this));
    Parameter #2 $args of static method WsdlToPhp\PackageGenerator\Model\AbstractModel::instanceFromSerializedJson() expects array, mixed given.
    Last edited by Mikael DELSOL
  6. }
  7. }
  8. protected function setMethods(MethodContainer $methodContainer): self
  9. {
in src/Model/Struct.php, line 62
  1. public function __construct(Generator $generator, $name, $isStruct = true, $isRestriction = false)
  2. {
  3. parent::__construct($generator, $name);
  4. $this
  5. ->setStruct($isStruct)
    Parameter #1 $isStruct of method WsdlToPhp\PackageGenerator\Model\Struct::setStruct() expects bool, mixed given.
    Last edited by Mikael DELSOL
  6. ->setRestriction($isRestriction)
  7. ->setAttributes(new StructAttributeContainer($generator))
  8. ->setValues(new StructValueContainer($generator))
  9. ;
  10. }
in src/Model/Struct.php, line 71
  1. ;
  2. }
  3. public function getContextualPart(): string
  4. {
  5. $part = $this->getGenerator()->getOptionStructsFolder();
    Cannot call method getOptionStructsFolder() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikael DELSOL
  6. if ($this->isRestriction()) {
  7. $part = $this->getGenerator()->getOptionEnumsFolder();
  8. } elseif ($this->isArray()) {
  9. $part = $this->getGenerator()->getOptionArraysFolder();
  10. }
in src/Model/Struct.php, line 73
  1. public function getContextualPart(): string
  2. {
  3. $part = $this->getGenerator()->getOptionStructsFolder();
  4. if ($this->isRestriction()) {
  5. $part = $this->getGenerator()->getOptionEnumsFolder();
    Cannot call method getOptionEnumsFolder() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikael DELSOL
  6. } elseif ($this->isArray()) {
  7. $part = $this->getGenerator()->getOptionArraysFolder();
  8. }
  9. return $part;
in src/Model/Struct.php, line 75
  1. {
  2. $part = $this->getGenerator()->getOptionStructsFolder();
  3. if ($this->isRestriction()) {
  4. $part = $this->getGenerator()->getOptionEnumsFolder();
  5. } elseif ($this->isArray()) {
  6. $part = $this->getGenerator()->getOptionArraysFolder();
    Cannot call method getOptionArraysFolder() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikael DELSOL
  7. }
  8. return $part;
  9. }
in src/Model/Struct.php, line 103
  1. (
  2. (
  3. ($this->isStruct() && 1 === $this->countAllAttributes())
  4. || (!$this->isStruct() && 1 >= $this->countOwnAttributes())
  5. )
  6. && false !== mb_stripos($this->getName(), 'array')
    Parameter #1 $haystack of function mb_stripos expects string, mixed given.
    Last edited by Mikaël DELSOL
  7. )
  8. || (!$this->isStruct() && false !== $this->getMetaValueFirstSet(['arraytype', 'arrayType'], false));
  9. }
  10. public function getAttributes(bool $includeInheritanceAttributes = false, bool $requiredFirst = false): StructAttributeContainer
in src/Model/Struct.php, line 133
  1. $parentAttributes = new StructAttributeContainer($this->getGenerator());
  2. if (!empty($this->getInheritance()) && ($model = $this->getInheritanceStruct()) instanceof Struct) {
  3. while ($model instanceof Struct && $model->isStruct()) {
  4. foreach ($model->getAttributes() as $attribute) {
  5. $parentAttributes->add($attribute);
    Parameter #1 $object of method WsdlToPhp\PackageGenerator\Container\AbstractObjectContainer::add() expects object, mixed given.
    Last edited by Mikaël DELSOL
  6. }
  7. $model = $model->getInheritanceStruct();
  8. }
  9. }
in src/Model/Struct.php, line 141
  1. }
  2. }
  3. /** @var StructAttribute $attribute */
  4. foreach ($this->getAttributes() as $attribute) {
  5. if ($parentAttributes->getStructAttributeByName($attribute->getName())) {
    Parameter #1 $name of method WsdlToPhp\PackageGenerator\Container\Model\StructAttribute::getStructAttributeByName() expects string, mixed given.
    Last edited by Mikaël DELSOL
  6. continue;
  7. }
  8. $properAttributes->add($attribute);
  9. }
in src/Model/Struct.php, line 173
  1. * @throws \InvalidArgumentException
  2. */
  3. public function addAttribute(string $attributeName, string $attributeType): self
  4. {
  5. if (empty($attributeName) || empty($attributeType)) {
  6. throw new \InvalidArgumentException(sprintf('Attribute name "%s" and/or attribute type "%s" is invalid for Struct "%s"', $attributeName, $attributeType, $this->getName()), __LINE__);
    Parameter #4 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
    Last edited by Mikaël DELSOL
  7. }
  8. if (is_null($this->attributes->getStructAttributeByName($attributeName))) {
  9. $structAttribute = new StructAttribute($this->getGenerator(), $attributeName, $attributeType, $this);
  10. $this->attributes->add($structAttribute);
  11. }
in src/Model/Struct.php, line 249
  1. // this is why enumerations has to be parsed before any other elements by the WSDL parsers
  2. if (0 < $this->countOwnAttributes()) {
  3. $enum = new Struct($this->getGenerator(), $this->getName(), true, true);
  4. $enum->setInheritance(self::DEFAULT_ENUM_TYPE);
  5. $enum->getValues()->add(new StructValue($enum->getGenerator(), $value, $enum->getValues()->count(), $enum));
  6. $this->getGenerator()->getStructs()->add($enum);
    Cannot call method getStructs() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikaël DELSOL
  7. return $enum;
  8. }
  9. $this
  10. ->setStruct(true)
in src/Model/Struct.php, line 271
  1. }
  2. public function getExtends(bool $short = false): string
  3. {
  4. if ($this->isArray()) {
  5. $extends = $this->getGenerator()->getOptionStructArrayClass();
    Cannot call method getOptionStructArrayClass() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikael DELSOL
  6. } elseif ($this->isRestriction()) {
  7. $extends = $this->getGenerator()->getOptionStructEnumClass();
  8. } else {
  9. $extends = $this->getGenerator()->getOptionStructClass();
  10. }
in src/Model/Struct.php, line 273
  1. public function getExtends(bool $short = false): string
  2. {
  3. if ($this->isArray()) {
  4. $extends = $this->getGenerator()->getOptionStructArrayClass();
  5. } elseif ($this->isRestriction()) {
  6. $extends = $this->getGenerator()->getOptionStructEnumClass();
    Cannot call method getOptionStructEnumClass() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikaël DELSOL
  7. } else {
  8. $extends = $this->getGenerator()->getOptionStructClass();
  9. }
  10. return $short ? Utils::removeNamespace($extends) : $extends;
in src/Model/Struct.php, line 275
  1. if ($this->isArray()) {
  2. $extends = $this->getGenerator()->getOptionStructArrayClass();
  3. } elseif ($this->isRestriction()) {
  4. $extends = $this->getGenerator()->getOptionStructEnumClass();
  5. } else {
  6. $extends = $this->getGenerator()->getOptionStructClass();
    Cannot call method getOptionStructClass() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikael DELSOL
  7. }
  8. return $short ? Utils::removeNamespace($extends) : $extends;
  9. }
in src/Model/Struct.php, line 283
  1. return $short ? Utils::removeNamespace($extends) : $extends;
  2. }
  3. public function getInheritanceStruct(): ?Struct
  4. {
  5. return $this->getName() === $this->getInheritance() ? null : $this->getGenerator()->getStructByName(str_replace('[]', '', $this->getInheritance()));
    Cannot call method getStructByName() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikaël DELSOL
  6. }
  7. public function getTopInheritance(): string
  8. {
  9. $inheritance = $this->getInheritance();
in src/Model/Struct.php, line 354
  1. }
  2. public function setAttributesFromSerializedJson(array $attributes): void
  3. {
  4. foreach ($attributes as $attribute) {
  5. $this->attributes->add(self::instanceFromSerializedJson($this->generator, $attribute)->setOwner($this));
    Parameter #2 $args of static method WsdlToPhp\PackageGenerator\Model\AbstractModel::instanceFromSerializedJson() expects array, mixed given.
    Last edited by Mikael DELSOL
  6. }
  7. }
  8. public function setValuesFromSerializedJson(array $values): void
  9. {
in src/Model/Struct.php, line 361
  1. }
  2. public function setValuesFromSerializedJson(array $values): void
  3. {
  4. foreach ($values as $value) {
  5. $this->values->add(self::instanceFromSerializedJson($this->generator, $value)->setOwner($this));
    Parameter #2 $args of static method WsdlToPhp\PackageGenerator\Model\AbstractModel::instanceFromSerializedJson() expects array, mixed given.
    Last edited by Mikael DELSOL
  6. }
  7. }
  8. protected function getAllAttributes(bool $includeInheritanceAttributes, bool $requiredFirst): StructAttributeContainer
  9. {
in src/Model/Struct.php, line 373
  1. if ($includeInheritanceAttributes) {
  2. $this->addInheritanceAttributes($allAttributes);
  3. }
  4. foreach ($this->attributes as $attribute) {
  5. $allAttributes->add($attribute);
    Parameter #1 $object of method WsdlToPhp\PackageGenerator\Container\AbstractObjectContainer::add() expects object, mixed given.
    Last edited by Mikaël DELSOL
  6. }
  7. if ($requiredFirst) {
  8. $attributes = $this->putRequiredAttributesFirst($allAttributes);
  9. } else {
in src/Model/Struct.php, line 390
  1. protected function addInheritanceAttributes(StructAttributeContainer $attributes): void
  2. {
  3. if (!empty($this->getInheritance()) && ($model = $this->getInheritanceStruct()) instanceof Struct) {
  4. while ($model instanceof Struct && $model->isStruct()) {
  5. foreach ($model->getAttributes() as $attribute) {
  6. $attributes->add($attribute);
    Parameter #1 $object of method WsdlToPhp\PackageGenerator\Container\AbstractObjectContainer::add() expects object, mixed given.
    Last edited by Mikaël DELSOL
  7. }
  8. $model = $model->getInheritanceStruct();
  9. }
  10. }
  11. }
  1. return \DOMDocument::class === $this->getType();
  2. }
  3. public function getTypeStruct(): ?Struct
  4. {
  5. $struct = $this->getGenerator()->getStructByNameAndType($this->getType(), $this->getInheritance());
    Cannot call method getStructByNameAndType() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikaël DELSOL
  6. return $struct ?: $this->getGenerator()->getStructByName($this->getType());
  7. }
  8. public function getTypeStructMeta(): array
  1. public function getTypeStruct(): ?Struct
  2. {
  3. $struct = $this->getGenerator()->getStructByNameAndType($this->getType(), $this->getInheritance());
  4. return $struct ?: $this->getGenerator()->getStructByName($this->getType());
    Cannot call method getStructByName() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikaël DELSOL
  5. }
  6. public function getTypeStructMeta(): array
  7. {
  8. $typeStruct = $this->getTypeStruct();
  1. return $typeStruct && $typeStruct->isArray() && !$typeStruct->isStruct();
  2. }
  3. public function getInheritanceStruct(): ?Struct
  4. {
  5. return $this->getGenerator()->getStructByName($this->getInheritance());
    Cannot call method getStructByName() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikaël DELSOL
  6. }
  7. public function getInheritanceStructMeta(): array
  8. {
  9. $inheritanceStruct = $this->getInheritanceStruct();
  1. {
  2. if ($this->cleanedName) {
  3. return $this->cleanedName;
  4. }
  5. if ($this->getGenerator()->getOptionGenericConstantsNames()) {
    Cannot call method getOptionGenericConstantsNames() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikael DELSOL
  6. return self::GENERIC_NAME_PREFIX.$this->getIndex();
  7. }
  8. $nameWithSeparatedWords = $this->getNameWithSeparatedWords($keepMultipleUnderscores);
  9. $key = self::constantSuffix($this->getOwner()->getName(), $nameWithSeparatedWords, $this->getIndex());
  1. if ($this->getGenerator()->getOptionGenericConstantsNames()) {
  2. return self::GENERIC_NAME_PREFIX.$this->getIndex();
  3. }
  4. $nameWithSeparatedWords = $this->getNameWithSeparatedWords($keepMultipleUnderscores);
  5. $key = self::constantSuffix($this->getOwner()->getName(), $nameWithSeparatedWords, $this->getIndex());
    Parameter #1 $structName of static method WsdlToPhp\PackageGenerator\Model\StructValue::constantSuffix() expects string, mixed given.
    Last edited by Mikaël DELSOL
  6. return $this->cleanedName = self::VALUE_NAME_PREFIX.mb_strtoupper($nameWithSeparatedWords.($key ? '_'.$key : ''));
  7. }
  8. public function getNameWithSeparatedWords(bool $keepMultipleUnderscores = false): string
  1. return $this->cleanedName = self::VALUE_NAME_PREFIX.mb_strtoupper($nameWithSeparatedWords.($key ? '_'.$key : ''));
  2. }
  3. public function getNameWithSeparatedWords(bool $keepMultipleUnderscores = false): string
  4. {
  5. return trim(self::cleanString(preg_replace(self::MATCH_PATTERN, self::REPLACEMENT_PATTERN, (string) $this->getName()), $keepMultipleUnderscores), '_');
    Parameter #1 $string of static method WsdlToPhp\PackageGenerator\Model\AbstractModel::cleanString() expects string, string|null given.
    Last edited by Mikaël DELSOL
  6. }
  7. public function getValue()
  8. {
  9. return Utils::getValueWithinItsType($this->getName());
in src/Model/Wsdl.php, line 28
  1. return parent::getContent();
  2. }
  3. public function addSchema(Schema $schema): self
  4. {
  5. $this->getContent()->addExternalSchema($schema->getContent());
    Parameter #1 $schema of method WsdlToPhp\WsdlHandler\Wsdl::addExternalSchema() expects WsdlToPhp\WsdlHandler\Schema, WsdlToPhp\WsdlHandler\AbstractDocument given.
    Last edited by Mikaël DELSOL
  6. $this->schemas->add($schema);
  7. return $this;
  8. }
  1. final class Functions extends AbstractParser
  2. {
  3. public function parse(): void
  4. {
  5. $methods = $this
    Cannot call method getSoapClient() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikaël DELSOL
  6. ->getGenerator()
  7. ->getSoapClient()
  8. ->getSoapClient()
  9. ->getSoapClient()
  10. ->__getFunctions()
  1. final class Functions extends AbstractParser
  2. {
  3. public function parse(): void
  4. {
  5. $methods = $this
    Cannot call method __getFunctions() on SoapClient|null.
    Last edited by Mikaël DELSOL
  6. ->getGenerator()
  7. ->getSoapClient()
  8. ->getSoapClient()
  9. ->getSoapClient()
  10. ->__getFunctions()
  1. ->getSoapClient()
  2. ->getSoapClient()
  3. ->__getFunctions()
  4. ;
  5. $services = $this->getGenerator()->getServices();
    Cannot call method getServices() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikael DELSOL
  6. if (!is_array($methods) || 0 === count($methods)) {
  7. return;
  8. }
  1. if (!is_array($methods) || 0 === count($methods)) {
  2. return;
  3. }
  4. foreach ($methods as $method) {
  5. $infos = explode(' ', $method);
    Parameter #2 $str of function explode expects string, mixed given.
    Last edited by Mikaël DELSOL
  6. // "Regular" SOAP Style
  7. if (count($infos) < 3) {
  8. $returnType = $infos[0];
  9. if (false !== mb_strpos($infos[1], '()') && array_key_exists(1, $infos)) {
  10. $methodName = trim(str_replace('()', '', $infos[1]));
  1. $parameterType = null;
  2. } else {
  3. [$methodName, $parameterType] = explode('(', $infos[1]);
  4. }
  5. if (!empty($returnType) && !empty($methodName)) {
  6. $services->addService($this->getGenerator()->getServiceName($methodName), $methodName, $parameterType, $returnType);
    Cannot call method getServiceName() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikaël DELSOL
  7. }
  8. } else {
  9. /*
  10. * RPC SOAP Style
  11. * Some RPC WS defines the return type as a list of values
  1. * RPC SOAP Style
  2. * Some RPC WS defines the return type as a list of values
  3. * So we define the return type as an array and reset the information to use to extract method name and parameters
  4. */
  5. if (0 === mb_stripos($infos[0], 'list(')) {
  6. $infos = explode(' ', preg_replace('/(list\(.*\)\s)/i', '', $method));
    Parameter #3 $subject of function preg_replace expects array<float|int|string>|string, mixed given.
    Last edited by Mikaël DELSOL
  7. array_unshift($infos, 'array');
  8. }
  9. /**
  10. * Returns type is not defined in some case.
  1. $methodParameters = array_merge($methodParameters, [
  2. $info => $start === $i ? $firstParameterType : $infos[$i - 1],
  3. ]);
  4. }
  5. }
  6. $services->addService($this->getGenerator()->getServiceName($methodName), $methodName, $methodParameters, empty($returnType) ? 'unknown' : $returnType);
    Cannot call method getServiceName() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikaël DELSOL
  7. }
  8. }
  9. }
  10. }
  11. }
  1. protected array $definedStructs = [];
  2. public function parse(): void
  3. {
  4. $types = $this
    Cannot call method getSoapClient() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikaël DELSOL
  5. ->getGenerator()
  6. ->getSoapClient()
  7. ->getSoapClient()
  8. ->getSoapClient()
  9. ->__getTypes()
  1. protected array $definedStructs = [];
  2. public function parse(): void
  3. {
  4. $types = $this
    Cannot call method __getTypes() on SoapClient|null.
    Last edited by Mikaël DELSOL
  5. ->getGenerator()
  6. ->getSoapClient()
  7. ->getSoapClient()
  8. ->getSoapClient()
  9. ->__getTypes()
  1. ->getSoapClient()
  2. ->__getTypes()
  3. ;
  4. foreach ($types as $type) {
  5. $this->parseType($type);
    Parameter #1 $type of method WsdlToPhp\PackageGenerator\Parser\SoapClient\Structs::parseType() expects string, mixed given.
    Last edited by Mikaël DELSOL
  6. }
  7. }
  8. protected function parseType(string $type): void
  9. {
  1. if (self::UNION_DECLARATION === $typeDef[0]) {
  2. $this->parseUnionStruct($typeDef);
  3. } elseif (self::STRUCT_DECLARATION === $typeDef[0]) {
  4. $this->parseComplexStruct($typeDef);
  5. } else {
  6. $this->getGenerator()->getStructs()->addVirtualStruct($structName, $typeDef[0]);
    Cannot call method getStructs() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikaël DELSOL
  7. }
  8. }
  9. $this->structHasBeenDefined($type);
  10. }
  1. protected function parseComplexStruct(array $typeDef): void
  2. {
  3. $typeDefCount = count($typeDef);
  4. if (3 < $typeDefCount) {
  5. for ($i = 2; $i < $typeDefCount; $i += 2) {
  6. $structParamType = str_replace(self::ANY_XML_DECLARATION, self::ANY_XML_TYPE, $typeDef[$i]);
    Parameter #3 $subject of function str_replace expects array<string>|string, mixed given.
    Last edited by Mikael DELSOL
  7. $structParamName = $typeDef[$i + 1];
  8. $this->getGenerator()->getStructs()->addStructWithAttribute($typeDef[1], $structParamName, $structParamType);
  9. }
  10. } else {
  11. $this->getGenerator()->getStructs()->addStruct($typeDef[1]);
  1. $typeDefCount = count($typeDef);
  2. if (3 < $typeDefCount) {
  3. for ($i = 2; $i < $typeDefCount; $i += 2) {
  4. $structParamType = str_replace(self::ANY_XML_DECLARATION, self::ANY_XML_TYPE, $typeDef[$i]);
  5. $structParamName = $typeDef[$i + 1];
  6. $this->getGenerator()->getStructs()->addStructWithAttribute($typeDef[1], $structParamName, $structParamType);
    Parameter #2 $attributeName of method WsdlToPhp\PackageGenerator\Container\Model\Struct::addStructWithAttribute() expects string, mixed given.
    Last edited by Mikael DELSOL
  7. }
  8. } else {
  9. $this->getGenerator()->getStructs()->addStruct($typeDef[1]);
  10. }
  11. }
  1. $typeDefCount = count($typeDef);
  2. if (3 < $typeDefCount) {
  3. for ($i = 2; $i < $typeDefCount; $i += 2) {
  4. $structParamType = str_replace(self::ANY_XML_DECLARATION, self::ANY_XML_TYPE, $typeDef[$i]);
  5. $structParamName = $typeDef[$i + 1];
  6. $this->getGenerator()->getStructs()->addStructWithAttribute($typeDef[1], $structParamName, $structParamType);
    Parameter #1 $structName of method WsdlToPhp\PackageGenerator\Container\Model\Struct::addStructWithAttribute() expects string, mixed given.
    Last edited by Mikael DELSOL
  7. }
  8. } else {
  9. $this->getGenerator()->getStructs()->addStruct($typeDef[1]);
  10. }
  11. }
  1. $typeDefCount = count($typeDef);
  2. if (3 < $typeDefCount) {
  3. for ($i = 2; $i < $typeDefCount; $i += 2) {
  4. $structParamType = str_replace(self::ANY_XML_DECLARATION, self::ANY_XML_TYPE, $typeDef[$i]);
  5. $structParamName = $typeDef[$i + 1];
  6. $this->getGenerator()->getStructs()->addStructWithAttribute($typeDef[1], $structParamName, $structParamType);
    Cannot call method getStructs() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikael DELSOL
  7. }
  8. } else {
  9. $this->getGenerator()->getStructs()->addStruct($typeDef[1]);
  10. }
  11. }
  1. $structParamType = str_replace(self::ANY_XML_DECLARATION, self::ANY_XML_TYPE, $typeDef[$i]);
  2. $structParamName = $typeDef[$i + 1];
  3. $this->getGenerator()->getStructs()->addStructWithAttribute($typeDef[1], $structParamName, $structParamType);
  4. }
  5. } else {
  6. $this->getGenerator()->getStructs()->addStruct($typeDef[1]);
    Parameter #1 $structName of method WsdlToPhp\PackageGenerator\Container\Model\Struct::addStruct() expects string, mixed given.
    Last edited by Mikael DELSOL
  7. }
  8. }
  9. /**
  10. * union types are passed such as ",dateTime,time" or ",PMS_ResStatusType,TransactionActionType,UpperCaseAlphaLength1to2".
  1. $structParamType = str_replace(self::ANY_XML_DECLARATION, self::ANY_XML_TYPE, $typeDef[$i]);
  2. $structParamName = $typeDef[$i + 1];
  3. $this->getGenerator()->getStructs()->addStructWithAttribute($typeDef[1], $structParamName, $structParamType);
  4. }
  5. } else {
  6. $this->getGenerator()->getStructs()->addStruct($typeDef[1]);
    Cannot call method getStructs() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikael DELSOL
  7. }
  8. }
  9. /**
  10. * union types are passed such as ",dateTime,time" or ",PMS_ResStatusType,TransactionActionType,UpperCaseAlphaLength1to2".
  1. protected function parseUnionStruct(array $typeDef): void
  2. {
  3. $typeDefCount = count($typeDef);
  4. if (3 === $typeDefCount) {
  5. $unionName = $typeDef[1];
  6. $unionTypes = array_filter(explode(',', $typeDef[2]), fn ($type): bool => !empty($type));
    Parameter #2 $str of function explode expects string, mixed given.
    Last edited by Mikael DELSOL
  7. sort($unionTypes);
  8. $this->getGenerator()->getStructs()->addUnionStruct($unionName, $unionTypes);
  9. }
  10. }
  1. $typeDefCount = count($typeDef);
  2. if (3 === $typeDefCount) {
  3. $unionName = $typeDef[1];
  4. $unionTypes = array_filter(explode(',', $typeDef[2]), fn ($type): bool => !empty($type));
  5. sort($unionTypes);
  6. $this->getGenerator()->getStructs()->addUnionStruct($unionName, $unionTypes);
    Cannot call method getStructs() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikael DELSOL
  7. }
  8. }
  9. /**
  10. * Remove useless break line, tabs
  1. $typeDefCount = count($typeDef);
  2. if (3 === $typeDefCount) {
  3. $unionName = $typeDef[1];
  4. $unionTypes = array_filter(explode(',', $typeDef[2]), fn ($type): bool => !empty($type));
  5. sort($unionTypes);
  6. $this->getGenerator()->getStructs()->addUnionStruct($unionName, $unionTypes);
    Parameter #1 $structName of method WsdlToPhp\PackageGenerator\Container\Model\Struct::addUnionStruct() expects string, mixed given.
    Last edited by Mikael DELSOL
  7. }
  8. }
  9. /**
  10. * Remove useless break line, tabs
  1. ']',
  2. ';',
  3. ], '', $type);
  4. $type = preg_replace('/[\s]+/', ' ', $type);
  5. return trim($type);
    Parameter #1 $str of function trim expects string, string|null given.
    Last edited by Mikael DELSOL
  6. }
  7. protected function isStructDefined(string $type): bool
  8. {
  9. return in_array(self::typeSignature($type), $this->definedStructs);
  1. }
  2. protected function parseWsdl(Wsdl $wsdl): void
  3. {
  4. foreach ($this->getTags() as $tag) {
  5. $this->parseTag($tag);
    Parameter #1 $tag of method WsdlToPhp\PackageGenerator\Parser\Wsdl\AbstractAttributesParser::parseTag() expects WsdlToPhp\WsdlHandler\Tag\AbstractTag, mixed given.
    Last edited by Mikaël DELSOL
  6. }
  7. }
  8. }
  1. */
  2. final public function parse(): void
  3. {
  4. $wsdl = $this->generator->getWsdl();
  5. if (!$this->isWsdlParsed($wsdl)) {
    Parameter #1 $wsdl of method WsdlToPhp\PackageGenerator\Parser\Wsdl\AbstractParser::isWsdlParsed() expects WsdlToPhp\PackageGenerator\Model\Wsdl, WsdlToPhp\PackageGenerator\Model\Wsdl|null given.
    Last edited by Mikaël DELSOL
  6. $this
  7. ->setWsdlAsParsed($wsdl)
  8. ->setTags($wsdl->getContent()->getElementsByName($this->parsingTag()))
  9. ->parseWsdl($wsdl)
  10. ;
  1. {
  2. $wsdl = $this->generator->getWsdl();
  3. if (!$this->isWsdlParsed($wsdl)) {
  4. $this
  5. ->setWsdlAsParsed($wsdl)
    Parameter #1 $wsdl of method WsdlToPhp\PackageGenerator\Parser\Wsdl\AbstractParser::setWsdlAsParsed() expects WsdlToPhp\PackageGenerator\Model\Wsdl, WsdlToPhp\PackageGenerator\Model\Wsdl|null given.
    Last edited by Mikaël DELSOL
  6. ->setTags($wsdl->getContent()->getElementsByName($this->parsingTag()))
  7. ->parseWsdl($wsdl)
  8. ;
  9. }
  1. $wsdl = $this->generator->getWsdl();
  2. if (!$this->isWsdlParsed($wsdl)) {
  3. $this
  4. ->setWsdlAsParsed($wsdl)
  5. ->setTags($wsdl->getContent()->getElementsByName($this->parsingTag()))
    Cannot call method getContent() on WsdlToPhp\PackageGenerator\Model\Wsdl|null.
    Last edited by Mikaël DELSOL
  6. ->parseWsdl($wsdl)
  7. ;
  8. }
  9. /** @var Schema $schema */
  1. if (!$this->isWsdlParsed($wsdl)) {
  2. $this
  3. ->setWsdlAsParsed($wsdl)
  4. ->setTags($wsdl->getContent()->getElementsByName($this->parsingTag()))
  5. ->parseWsdl($wsdl)
    Parameter #1 $wsdl of method WsdlToPhp\PackageGenerator\Parser\Wsdl\AbstractParser::parseWsdl() expects WsdlToPhp\PackageGenerator\Model\Wsdl, WsdlToPhp\PackageGenerator\Model\Wsdl|null given.
    Last edited by Mikaël DELSOL
  6. ;
  7. }
  8. /** @var Schema $schema */
  9. foreach ($wsdl->getSchemas() as $schema) {
  1. ->parseWsdl($wsdl)
  2. ;
  3. }
  4. /** @var Schema $schema */
  5. foreach ($wsdl->getSchemas() as $schema) {
    Cannot call method getSchemas() on WsdlToPhp\PackageGenerator\Model\Wsdl|null.
    Last edited by Mikaël DELSOL
  6. if ($this->isSchemaParsed($wsdl, $schema)) {
  7. continue;
  8. }
  9. $this->setSchemaAsParsed($wsdl, $schema);
  1. ;
  2. }
  3. /** @var Schema $schema */
  4. foreach ($wsdl->getSchemas() as $schema) {
  5. if ($this->isSchemaParsed($wsdl, $schema)) {
    Parameter #1 $wsdl of method WsdlToPhp\PackageGenerator\Parser\Wsdl\AbstractParser::isSchemaParsed() expects WsdlToPhp\PackageGenerator\Model\Wsdl, WsdlToPhp\PackageGenerator\Model\Wsdl|null given.
    Last edited by Mikaël DELSOL
  6. continue;
  7. }
  8. $this->setSchemaAsParsed($wsdl, $schema);
  1. foreach ($wsdl->getSchemas() as $schema) {
  2. if ($this->isSchemaParsed($wsdl, $schema)) {
  3. continue;
  4. }
  5. $this->setSchemaAsParsed($wsdl, $schema);
    Parameter #1 $wsdl of method WsdlToPhp\PackageGenerator\Parser\Wsdl\AbstractParser::setSchemaAsParsed() expects WsdlToPhp\PackageGenerator\Model\Wsdl, WsdlToPhp\PackageGenerator\Model\Wsdl|null given.
    Last edited by Mikaël DELSOL
  6. $this
  7. ->setTags($schema->getContent()->getElementsByName($this->parsingTag()))
  8. ->parseSchema($wsdl, $schema)
  9. ;
  1. $this->setSchemaAsParsed($wsdl, $schema);
  2. $this
  3. ->setTags($schema->getContent()->getElementsByName($this->parsingTag()))
  4. ->parseSchema($wsdl, $schema)
    Parameter #1 $wsdl of method WsdlToPhp\PackageGenerator\Parser\Wsdl\AbstractParser::parseSchema() expects WsdlToPhp\PackageGenerator\Model\Wsdl, WsdlToPhp\PackageGenerator\Model\Wsdl|null given.
    Last edited by Mikaël DELSOL
  5. ;
  6. }
  7. }
  8. public function getTags(): array
  1. return $this->tags;
  2. }
  3. public function isWsdlParsed(Wsdl $wsdl): bool
  4. {
  5. return array_key_exists($wsdl->getName(), $this->parsedWsdls) && is_array($this->parsedWsdls[$wsdl->getName()]) && in_array($this->parsingTag(), $this->parsedWsdls[$wsdl->getName()]);
    Parameter #1 $key of function array_key_exists expects int|string, mixed given.
    Last edited by Mikaël DELSOL
  6. }
  7. public function isSchemaParsed(Wsdl $wsdl, Schema $schema): bool
  8. {
  9. $key = $wsdl->getName().$schema->getName();
  1. return $this;
  2. }
  3. protected function setWsdlAsParsed(Wsdl $wsdl): self
  4. {
  5. if (!array_key_exists($wsdl->getName(), $this->parsedWsdls)) {
    Parameter #1 $key of function array_key_exists expects int|string, mixed given.
    Last edited by Mikael DELSOL
  6. $this->parsedWsdls[$wsdl->getName()] = [];
  7. }
  8. $this->parsedWsdls[$wsdl->getName()][] = $this->parsingTag();
  9. return $this;
  1. abstract class AbstractTagImportParser extends AbstractTagParser
  2. {
  3. protected function parseWsdl(Wsdl $wsdl, ?Schema $schema = null): void
  4. {
  5. foreach ($this->getTags() as $tag) {
  6. if (empty($location = $tag->getLocationAttributeValue())) {
    Cannot call method getLocationAttributeValue() on mixed.
    Last edited by Mikaël DELSOL
  7. continue;
  8. }
  9. $finalLocation = Utils::resolveCompletePath($this->getLocation($wsdl, $schema), $location);
  10. $this->generator->addSchemaToWsdl($wsdl, $finalLocation);
  1. foreach ($this->getTags() as $tag) {
  2. if (empty($location = $tag->getLocationAttributeValue())) {
  3. continue;
  4. }
  5. $finalLocation = Utils::resolveCompletePath($this->getLocation($wsdl, $schema), $location);
    Parameter #2 $destination of static method WsdlToPhp\PackageGenerator\Generator\Utils::resolveCompletePath() expects string, mixed given.
    Last edited by Mikaël DELSOL
  6. $this->generator->addSchemaToWsdl($wsdl, $finalLocation);
  7. }
  8. }
  9. protected function getLocation(Wsdl $wsdl, ?Schema $schema = null): string
  1. protected function parseSchema(Wsdl $wsdl, ?Schema $schema): void
  2. {
  3. if (0 < count($this->getTags())) {
  4. $this->parseWsdl($wsdl, $schema);
  5. } else {
  6. $this->getTagParser()->parse();
    Cannot call method parse() on WsdlToPhp\PackageGenerator\Parser\Wsdl\AbstractTagImportParser|null.
    Last edited by Mikael DELSOL
  7. }
  8. }
  9. protected function getTagParser(): ?AbstractTagImportParser
  10. {
  1. $tagName = AbstractDocument::TAG_IMPORT;
  2. break;
  3. }
  4. return $this->getGenerator()->getParsers()->getParsers()->getParserByName($tagName);
    Cannot call method getParsers() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikael DELSOL
  5. }
  6. }
  1. $tagName = AbstractDocument::TAG_IMPORT;
  2. break;
  3. }
  4. return $this->getGenerator()->getParsers()->getParsers()->getParserByName($tagName);
    Parameter #1 $name of method WsdlToPhp\PackageGenerator\Container\Parser::getParserByName() expects string, string|null given.
    Last edited by Mikael DELSOL
  5. }
  6. }
  1. $multipleParts = count($parts);
  2. if (1 < count($parts)) {
  3. $types = [];
  4. foreach ($parts as $part) {
  5. if (!empty($type = $this->getTypeFromPart($part))) {
    Parameter #1 $part of method WsdlToPhp\PackageGenerator\Parser\Wsdl\AbstractTagInputOutputParser::getTypeFromPart() expects WsdlToPhp\WsdlHandler\Tag\TagPart, mixed given.
    Last edited by Mikaël DELSOL
  6. $types[$part->getAttributeName()] = $type;
  7. }
  8. }
  9. $this->setKnownType($method, $types);
  10. } else {
  1. $multipleParts = count($parts);
  2. if (1 < count($parts)) {
  3. $types = [];
  4. foreach ($parts as $part) {
  5. if (!empty($type = $this->getTypeFromPart($part))) {
  6. $types[$part->getAttributeName()] = $type;
    Cannot call method getAttributeName() on mixed.
    Last edited by Mikaël DELSOL
  7. }
  8. }
  9. $this->setKnownType($method, $types);
  10. } else {
  11. $part = array_shift($parts);
  1. abstract protected function setKnownType(Method $method, $knownType);
  2. protected function parseWsdl(Wsdl $wsdl): void
  3. {
  4. foreach ($this->getTags() as $tag) {
  5. $this->parseInputOutput($tag);
    Parameter #1 $tag of method WsdlToPhp\PackageGenerator\Parser\Wsdl\AbstractTagInputOutputParser::parseInputOutput() expects WsdlToPhp\WsdlHandler\Tag\AbstractTagOperationElement, mixed given.
    Last edited by Mikaël DELSOL
  6. }
  7. }
  8. protected function getTypeFromPart(TagPart $part): string
  9. {
  1. $knownType = $this->getKnownType($method);
  2. if (is_string($knownType)) {
  3. $isKnown = !empty($knownType) && self::UNKNOWN !== mb_strtolower($knownType);
  4. } elseif (is_array($knownType)) {
  5. foreach ($knownType as $knownValue) {
  6. $isKnown &= self::UNKNOWN !== mb_strtolower($knownValue);
    Parameter #1 $str of function mb_strtolower expects string, mixed given.
    Last edited by Mikaël DELSOL
  7. }
  8. }
  9. return (bool) !$isKnown;
  10. }
  1. /** @var AbstractAttributeHandler $attribute */
  2. foreach ($tag->getAttributes() as $attribute) {
  3. $methodToCall = $this->getParseTagAttributeMethod($attribute->getName());
  4. if (is_array($methodToCall)) {
  5. call_user_func_array($methodToCall, [
    Parameter #1 $function of function call_user_func_array expects callable(): mixed, array given.
    Last edited by Mikaël DELSOL
  6. $attribute,
  7. $model,
  8. $structAttribute,
  9. ]);
  10. } else {
  1. $type = $tagAttribute->getValue();
  2. if (is_null($type)) {
  3. return;
  4. }
  5. $typeModel = $this->generator->getStructByName($type);
    Parameter #1 $structName of method WsdlToPhp\PackageGenerator\Generator\Generator::getStructByName() expects string, mixed given.
    Last edited by Mikaël DELSOL
  6. $modelAttributeType = $structAttribute->getType();
  7. if ($typeModel instanceof Struct && (empty($modelAttributeType) || 'unknown' === mb_strtolower($modelAttributeType))) {
  8. if ($typeModel->isRestriction()) {
  9. $structAttribute->setType($typeModel->getName());
  1. $typeModel = $this->generator->getStructByName($type);
  2. $modelAttributeType = $structAttribute->getType();
  3. if ($typeModel instanceof Struct && (empty($modelAttributeType) || 'unknown' === mb_strtolower($modelAttributeType))) {
  4. if ($typeModel->isRestriction()) {
  5. $structAttribute->setType($typeModel->getName());
    Parameter #1 $type of method WsdlToPhp\PackageGenerator\Model\StructAttribute::setType() expects string, mixed given.
    Last edited by Mikaël DELSOL
  6. } elseif (!$typeModel->isStruct() && $typeModel->getInheritance()) {
  7. $structAttribute->setType($typeModel->getInheritance());
  8. }
  9. }
  10. } else {
  1. {
  2. }
  3. protected function parseTagAttributeAbstract(AttributeHandler $tagAttribute, AbstractModel $model): void
  4. {
  5. $model->setAbstract($tagAttribute->getValue(false, true, 'bool'));
    Parameter #1 $isAbstract of method WsdlToPhp\PackageGenerator\Model\AbstractModel::setAbstract() expects bool, mixed given.
    Last edited by Mikael DELSOL
  6. }
  7. /**
  8. * Enumeration does not need its own value as meta information, it's like the name for struct attribute.
  9. */
  1. */
  2. public function parseChoice(Choice $choice): void
  3. {
  4. $parent = $choice->getSuitableParent();
  5. $children = $choice->getChildrenElements();
  6. if ($parent && count($children) && ($struct = $this->getModel($parent)) instanceof Struct) {
    Parameter #1 $tag of method WsdlToPhp\PackageGenerator\Parser\Wsdl\AbstractTagParser::getModel() expects WsdlToPhp\WsdlHandler\Tag\AbstractTag, WsdlToPhp\DomHandler\NodeHandler given.
    Last edited by Mikaël DELSOL
  7. $unionNames = [];
  8. foreach ($children as $child) {
  9. $unionNames[] = $child->getAttributeName() ?: $child->getAttributeRef();
  10. }
  11. foreach ($children as $child) {
  1. $parent = $choice->getSuitableParent();
  2. $children = $choice->getChildrenElements();
  3. if ($parent && count($children) && ($struct = $this->getModel($parent)) instanceof Struct) {
  4. $unionNames = [];
  5. foreach ($children as $child) {
  6. $unionNames[] = $child->getAttributeName() ?: $child->getAttributeRef();
    Cannot call method getAttributeName() on mixed.
    Last edited by Mikael DELSOL
  7. }
  8. foreach ($children as $child) {
  9. $this->parseChoiceChild($choice, $unionNames, $child, $struct);
  10. }
  11. unset($unionNames);
  1. $parent = $choice->getSuitableParent();
  2. $children = $choice->getChildrenElements();
  3. if ($parent && count($children) && ($struct = $this->getModel($parent)) instanceof Struct) {
  4. $unionNames = [];
  5. foreach ($children as $child) {
  6. $unionNames[] = $child->getAttributeName() ?: $child->getAttributeRef();
    Cannot call method getAttributeRef() on mixed.
    Last edited by Mikael DELSOL
  7. }
  8. foreach ($children as $child) {
  9. $this->parseChoiceChild($choice, $unionNames, $child, $struct);
  10. }
  11. unset($unionNames);
  1. $unionNames = [];
  2. foreach ($children as $child) {
  3. $unionNames[] = $child->getAttributeName() ?: $child->getAttributeRef();
  4. }
  5. foreach ($children as $child) {
  6. $this->parseChoiceChild($choice, $unionNames, $child, $struct);
    Parameter #3 $child of method WsdlToPhp\PackageGenerator\Parser\Wsdl\TagChoice::parseChoiceChild() expects WsdlToPhp\WsdlHandler\Tag\AbstractTag, mixed given.
    Last edited by Mikaël DELSOL
  7. }
  8. unset($unionNames);
  9. }
  10. }
  1. }
  2. protected function parseWsdl(Wsdl $wsdl): void
  3. {
  4. foreach ($this->getTags() as $tag) {
  5. $this->parseChoice($tag);
    Parameter #1 $choice of method WsdlToPhp\PackageGenerator\Parser\Wsdl\TagChoice::parseChoice() expects WsdlToPhp\WsdlHandler\Tag\TagChoice, mixed given.
    Last edited by Mikaël DELSOL
  6. }
  7. }
  8. protected function parsingTag(): string
  9. {
  1. }
  2. protected function parseWsdl(Wsdl $wsdl): void
  3. {
  4. foreach ($this->getTags() as $tag) {
  5. $this->parseComplexType($tag);
    Parameter #1 $complexType of method WsdlToPhp\PackageGenerator\Parser\Wsdl\TagComplexType::parseComplexType() expects WsdlToPhp\WsdlHandler\Tag\TagComplexType, mixed given.
    Last edited by Mikaël DELSOL
  6. }
  7. }
  8. protected function parsingTag(): string
  9. {
  1. }
  2. protected function parseWsdl(Wsdl $wsdl): void
  3. {
  4. foreach ($this->getTags() as $tag) {
  5. $this->parseDocumentation($tag);
    Parameter #1 $documentation of method WsdlToPhp\PackageGenerator\Parser\Wsdl\TagDocumentation::parseDocumentation() expects WsdlToPhp\WsdlHandler\Tag\TagDocumentation, mixed given.
    Last edited by Mikaël DELSOL
  6. }
  7. }
  8. protected function parsingTag(): string
  9. {
  1. }
  2. protected function parseWsdl(Wsdl $wsdl): void
  3. {
  4. foreach ($this->getTags() as $tag) {
  5. $this->parseEnumeration($tag);
    Parameter #1 $enumeration of method WsdlToPhp\PackageGenerator\Parser\Wsdl\TagEnumeration::parseEnumeration() expects WsdlToPhp\WsdlHandler\Tag\TagEnumeration, mixed given.
    Last edited by Mikaël DELSOL
  6. }
  7. }
  8. protected function parsingTag(): string
  9. {
  1. final class TagExtension extends AbstractTagParser
  2. {
  3. public function parseExtension(Extension $extension): void
  4. {
  5. $base = $extension->getAttribute('base')->getValue();
    Cannot call method getValue() on WsdlToPhp\DomHandler\AttributeHandler|null.
    Last edited by Mikael DELSOL
  6. $parent = $extension->getSuitableParent();
  7. if (!empty($base) && $parent instanceof AbstractTag && $this->getModel($parent) instanceof AbstractModel && $parent->getAttributeName() !== $base) {
  8. $this->getModel($parent)->setInheritance($base);
  9. }
  10. }
  1. public function parseExtension(Extension $extension): void
  2. {
  3. $base = $extension->getAttribute('base')->getValue();
  4. $parent = $extension->getSuitableParent();
  5. if (!empty($base) && $parent instanceof AbstractTag && $this->getModel($parent) instanceof AbstractModel && $parent->getAttributeName() !== $base) {
  6. $this->getModel($parent)->setInheritance($base);
    Parameter #1 $inheritance of method WsdlToPhp\PackageGenerator\Model\AbstractModel::setInheritance() expects string, mixed given.
    Last edited by Mikael DELSOL
  7. }
  8. }
  9. protected function parseWsdl(Wsdl $wsdl): void
  10. {
  1. }
  2. protected function parseWsdl(Wsdl $wsdl): void
  3. {
  4. foreach ($this->getTags() as $tag) {
  5. $this->parseExtension($tag);
    Parameter #1 $extension of method WsdlToPhp\PackageGenerator\Parser\Wsdl\TagExtension::parseExtension() expects WsdlToPhp\WsdlHandler\Tag\TagExtension, mixed given.
    Last edited by Mikaël DELSOL
  6. }
  7. }
  8. protected function parsingTag(): string
  9. {
  1. }
  2. protected function parseWsdl(Wsdl $wsdl): void
  3. {
  4. foreach ($this->getTags() as $tag) {
  5. $this->parseHeader($tag);
    Parameter #1 $header of method WsdlToPhp\PackageGenerator\Parser\Wsdl\TagHeader::parseHeader() expects WsdlToPhp\WsdlHandler\Tag\TagHeader, mixed given.
    Last edited by Mikaël DELSOL
  6. }
  7. }
  8. protected function parsingTag(): string
  9. {
  1. protected function isSoapHeaderAlreadyDefined(Method $method, string $soapHeaderName): bool
  2. {
  3. $methodSoapHeaders = $method->getMetaValue(self::META_SOAP_HEADER_NAMES, []);
  4. return in_array($soapHeaderName, $methodSoapHeaders, true);
    Parameter #2 $haystack of function in_array expects array, mixed given.
    Last edited by Mikael DELSOL
  5. }
  6. }
  1. }
  2. protected function parseWsdl(Wsdl $wsdl): void
  3. {
  4. foreach ($this->getTags() as $tag) {
  5. $this->parseList($tag);
    Parameter #1 $tag of method WsdlToPhp\PackageGenerator\Parser\Wsdl\TagList::parseList() expects WsdlToPhp\WsdlHandler\Tag\TagList, mixed given.
    Last edited by Mikaël DELSOL
  6. }
  7. }
  8. protected function parsingTag(): string
  9. {
  1. $model = $this->getModel($parent, $restriction->getAttributeBase()) ?? $this->getModel($parent);
  2. // If restriction is contained by a union tag, don't create the virtual struct as "union"s
  3. // are wrongly parsed by SoapClient::__getTypes and this creates a duplicated element then
  4. if (!$model && !$restriction->hasUnionParent()) {
  5. $this->getGenerator()->getStructs()->addVirtualStruct($parent->getAttributeName(), $restriction->getAttributeBase());
    Cannot call method getStructs() on WsdlToPhp\PackageGenerator\Generator\Generator|null.
    Last edited by Mikaël DELSOL
  6. $model = $this->getModel($parent, $restriction->getAttributeBase());
  7. }
  8. if ($model instanceof Struct) {
  9. $this
  1. {
  2. if ($child->hasAttributeValue()) {
  3. $model->addMeta($child->getName(), $child->getValueAttributeValue(true));
  4. } else {
  5. foreach ($child->getAttributes() as $attribute) {
  6. $this->parseRestrictionChildAttribute($model, $attribute);
    Parameter #2 $attribute of method WsdlToPhp\PackageGenerator\Parser\Wsdl\TagRestriction::parseRestrictionChildAttribute() expects WsdlToPhp\DomHandler\AttributeHandler, WsdlToPhp\DomHandler\AbstractNodeHandler given.
    Last edited by Mikaël DELSOL
  7. }
  8. }
  9. return $this;
  10. }
  1. }
  2. protected function parseRestrictionChildAttribute(AbstractModel $model, AttributeHandler $attribute): self
  3. {
  4. if ('arraytype' === mb_strtolower($attribute->getName())) {
  5. $model->setInheritance($attribute->getValue());
    Parameter #1 $inheritance of method WsdlToPhp\PackageGenerator\Model\AbstractModel::setInheritance() expects string, mixed given.
    Last edited by Mikael DELSOL
  6. }
  7. $model->addMeta($attribute->getName(), $attribute->getValue(true));
  8. return $this;
  1. $parent = $union->getSuitableParent();
  2. if (!$parent) {
  3. return;
  4. }
  5. $model = $this->getModel($parent);
    Parameter #1 $tag of method WsdlToPhp\PackageGenerator\Parser\Wsdl\AbstractTagParser::getModel() expects WsdlToPhp\WsdlHandler\Tag\AbstractTag, WsdlToPhp\DomHandler\NodeHandler given.
    Last edited by Mikaël DELSOL
  6. if (!$model) {
  7. return;
  8. }
  9. $memberTypes = $union->getAttributeMemberTypes();
  1. }
  2. protected function parseWsdl(Wsdl $wsdl): void
  3. {
  4. foreach ($this->getTags() as $tag) {
  5. $this->parseUnion($tag);
    Parameter #1 $union of method WsdlToPhp\PackageGenerator\Parser\Wsdl\TagUnion::parseUnion() expects WsdlToPhp\WsdlHandler\Tag\TagUnion, mixed given.
    Last edited by Mikaël DELSOL
  6. }
  7. }
  8. protected function parsingTag(): string
  9. {
  1. protected function findSuitableInheritance(array $values): string
  2. {
  3. $validInheritance = '';
  4. foreach ($values as $value) {
  5. $model = $this->getStructByName($value);
    Parameter #1 $name of method WsdlToPhp\PackageGenerator\Parser\Wsdl\AbstractTagParser::getStructByName() expects string, mixed given.
    Last edited by Mikael DELSOL
  6. while ($model instanceof AbstractModel && !empty($model->getInheritance())) {
  7. $model = $this->getStructByName($validInheritance = $model->getInheritance());
  8. }
  9. if ($model instanceof AbstractModel) {
  1. protected function getUnionMemberTypesFromChildren(Union $union): array
  2. {
  3. $memberTypes = [];
  4. foreach ($union->getMemberTypesChildren() as $child) {
  5. if ($child instanceof SimpleType && $child->hasRestrictionChild() && '' !== $child->getFirstRestrictionChild()->getAttributeBase()) {
    Cannot call method getAttributeBase() on WsdlToPhp\WsdlHandler\Tag\TagRestriction|null.
    Last edited by Mikaël DELSOL
  6. $memberTypes[] = $child->getFirstRestrictionChild()->getAttributeBase();
  7. }
  8. }
  9. return array_unique($memberTypes);
  1. protected function getUnionMemberTypesFromChildren(Union $union): array
  2. {
  3. $memberTypes = [];
  4. foreach ($union->getMemberTypesChildren() as $child) {
  5. if ($child instanceof SimpleType && $child->hasRestrictionChild() && '' !== $child->getFirstRestrictionChild()->getAttributeBase()) {
  6. $memberTypes[] = $child->getFirstRestrictionChild()->getAttributeBase();
    Cannot call method getAttributeBase() on WsdlToPhp\WsdlHandler\Tag\TagRestriction|null.
    Last edited by Mikaël DELSOL
  7. }
  8. }
  9. return array_unique($memberTypes);
  10. }

Your project inheritance architecture should be valid

More information: https://insight.symfony.com/what-we-analyse/php.invalid_inheritance

  1. use Symfony\Component\Console\Command\Command;
  2. use Symfony\Component\Console\Input\InputInterface;
  3. use Symfony\Component\Console\Input\InputOption;
  4. use Symfony\Component\Console\Output\OutputInterface;
  5. abstract class AbstractCommand extends Command
    Class WsdlToPhp\PackageGenerator\Command\AbstractCommand extends unknown class Symfony\Component\Console\Command\Command.
    Last edited by Mikael DELSOL
  6. {
  7. public const EXIT_OK = 0;
  8. protected InputInterface $input;

Your project must not contain invalid instantiations 29

More information: https://insight.symfony.com/what-we-analyse/php.invalid_instantiation

  1. }
  2. protected function defineGeneralAnnotations(PhpAnnotationBlock $block): self
  3. {
  4. foreach ($this->getGenerator()->getOptionAddComments() as $tagName => $tagValue) {
  5. $block->addChild(new PhpAnnotation($tagName, $tagValue));
    Parameter #2 $content of class WsdlToPhp\PhpGenerator\Element\PhpAnnotation constructor expects string, mixed given.
    Last edited by Mikael DELSOL
  6. }
  7. return $this;
  8. }
in src/File/Service.php, line 183
  1. new PhpFunctionParameterBase(self::PARAM_SET_HEADER_ACTOR, null, self::TYPE_STRING),
  2. ], self::TYPE_SELF);
  3. $model = $this->getModelByName($soapHeaderType);
  4. if ($model instanceof StructModel) {
  5. $rules = new Rules($this, $method, new StructAttributeModel($model->getGenerator(), $soapHeaderType, $model->getName(), $model), $this->methods);
    Parameter #3 $type of class WsdlToPhp\PackageGenerator\Model\StructAttribute constructor expects string, mixed given.
    Last edited by Mikaël DELSOL
  6. $rules->applyRules(lcfirst($soapHeaderName));
  7. $firstParameter->setModel($model);
  8. }
  9. $method->addChild(sprintf('return $this->%s($%s, \'%s\', $%s, $%s, $%s);', self::METHOD_SET_HEADER_PREFIX, self::PARAM_SET_HEADER_NAMESPACE, $soapHeaderName, lcfirst($soapHeaderName), self::PARAM_SET_HEADER_MUSTUNDERSTAND, self::PARAM_SET_HEADER_ACTOR));
  10. } catch (\InvalidArgumentException $exception) {
in src/File/Service.php, line 183
  1. new PhpFunctionParameterBase(self::PARAM_SET_HEADER_ACTOR, null, self::TYPE_STRING),
  2. ], self::TYPE_SELF);
  3. $model = $this->getModelByName($soapHeaderType);
  4. if ($model instanceof StructModel) {
  5. $rules = new Rules($this, $method, new StructAttributeModel($model->getGenerator(), $soapHeaderType, $model->getName(), $model), $this->methods);
    Parameter #1 $generator of class WsdlToPhp\PackageGenerator\Model\StructAttribute constructor expects WsdlToPhp\PackageGenerator\Generator\Generator, WsdlToPhp\PackageGenerator\Generator\Generator|null given.
    Last edited by Mikaël DELSOL
  6. $rules->applyRules(lcfirst($soapHeaderName));
  7. $firstParameter->setModel($model);
  8. }
  9. $method->addChild(sprintf('return $this->%s($%s, \'%s\', $%s, $%s, $%s);', self::METHOD_SET_HEADER_PREFIX, self::PARAM_SET_HEADER_NAMESPACE, $soapHeaderName, lcfirst($soapHeaderName), self::PARAM_SET_HEADER_MUSTUNDERSTAND, self::PARAM_SET_HEADER_ACTOR));
  10. } catch (\InvalidArgumentException $exception) {
in src/File/Service.php, line 259
  1. $firstParameter = array_shift($methodParameters);
  2. if ($firstParameter instanceof PhpFunctionParameter) {
  3. $annotationBlock->addChild(sprintf('Sets the %s SoapHeader param', ucfirst($firstParameter->getName())));
  4. $firstParameterType = $firstParameter->getType();
  5. if ($firstParameter->getModel() instanceof StructModel) {
  6. $firstParameterType = $this->getStructAttributeTypeAsPhpType(new StructAttributeModel($firstParameter->getModel()->getGenerator(), $firstParameter->getName(), $firstParameter->getModel()->getName(), $firstParameter->getModel()));
    Parameter #1 $generator of class WsdlToPhp\PackageGenerator\Model\StructAttribute constructor expects WsdlToPhp\PackageGenerator\Generator\Generator, WsdlToPhp\PackageGenerator\Generator\Generator|null given.
    Last edited by Mikael DELSOL
  7. if ($firstParameter->getModel()->isRestriction()) {
  8. $annotationBlock
  9. ->addChild(new PhpAnnotation(self::ANNOTATION_USES, sprintf('%s::%s()', $firstParameter->getModel()->getPackagedName(true), StructEnum::METHOD_VALUE_IS_VALID)))
  10. ->addChild(new PhpAnnotation(self::ANNOTATION_USES, sprintf('%s::%s()', $firstParameter->getModel()->getPackagedName(true), StructEnum::METHOD_GET_VALID_VALUES)))
  11. ->addChild(new PhpAnnotation(self::ANNOTATION_THROWS, \InvalidArgumentException::class))
in src/File/Service.php, line 259
  1. $firstParameter = array_shift($methodParameters);
  2. if ($firstParameter instanceof PhpFunctionParameter) {
  3. $annotationBlock->addChild(sprintf('Sets the %s SoapHeader param', ucfirst($firstParameter->getName())));
  4. $firstParameterType = $firstParameter->getType();
  5. if ($firstParameter->getModel() instanceof StructModel) {
  6. $firstParameterType = $this->getStructAttributeTypeAsPhpType(new StructAttributeModel($firstParameter->getModel()->getGenerator(), $firstParameter->getName(), $firstParameter->getModel()->getName(), $firstParameter->getModel()));
    Parameter #3 $type of class WsdlToPhp\PackageGenerator\Model\StructAttribute constructor expects string, mixed given.
    Last edited by Mikael DELSOL
  7. if ($firstParameter->getModel()->isRestriction()) {
  8. $annotationBlock
  9. ->addChild(new PhpAnnotation(self::ANNOTATION_USES, sprintf('%s::%s()', $firstParameter->getModel()->getPackagedName(true), StructEnum::METHOD_VALUE_IS_VALID)))
  10. ->addChild(new PhpAnnotation(self::ANNOTATION_USES, sprintf('%s::%s()', $firstParameter->getModel()->getPackagedName(true), StructEnum::METHOD_GET_VALID_VALUES)))
  11. ->addChild(new PhpAnnotation(self::ANNOTATION_THROWS, \InvalidArgumentException::class))
in src/File/Struct.php, line 133
  1. }
  2. protected function addStructMethodConstruct(): self
  3. {
  4. if (0 < count($parameters = $this->getStructMethodParametersValues())) {
  5. $method = new PhpMethod(self::METHOD_CONSTRUCT, $parameters);
    Parameter #2 $parameters of class WsdlToPhp\PhpGenerator\Element\PhpMethod constructor expects array<string|WsdlToPhp\PhpGenerator\Element\PhpFunctionParameter>, array given.
    Last edited by Mikaël DELSOL
  6. $this->addStructMethodConstructBody($method);
  7. $this->methods->add($method);
  8. }
  9. return $this;
in src/File/Struct.php, line 370
  1. ).$this->getStructAttributeTypeAsPhpType($attribute);
  2. }
  3. $method = new PhpMethod(
  4. $attribute->getGetterName(),
  5. $this->getStructMethodGetParameters($attribute),
    Parameter #2 $parameters of class WsdlToPhp\PhpGenerator\Element\PhpMethod constructor expects array<string|WsdlToPhp\PhpGenerator\Element\PhpFunctionParameter>, array given.
    Last edited by Mikaël DELSOL
  6. $returnType
  7. );
  8. if ($attribute->nameIsClean()) {
  9. $thisAccess = sprintf('%s', $attribute->getName());
  10. } else {
  1. $this->getStructAttribute()
  2. ),
  3. ], self::TYPE_SELF);
  4. if ($this->getGenerator()->getOptionValidation()) {
  5. $rules = new Rules($this, $method, $this->getStructAttribute(), $this->methods);
    Parameter #3 $attribute of class WsdlToPhp\PackageGenerator\File\Validation\Rules constructor expects WsdlToPhp\PackageGenerator\Model\StructAttribute, WsdlToPhp\PackageGenerator\Model\StructAttribute|null given.
    Last edited by Mikaël DELSOL
  6. $rules->applyRules('item', true);
  7. }
  8. $method->addChild('return parent::add($item);');
  9. $this->methods->add($method);
  1. return $this;
  2. }
  3. protected function addArrayMethodGenericMethod(string $name, string $body, array $methodParameters = [], ?string $returnType = null): self
  4. {
  5. $method = new PhpMethod($name, $methodParameters, $returnType);
    Parameter #2 $parameters of class WsdlToPhp\PhpGenerator\Element\PhpMethod constructor expects array<string|WsdlToPhp\PhpGenerator\Element\PhpFunctionParameter>, array given.
    Last edited by Mikaël DELSOL
  6. $method->addChild($body);
  7. $this->methods->add($method);
  8. return $this;
  9. }
  1. $description,
  2. new PhpAnnotation(self::ANNOTATION_SEE, sprintf('%s::%s()', $this->getModel()->getExtends(true), $name)),
  3. ]);
  4. if (!empty($param)) {
  5. $annotationBlock->addChild(new PhpAnnotation(self::ANNOTATION_PARAM, $param));
    Parameter #2 $content of class WsdlToPhp\PhpGenerator\Element\PhpAnnotation constructor expects string, mixed given.
    Last edited by Mikael DELSOL
  6. }
  7. $annotationBlock->addChild(new PhpAnnotation(self::ANNOTATION_RETURN, $this->getStructAttributeTypeGetAnnotation($this->getStructAttribute(), false, true)));
  8. return $annotationBlock;
  9. }
  1. protected function fillClassConstants(ConstantContainer $constants): void
  2. {
  3. /** @var StructModel $model */
  4. $model = $this->getModel();
  5. foreach ($model->getValues() as $value) {
  6. $constants->add(new PhpConstant($value->getCleanName(), $value->getValue()));
    Parameter #1 $name of class WsdlToPhp\PhpGenerator\Element\PhpConstant constructor expects string, mixed given.
    Last edited by Mikael DELSOL
  7. }
  8. }
  9. protected function defineUseStatements(): self
  10. {
  1. {
  2. $annotationBlock = new PhpAnnotationBlock([
  3. 'Return allowed values',
  4. ]);
  5. foreach ($this->getEnumMethodValues() as $value) {
  6. $annotationBlock->addChild(new PhpAnnotation(self::ANNOTATION_USES, $value));
    Parameter #2 $content of class WsdlToPhp\PhpGenerator\Element\PhpAnnotation constructor expects string, mixed given.
    Last edited by Mikael DELSOL
  7. }
  8. $annotationBlock->addChild(new PhpAnnotation(self::ANNOTATION_RETURN, 'string[]'));
  9. return $annotationBlock;
  10. }
in src/File/Tutorial.php, line 212
  1. return $parameter;
  2. }
  3. protected function addAnnotationBlock($content): self
  4. {
  5. $this->getFile()->getMainElement()->addChild(new PhpAnnotationBlock($content));
    Parameter #1 $annotations of class WsdlToPhp\PhpGenerator\Element\PhpAnnotationBlock constructor expects array, mixed given.
    Last edited by Mikael DELSOL
  6. return $this;
  7. }
  8. }
  1. $rules = clone $this->getRules();
  2. $rules->setMethod($method);
  3. // gather validation rules
  4. foreach ($unionValues as $unionValue) {
  5. $attribute = new StructAttribute($this->getGenerator(), 'any', $unionValue);
    Parameter #3 $type of class WsdlToPhp\PackageGenerator\Model\StructAttribute constructor expects string, mixed given.
    Last edited by Mikaël DELSOL
  6. $attribute->setOwner($this->getAttribute()->getOwner());
  7. $rules
  8. ->setAttribute($attribute)
  9. ->applyRules('value')
  10. ;
  1. }
  2. public function addSchemaToWsdl(Wsdl $wsdl, string $schemaLocation): self
  3. {
  4. if (!empty($schemaLocation) && !$wsdl->hasSchema($schemaLocation)) {
  5. $wsdl->addSchema(new Schema($wsdl->getGenerator(), $schemaLocation, $this->getUrlContent($schemaLocation)));
    Parameter #3 $content of class WsdlToPhp\PackageGenerator\Model\Schema constructor expects string, string|null given.
    Last edited by Mikaël DELSOL
  6. }
  7. return $this;
  8. }
  1. }
  2. public function addSchemaToWsdl(Wsdl $wsdl, string $schemaLocation): self
  3. {
  4. if (!empty($schemaLocation) && !$wsdl->hasSchema($schemaLocation)) {
  5. $wsdl->addSchema(new Schema($wsdl->getGenerator(), $schemaLocation, $this->getUrlContent($schemaLocation)));
    Parameter #1 $generator of class WsdlToPhp\PackageGenerator\Model\Schema constructor expects WsdlToPhp\PackageGenerator\Generator\Generator, WsdlToPhp\PackageGenerator\Generator\Generator|null given.
    Last edited by Mikaël DELSOL
  6. }
  7. return $this;
  8. }
  1. return $this;
  2. }
  3. protected function initWsdl(): self
  4. {
  5. $this->setWsdl(new Wsdl($this, $this->getOptionOrigin(), $this->getUrlContent($this->getOptionOrigin())));
    Parameter #3 $content of class WsdlToPhp\PackageGenerator\Model\Wsdl constructor expects string, string|null given.
    Last edited by Mikaël DELSOL
  6. return $this;
  7. }
  8. /**
  1. }
  2. protected function generateServicesClasses(): self
  3. {
  4. foreach ($this->getGenerator()->getServices(true) as $service) {
  5. $file = new ServiceFile($this->generator, $service->getPackagedName());
    Parameter #2 $name of class WsdlToPhp\PackageGenerator\File\Service constructor expects string, mixed given.
    Last edited by Mikael DELSOL
  6. $file->setModel($service)->write();
  7. }
  8. return $this;
  9. }
in src/Model/Service.php, line 46
  1. return $this->methods;
  2. }
  3. public function addMethod(string $methodName, $methodParameterType, $methodReturnType, $methodIsUnique = true): Method
  4. {
  5. $method = new Method($this->getGenerator(), $methodName, $methodParameterType, $methodReturnType, $this, $methodIsUnique);
    Parameter #1 $generator of class WsdlToPhp\PackageGenerator\Model\Method constructor expects WsdlToPhp\PackageGenerator\Generator\Generator, WsdlToPhp\PackageGenerator\Generator\Generator|null given.
    Last edited by Mikael DELSOL
  6. $this->methods->add($method);
  7. return $method;
  8. }
in src/Model/Service.php, line 46
  1. return $this->methods;
  2. }
  3. public function addMethod(string $methodName, $methodParameterType, $methodReturnType, $methodIsUnique = true): Method
  4. {
  5. $method = new Method($this->getGenerator(), $methodName, $methodParameterType, $methodReturnType, $this, $methodIsUnique);
    Parameter #6 $isUnique of class WsdlToPhp\PackageGenerator\Model\Method constructor expects bool, mixed given.
    Last edited by Mikael DELSOL
  6. $this->methods->add($method);
  7. return $method;
  8. }
in src/Model/Struct.php, line 127
  1. *
  2. * @param bool $requiredFirst places the required attributes first, then the not required in order to have the _construct method with the required attribute at first
  3. */
  4. public function getProperAttributes(bool $requiredFirst = false): StructAttributeContainer
  5. {
  6. $properAttributes = new StructAttributeContainer($this->getGenerator());
    Parameter #1 $generator of class WsdlToPhp\PackageGenerator\Container\Model\StructAttribute constructor expects WsdlToPhp\PackageGenerator\Generator\Generator, WsdlToPhp\PackageGenerator\Generator\Generator|null given.
    Last edited by Mikaël DELSOL
  7. $parentAttributes = new StructAttributeContainer($this->getGenerator());
  8. if (!empty($this->getInheritance()) && ($model = $this->getInheritanceStruct()) instanceof Struct) {
  9. while ($model instanceof Struct && $model->isStruct()) {
  10. foreach ($model->getAttributes() as $attribute) {
in src/Model/Struct.php, line 128
  1. * @param bool $requiredFirst places the required attributes first, then the not required in order to have the _construct method with the required attribute at first
  2. */
  3. public function getProperAttributes(bool $requiredFirst = false): StructAttributeContainer
  4. {
  5. $properAttributes = new StructAttributeContainer($this->getGenerator());
  6. $parentAttributes = new StructAttributeContainer($this->getGenerator());
    Parameter #1 $generator of class WsdlToPhp\PackageGenerator\Container\Model\StructAttribute constructor expects WsdlToPhp\PackageGenerator\Generator\Generator, WsdlToPhp\PackageGenerator\Generator\Generator|null given.
    Last edited by Mikaël DELSOL
  7. if (!empty($this->getInheritance()) && ($model = $this->getInheritanceStruct()) instanceof Struct) {
  8. while ($model instanceof Struct && $model->isStruct()) {
  9. foreach ($model->getAttributes() as $attribute) {
  10. $parentAttributes->add($attribute);
in src/Model/Struct.php, line 176
  1. {
  2. if (empty($attributeName) || empty($attributeType)) {
  3. throw new \InvalidArgumentException(sprintf('Attribute name "%s" and/or attribute type "%s" is invalid for Struct "%s"', $attributeName, $attributeType, $this->getName()), __LINE__);
  4. }
  5. if (is_null($this->attributes->getStructAttributeByName($attributeName))) {
  6. $structAttribute = new StructAttribute($this->getGenerator(), $attributeName, $attributeType, $this);
    Parameter #1 $generator of class WsdlToPhp\PackageGenerator\Model\StructAttribute constructor expects WsdlToPhp\PackageGenerator\Generator\Generator, WsdlToPhp\PackageGenerator\Generator\Generator|null given.
    Last edited by Mikael DELSOL
  7. $this->attributes->add($structAttribute);
  8. }
  9. return $this;
  10. }
in src/Model/Struct.php, line 246
  1. if (is_null($this->getValue($value))) {
  2. // issue #177, rare case: a struct and an enum has the same name and the enum is not detected by the SoapClient,
  3. // then we need to create the enumeration struct in order to deduplicate the two structs
  4. // this is why enumerations has to be parsed before any other elements by the WSDL parsers
  5. if (0 < $this->countOwnAttributes()) {
  6. $enum = new Struct($this->getGenerator(), $this->getName(), true, true);
    Parameter #1 $generator of class WsdlToPhp\PackageGenerator\Model\Struct constructor expects WsdlToPhp\PackageGenerator\Generator\Generator, WsdlToPhp\PackageGenerator\Generator\Generator|null given.
    Last edited by Mikaël DELSOL
  7. $enum->setInheritance(self::DEFAULT_ENUM_TYPE);
  8. $enum->getValues()->add(new StructValue($enum->getGenerator(), $value, $enum->getValues()->count(), $enum));
  9. $this->getGenerator()->getStructs()->add($enum);
  10. return $enum;
in src/Model/Struct.php, line 248
  1. // then we need to create the enumeration struct in order to deduplicate the two structs
  2. // this is why enumerations has to be parsed before any other elements by the WSDL parsers
  3. if (0 < $this->countOwnAttributes()) {
  4. $enum = new Struct($this->getGenerator(), $this->getName(), true, true);
  5. $enum->setInheritance(self::DEFAULT_ENUM_TYPE);
  6. $enum->getValues()->add(new StructValue($enum->getGenerator(), $value, $enum->getValues()->count(), $enum));
    Parameter #1 $generator of class WsdlToPhp\PackageGenerator\Model\StructValue constructor expects WsdlToPhp\PackageGenerator\Generator\Generator, WsdlToPhp\PackageGenerator\Generator\Generator|null given.
    Last edited by Mikaël DELSOL
  7. $this->getGenerator()->getStructs()->add($enum);
  8. return $enum;
  9. }
  10. $this
in src/Model/Struct.php, line 256
  1. return $enum;
  2. }
  3. $this
  4. ->setStruct(true)
  5. ->setRestriction(true)
  6. ->getValues()->add(new StructValue($this->getGenerator(), $value, $this->getValues()->count(), $this))
    Parameter #1 $generator of class WsdlToPhp\PackageGenerator\Model\StructValue constructor expects WsdlToPhp\PackageGenerator\Generator\Generator, WsdlToPhp\PackageGenerator\Generator\Generator|null given.
    Last edited by Mikael DELSOL
  7. ;
  8. }
  9. return $this;
  10. }
in src/Model/Struct.php, line 367
  1. }
  2. }
  3. protected function getAllAttributes(bool $includeInheritanceAttributes, bool $requiredFirst): StructAttributeContainer
  4. {
  5. $allAttributes = new StructAttributeContainer($this->getGenerator());
    Parameter #1 $generator of class WsdlToPhp\PackageGenerator\Container\Model\StructAttribute constructor expects WsdlToPhp\PackageGenerator\Generator\Generator, WsdlToPhp\PackageGenerator\Generator\Generator|null given.
    Last edited by Mikaël DELSOL
  6. if ($includeInheritanceAttributes) {
  7. $this->addInheritanceAttributes($allAttributes);
  8. }
  9. foreach ($this->attributes as $attribute) {
in src/Model/Struct.php, line 399
  1. }
  2. }
  3. protected function putRequiredAttributesFirst(StructAttributeContainer $allAttributes): StructAttributeContainer
  4. {
  5. $attributes = new StructAttributeContainer($this->getGenerator());
    Parameter #1 $generator of class WsdlToPhp\PackageGenerator\Container\Model\StructAttribute constructor expects WsdlToPhp\PackageGenerator\Generator\Generator, WsdlToPhp\PackageGenerator\Generator\Generator|null given.
    Last edited by Mikaël DELSOL
  6. $requiredAttributes = [];
  7. $notRequiredAttributes = [];
  8. $nullableNotRequiredAttributes = [];
  9. /** @var StructAttribute $attribute */
in src/File/Utils.php, line 24
  1. if (1 === count($block->getChildren())) {
  2. $block->addChild('Meta information extracted from the WSDL');
  3. }
  4. foreach ($validMeta as $meta) {
  5. $block->addChild(new PhpAnnotation(PhpAnnotation::NO_NAME, $meta, AbstractModelFile::ANNOTATION_META_LENGTH));
    Parameter #2 $content of class WsdlToPhp\PhpGenerator\Element\PhpAnnotation constructor expects string, mixed given.
    Last edited by Mikael DELSOL
  6. }
  7. }
  8. }
  9. public static function getValidMetaValues(AbstractModel $model, array $ignoreMeta = []): array

Your project should only use iterable types in foreach loops 7

More information: https://insight.symfony.com/what-we-analyse/php.invalid_foreach_iterable

in src/File/Tutorial.php, line 151
  1. protected function addServiceSoapHeadersDefinition(string $serviceVariableName, MethodModel $method, array $added): array
  2. {
  3. $addedNames = [];
  4. $soapHeaderNames = $method->getMetaValue(TagHeader::META_SOAP_HEADER_NAMES, []);
  5. foreach ($soapHeaderNames as $soapHeaderName) {
    Argument of an invalid type mixed supplied for foreach, only iterables are supported.
    Last edited by Mikael DELSOL
  6. if (in_array($soapHeaderName, $added, true)) {
  7. continue;
  8. }
  9. $addedNames[] = $soapHeaderName;
  1. $services = $this->containers->getServices();
  2. if ($usingGatherMethods && GeneratorOptions::VALUE_NONE === $this->getOptionGatherMethods()) {
  3. $serviceContainer = new ServiceContainer($this);
  4. $serviceModel = new Service($this, Service::DEFAULT_SERVICE_CLASS_NAME);
  5. foreach ($services as $service) {
  6. foreach ($service->getMethods() as $method) {
    Argument of an invalid type mixed supplied for foreach, only iterables are supported.
    Last edited by Mikael DELSOL
  7. $serviceModel->getMethods()->add($method);
  8. }
  9. }
  10. $serviceContainer->add($serviceModel);
  11. $services = $serviceContainer;
  1. {
  2. $decodedJson = json_decode($json, true);
  3. if (JSON_ERROR_NONE === json_last_error()) {
  4. // load options first
  5. $options = GeneratorOptions::instance();
  6. foreach ($decodedJson['options'] as $name => $value) {
    Argument of an invalid type mixed supplied for foreach, only iterables are supported.
    Last edited by Mikaël DELSOL
  7. $options->setOptionValue($name, $value);
  8. }
  9. // create generator instance with options
  10. $instance = new self($options);
  11. // load services
  1. $options->setOptionValue($name, $value);
  2. }
  3. // create generator instance with options
  4. $instance = new self($options);
  5. // load services
  6. foreach ($decodedJson['containers']['services'] as $service) {
    Argument of an invalid type mixed supplied for foreach, only iterables are supported.
    Last edited by Mikael DELSOL
  7. $instance->getContainers()->getServices()->add(self::getModelInstanceFromJsonArrayEntry($instance, $service));
  8. }
  9. // load structs
  10. foreach ($decodedJson['containers']['structs'] as $struct) {
  11. $instance->getContainers()->getStructs()->add(self::getModelInstanceFromJsonArrayEntry($instance, $struct));
  1. // load services
  2. foreach ($decodedJson['containers']['services'] as $service) {
  3. $instance->getContainers()->getServices()->add(self::getModelInstanceFromJsonArrayEntry($instance, $service));
  4. }
  5. // load structs
  6. foreach ($decodedJson['containers']['structs'] as $struct) {
    Argument of an invalid type mixed supplied for foreach, only iterables are supported.
    Last edited by Mikael DELSOL
  7. $instance->getContainers()->getStructs()->add(self::getModelInstanceFromJsonArrayEntry($instance, $struct));
  8. }
  9. } else {
  10. throw new \InvalidArgumentException(sprintf('Json is invalid, please check error %s', json_last_error()));
  11. }
  1. $meta = func_get_args();
  2. $mergedMeta = [];
  3. $metaDocumentation = [];
  4. // gather meta
  5. foreach ($meta as $metaItem) {
  6. foreach ($metaItem as $metaName => $metaValue) {
    Argument of an invalid type mixed supplied for foreach, only iterables are supported.
    Last edited by Mikaël DELSOL
  7. if (self::META_DOCUMENTATION === $metaName) {
  8. $metaDocumentation = array_merge($metaDocumentation, $metaValue);
  9. } elseif (!array_key_exists($metaName, $mergedMeta)) {
  10. $mergedMeta[$metaName] = $metaValue;
  11. } elseif (is_array($mergedMeta[$metaName]) && is_array($metaValue)) {
  1. ->getSoapClient()
  2. ->getSoapClient()
  3. ->__getTypes()
  4. ;
  5. foreach ($types as $type) {
    Argument of an invalid type array|null supplied for foreach, only iterables are supported.
    Last edited by Mikaël DELSOL
  6. $this->parseType($type);
  7. }
  8. }
  9. protected function parseType(string $type): void

Text files should end with a valid new line character.

More information: https://insight.symfony.com/what-we-analyse/missing_e_o_l

in Makefile, line 38
  1. up:
  2. $(DOCKER_COMPOSE) up -d
  3. update:
  4. $(DOCKER_EXEC_CONTAINER) $(PHP_VERSION) $(COMPOSER) update
  5. This file ends with no newline character, or with a different newline character than other files in your project. It won't render properly on a terminal, and it's considered a bad practice.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Collective