Verified Commit ff6f9dfa authored by Vitor Barbosa de Souza's avatar Vitor Barbosa de Souza Committed by Bill Seremetis
Browse files

Issue #3310754 by vitorbs, christyanpaim, bserem: Fix PHP Stan errors

parent 7a3f9e25
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ class AdminFeedbackController extends ControllerBase {
   * @param \Symfony\Component\HttpFoundation\RequestStack $requestStack
   * @param \Drupal\Core\Language\LanguageManagerInterface $languageManager
   */
  public function __construct(Connection $database, RequestStack $requestStack, LanguageManagerInterface $languageManager, EventDispatcherInterface $eventDispatcher) {
  final public function __construct(Connection $database, RequestStack $requestStack, LanguageManagerInterface $languageManager, EventDispatcherInterface $eventDispatcher) {
    $this->database = $database;
    $this->requestStack = $requestStack->getCurrentRequest();
    $this->langcode = $languageManager->getCurrentLanguage()->getId();
+1 −1
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ class AdminFeedbackAjaxForm extends FormBase {
  /**
   * Construct an AdminFeedbackController object.
   */
  public function __construct(Connection $database, RequestStack $requestStack, LanguageManagerInterface $languageManager, EventDispatcherInterface $eventDispatcher) {
  final public function __construct(Connection $database, RequestStack $requestStack, LanguageManagerInterface $languageManager, EventDispatcherInterface $eventDispatcher) {
    $this->database = $database;
    $this->requestStack = $requestStack;
    $this->languageManager = $languageManager;
+26 −2
Original line number Diff line number Diff line
@@ -7,7 +7,8 @@ use Drupal\Core\Database\Database;
use Drupal\Core\Form\ConfirmFormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url;
use Drupal\image\ImageStyleInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
 * Form for deleting a feedback response.
@@ -23,6 +24,29 @@ class AdminFeedbackDeleteForm extends ConfirmFormBase {
   */
  protected $feedbackId;

    /**
   * The entity type manager.
   *
   * @var \Drupal\Core\Entity\EntityTypeManagerInterface
   */
  protected $entityTypeManager;

  /**
   * Constructs a new VariantPluginFormBase.
   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager
   *   The entity type manager service.
   */
  final public function __construct(EntityTypeManagerInterface $entityTypeManager) {
    $this->entityTypeManager = $entityTypeManager;
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container) {
    return new static($container->get('entity_type.manager'));
  }

  /**
   * {@inheritdoc}
   */
@@ -82,7 +106,7 @@ class AdminFeedbackDeleteForm extends ConfirmFormBase {

    // Get and update feedback score details for node and language.
    if (isset($nid) && isset($feedback_type)) {
      $node = \Drupal::service('entity_type.manager')->getStorage('node')->load($nid);
      $node = $this->entityTypeManager->getStorage('node')->load($nid);
      $query = $connection->select('admin_feedback_score', 'admin_feedback_score')
        ->fields('admin_feedback_score', ['id', 'count', 'yes_count', 'no_count', 'total_score'])
        ->condition('admin_feedback_score.nid', $nid, '=')
+1 −1
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ class AdminFeedbackBlock extends BlockBase implements ContainerFactoryPluginInte
   * @param \Drupal\Core\Routing\CurrentRouteMatch $routeMatch
   * @param \Drupal\Core\Form\FormBuilder $builder
   */
  public function __construct(array $configuration, $plugin_id, $plugin_definition, ConfigFactoryInterface $configFactory, CurrentRouteMatch $routeMatch, FormBuilder $builder) {
  final public function __construct(array $configuration, $plugin_id, $plugin_definition, ConfigFactoryInterface $configFactory, CurrentRouteMatch $routeMatch, FormBuilder $builder) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
    $this->configFactory = $configFactory;
    $this->routeMatch = $routeMatch;