Your project must not contain invalid instantiations
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.invalid_instantiation
- return $enum;
- }
- $this
- ->setStruct(true)
- ->setRestriction(true)
- ->getValues()->add(new StructValue($this->getGenerator(), $value, $this->getValues()->count(), $this));
- }
- return $this;
- }
Your project must not contain invalid function or method calls 5
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.invalid_call
- $parent = $choice->getSuitableParent();
- $children = $choice->getChildrenElements();
- if ($parent && count($children) && ($struct = $this->getModel($parent)) instanceof Struct) {
- $unionNames = [];
- foreach ($children as $child) {
- $unionNames[] = $child->getAttributeName() ? $child->getAttributeName() : $child->getAttributeRef();
- }
- foreach ($children as $child) {
- $this->parseChoiceChild($choice, $unionNames, $child, $struct);
- }
- unset($unionNames);
- $parent = $choice->getSuitableParent();
- $children = $choice->getChildrenElements();
- if ($parent && count($children) && ($struct = $this->getModel($parent)) instanceof Struct) {
- $unionNames = [];
- foreach ($children as $child) {
- $unionNames[] = $child->getAttributeName() ? $child->getAttributeName() : $child->getAttributeRef();
- }
- foreach ($children as $child) {
- $this->parseChoiceChild($choice, $unionNames, $child, $struct);
- }
- unset($unionNames);
- protected function getComposerFileContent(): array
- {
- $content = [];
- $composerFilePath = $this->getComposerFilePath();
- if (!empty($composerFilePath)) {
- $content = json_decode(file_get_contents($composerFilePath), true);
- }
- return $content;
- }
- if (!$this->isKnownTypeUnknown($method)) {
- return;
- }
- $parts = $tag->getParts();
- $multipleParts = count($parts);
- if (is_array($parts) && $multipleParts > 1) {
- $types = [];
- foreach ($parts as $part) {
- if (!empty($type = $this->getTypeFromPart($part))) {
- $types[$part->getAttributeName()] = $type;
- protected function parseUnionStruct(array $typeDef): void
- {
- $typeDefCount = count($typeDef);
- if (3 === $typeDefCount) {
- $unionName = $typeDef[1];
- $unionTypes = array_filter(explode(',', $typeDef[2]), fn ($type) => !empty($type));
- sort($unionTypes);
- $this->getGenerator()->getStructs()->addUnionStruct($unionName, $unionTypes);
- }
- }