Php 参数$parameters的文档注释与| |实际变量名$resource不匹配

Php 参数$parameters的文档注释与| |实际变量名$resource不匹配,php,symfony,Php,Symfony,当我试图推动我的工作时,我犯了这个错误。。我在注释中写入参数。。。在codfe中,我编写了多个函数内容参数和资源,以及选项和所有类型。这些参数是数组,也包括内容类型参数int 代码处理程序: <?php namespace AppBundle\Handler; use AppBundle\Entity\University; use AppBundle\Form\UniversityType; use Symfony\Component\HttpFoundation\RequestS

当我试图推动我的工作时,我犯了这个错误。。我在注释中写入参数。。。在codfe中,我编写了多个函数内容参数和资源,以及选项和所有类型。这些参数是数组,也包括内容类型参数int

代码处理程序:

<?php

namespace AppBundle\Handler;

use AppBundle\Entity\University;
use AppBundle\Form\UniversityType;
use Symfony\Component\HttpFoundation\RequestStack;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Form\formFactory;

/**
 * UniversityHandler.
 */
class UniversityHandler implements HandlerInterface
{
    /**
     *function construct.
     *
     * @param EntityManagerInterface $entityManager
     * @param formFactory            $formFactory
     * @param RequestStack           $requestStack
     */
    public function __construct(EntityManagerInterface $entityManager, formFactory $formFactory, RequestStack $requestStack)
    {
        $this->em = $entityManager;
        $this->formFactory = $formFactory;
        $this->requestStack = $requestStack;
    }

    /**
     *function get.
     *
     * @param int $id
     */
    public function get($id)
    {
        throw new \DomainException('Method UniversitaireHandler::get not implemented');
    }

    /**
     *function all.
     *
     * @param int $limit
     * @param int $offset
     */
    public function all($limit = 10, $offset = 0)
    {
        throw new \DomainException('Method UniversitaireHandler::all not implemented');
    }

    /**
     *function post.
     *
     * @param array $parameters
     * @param array $options
     *
     * @return \Symfony\Component\Form\Form The form
     */
    public function post(array $parameters, array $options = [])
    {
        $request = $this->requestStack->getCurrentRequest();
        $form = $this->formFactory->create(UniversityType::class, new University(), array('csrf_protection' => 'false'));
        $form->handleRequest($request);
        if ($form->isValid() && $form->isSubmitted()) {
            $universitaire = $form->getData();
            $this->persistAndFlush($universitaire);

            return $universitaire;
        }

        return $form;
    }

    /**
     *function put.
     *
     * @param array $parameters
     * @param array $options
     * @param array $resource
     */
    public function put($resource, array $parameters, array $options)
    {
        throw new \DomainException('Method UniversitaireHandler::put not implemented');
    }

    /**
     *function patch.
     *
     * @param array $parameters
     * @param array $options
     * @param array $resource
     */
    public function patch($resource, array $parameters, array $options)
    {
        throw new \DomainException('Method UniversitaireHandler::patch not implemented');
    }

    /**
     *function delete.
     *
     * @param array $resource
     */
    public function delete($resource)
    {
        throw new \DomainException('Method UniversitaireHandler::delete not implemented');
    }

    /**
     *function persisteAndFlush.
     */
    protected function persistAndFlush($object)
    {
        $this->em->persist($object);
        $this->em->flush();
    }
}

您看到一个PHP代码嗅探器错误,它会因为您违反了组织的代码风格准则而给您带来错误。您的代码失败的原因

本质上,它希望您重新排列PHPDoc注释,以与方法签名中的参数对齐:

/**
 * function put.
 *
 * @param array $parameters
 * @param array $options
 * @param array $resource
 */
public function put($resource, array $parameters, array $options)
应重新安排为:

/**
 * function put.
 *
 * @param array $resource
 * @param array $parameters
 * @param array $options
 */
public function put($resource, array $parameters, array $options)