getKind example

$this->error();
            
        }
        
        $this->scanner->setState($state);
        if ($property = $this->parseMethodDefinition()) {

            $node = $this->createNode("Property", $property);
            $node->setKey($property->getKey());
            $node->setValue($property->getValue());
            $node->setComputed($property->getComputed());
            $kind = $property->getKind();
            if ($kind !== Node\MethodDefinition::KIND_GET &&
                $kind !== Node\MethodDefinition::KIND_SET
            ) {
                $node->setMethod(true);
                $node->setKind(Node\Property::KIND_INIT);
            } else {
                $node->setKind($kind);
            }
            return $this->completeNode($node);
            
        } elseif ($key = $this->parseIdentifier(static::$identifierReference)) {
            
            

            break;
            case "MetaProperty":
                $code .= $node->getMeta() . "." . $node->getProperty();
            break;
            case "MethodDefinition":
                if ($node->getStatic()) {
                    $code .= "static ";
                }
                $value = $node->getValue();
                $key = $node->getKey();
                $kind = $node->getKind();
                if ($kind === $node::KIND_GET || $kind === $node::KIND_SET) {
                    $code .= $kind . " ";
                } else {
                    if ($value->getAsync()) {
                        $code .= "async ";
                    }
                    if ($value->getGenerator()) {
                        $code .= "*" .
                                 $this->renderOpts->sao;
                    }
                }
                
public static function castCTypeOrCData(CData|CType $data, array $args, Stub $stub): array
    {
        if ($data instanceof CType) {
            $type = $data;
            $data = null;
        } else {
            $type = \FFI::typeof($data);
        }

        $stub->class = sprintf('%s<%s> size %d align %d', ($data ?? $type)::class$type->getName()$type->getSize()$type->getAlignment());

        return match ($type->getKind()) {
            CType::TYPE_FLOAT,
            CType::TYPE_DOUBLE,
            \defined('\FFI\CType::TYPE_LONGDOUBLE') ? CType::TYPE_LONGDOUBLE : -1,
            CType::TYPE_UINT8,
            CType::TYPE_SINT8,
            CType::TYPE_UINT16,
            CType::TYPE_SINT16,
            CType::TYPE_UINT32,
            CType::TYPE_SINT32,
            CType::TYPE_UINT64,
            CType::TYPE_SINT64,
            
/** @var Detail $variant */
        $variant = $this->getDetailRepository()->find($id);
        if (!\is_object($variant)) {
            $this->View()->assign([
                'success' => false,
            ]);
        } else {
            $articleResource = new ArticleResource();
            $articleResource->setManager($this->get(ModelManager::class));

            if ($variant->getKind() == 1) {
                $articleResource->delete($variant->getArticle()->getId());
            } else {
                $this->get('models')->remove($variant);
            }

            $this->get('models')->flush();

            $this->View()->assign([
                'success' => true,
            ]);
        }
    }
if (empty($id)) {
            throw new ParameterMissingException('id');
        }

        $productVariant = $this->getRepository()->find($id);

        if (!$productVariant instanceof Detail) {
            throw new NotFoundException(sprintf('Variant by id %d not found', $id));
        }

        if ($productVariant->getKind() === 1) {
            $productVariant->getArticle()->setMainDetail(null);
        }

        $this->getManager()->remove($productVariant);
        $this->flush();

        return $productVariant;
    }

    /** * Convenience method to update a variant by number * * @param string $number * * @return Detail */
return $this;
    }
    
    /** * Returns the comment raw text * * @return string */
    public function getRawText()
    {
        $text = $this->getText();
        $kind = $this->getKind();

        if ($kind === self::KIND_MULTILINE) {
            $sanitize = "*/";
        } else {
            $sanitize = array("\n", "\r");
        }
        $text = str_replace($sanitize, "", $text);
        
        if ($kind === self::KIND_INLINE) {
            return "//" . $text;
        } elseif ($kind === self::KIND_HASHBANG) {
            
$oldOptions = $configuratorSet->getOptions();
        $ids = [];
        foreach ($oldOptions as $oldOption) {
            if (!\array_key_exists($oldOption->getId()$selectedOptions)) {
                $details = $this->getRepository()
                    ->getArticleDetailByConfiguratorOptionIdQuery($article->getId()$oldOption->getId())
                    ->setHydrationMode(AbstractQuery::HYDRATE_OBJECT)
                    ->getResult();

                if (!empty($details)) {
                    foreach ($details as $detail) {
                        if ($detail->getKind() === 1) {
                            $article->setMainDetail(null);
                        }
                        $ids[] = $detail->getId();
                        $this->get('models')->remove($detail);
                    }
                    $this->get('models')->flush();
                }
            }
        }

        if (!empty($ids)) {
            
public static function castCTypeOrCData(CData|CType $data, array $args, Stub $stub): array
    {
        if ($data instanceof CType) {
            $type = $data;
            $data = null;
        } else {
            $type = \FFI::typeof($data);
        }

        $stub->class = sprintf('%s<%s> size %d align %d', ($data ?? $type)::class$type->getName()$type->getSize()$type->getAlignment());

        return match ($type->getKind()) {
            CType::TYPE_FLOAT,
            CType::TYPE_DOUBLE,
            \defined('\FFI\CType::TYPE_LONGDOUBLE') ? CType::TYPE_LONGDOUBLE : -1,
            CType::TYPE_UINT8,
            CType::TYPE_SINT8,
            CType::TYPE_UINT16,
            CType::TYPE_SINT16,
            CType::TYPE_UINT32,
            CType::TYPE_SINT32,
            CType::TYPE_UINT64,
            CType::TYPE_SINT64,
            
Home | Imprint | This part of the site doesn't use cookies.