Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. RequireConstructorPropertyPromotionSniff.php

function RequireConstructorPropertyPromotionSniff::areTypeHintEqual

1 call to RequireConstructorPropertyPromotionSniff::areTypeHintEqual()
RequireConstructorPropertyPromotionSniff::process in vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireConstructorPropertyPromotionSniff.php
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint *

File

vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireConstructorPropertyPromotionSniff.php, line 349

Class

RequireConstructorPropertyPromotionSniff

Namespace

SlevomatCodingStandard\Sniffs\Classes

Code

private function areTypeHintEqual(?TypeHint $parameterTypeHint, ?TypeHint $propertyTypeHint) : bool {
    if ($parameterTypeHint === null && $propertyTypeHint === null) {
        return true;
    }
    if ($parameterTypeHint === null || $propertyTypeHint === null) {
        return false;
    }
    return $parameterTypeHint->getTypeHint() === $propertyTypeHint->getTypeHint();
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal