Fix cspell, phpstan

Created on 12 February 2025, about 2 months ago

Problem/Motivation

Fix cspell, phpstan

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Version

1.0

Component

Code (posthog)

Created by

🇩🇪Germany Anybody Porta Westfalica

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @Anybody
  • 🇩🇪Germany Anybody Porta Westfalica

    Phpstan:

    ddev phpstan
     30/30 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
    
     ------ --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
      Line   modules/posthog_eca/src/Plugin/Action/PosthogEvent.php
     ------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      19     Class Drupal\posthog_eca\Plugin\Action\PosthogEvent extends unknown class Drupal\eca\Plugin\Action\ConfigurableActionBase.
             💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
      53     Drupal\posthog_eca\Plugin\Action\PosthogEvent::create() calls parent::create() but Drupal\posthog_eca\Plugin\Action\PosthogEvent does not extend any class.
      68     Drupal\posthog_eca\Plugin\Action\PosthogEvent::defaultConfiguration() calls parent::defaultConfiguration() but Drupal\posthog_eca\Plugin\Action\PosthogEvent does not extend any class.
      77     Call to an undefined method Drupal\posthog_eca\Plugin\Action\PosthogEvent::t().
      78     Call to an undefined method Drupal\posthog_eca\Plugin\Action\PosthogEvent::t().
      79     Access to an undefined property Drupal\posthog_eca\Plugin\Action\PosthogEvent::$configuration.
             💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
      84     Call to an undefined method Drupal\posthog_eca\Plugin\Action\PosthogEvent::t().
      85     Call to an undefined method Drupal\posthog_eca\Plugin\Action\PosthogEvent::t().
      88     Access to an undefined property Drupal\posthog_eca\Plugin\Action\PosthogEvent::$configuration.
             💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
      100    Call to an undefined method Drupal\posthog_eca\Plugin\Action\PosthogEvent::t().
      103    Drupal\posthog_eca\Plugin\Action\PosthogEvent::buildConfigurationForm() calls parent::buildConfigurationForm() but Drupal\posthog_eca\Plugin\Action\PosthogEvent does not extend any class.
      110    Drupal\posthog_eca\Plugin\Action\PosthogEvent::validateConfigurationForm() calls parent::validateConfigurationForm() but Drupal\posthog_eca\Plugin\Action\PosthogEvent does not extend any class.
      118    Call to an undefined method Drupal\posthog_eca\Plugin\Action\PosthogEvent::t().
      128    Access to an undefined property Drupal\posthog_eca\Plugin\Action\PosthogEvent::$configuration.
             💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
      130    Drupal\posthog_eca\Plugin\Action\PosthogEvent::submitConfigurationForm() calls parent::submitConfigurationForm() but Drupal\posthog_eca\Plugin\Action\PosthogEvent does not extend any class.
      149    Access to an undefined property Drupal\posthog_eca\Plugin\Action\PosthogEvent::$configuration.
             💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
     ------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
     ------ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      Line   modules/posthog_feature_flags/src/Plugin/Condition/PosthogFeatureFlags.php
     ------ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      35     Parameter $posthogUserHelper of method Drupal\posthog_feature_flags\Plugin\Condition\PosthogFeatureFlags::__construct() has invalid type Drupal\posthog_feature_flags\Plugin\Condition\UserHelper.
      35     Property Drupal\posthog_feature_flags\Plugin\Condition\PosthogFeatureFlags::$posthogUserHelper has unknown class Drupal\posthog_feature_flags\Plugin\Condition\UserHelper as its type.
             💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
     ------ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
     ------ -----------------------------------------------------------------------------------
      Line   modules/posthog_php/src/Sdk.php
     ------ -----------------------------------------------------------------------------------
      33     Access to constant VERSION on an unknown class PostHog\PostHog.
             💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
      46     Call to static method init() on an unknown class PostHog\PostHog.
             💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
      66     Call to static method identify() on an unknown class PostHog\PostHog.
             💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
      91     Call to static method groupIdentify() on an unknown class PostHog\PostHog.
             💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
      107    Call to static method isFeatureEnabled() on an unknown class PostHog\PostHog.
             💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
      117    Call to static method getFeatureFlag() on an unknown class PostHog\PostHog.
             💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
      127    Call to static method getAllFlags() on an unknown class PostHog\PostHog.
             💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
      137    Call to static method fetchFeatureVariants() on an unknown class PostHog\PostHog.
             💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
      151    Call to static method alias() on an unknown class PostHog\PostHog.
             💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
      169    Call to static method raw() on an unknown class PostHog\PostHog.
             💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
      179    Call to static method validate() on an unknown class PostHog\PostHog.
             💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
      189    Call to static method flush() on an unknown class PostHog\PostHog.
             💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
      214    Call to static method capture() on an unknown class PostHog\PostHog.
             💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
     ------ -----------------------------------------------------------------------------------
    

    CSPELL:

    modules/posthog_cookies/js/posthog_cookies.js:38:34     - Unknown word (cookiesjsr) -- document.addEventListener('cookiesjsrUserConsent', function
    	 Suggestions: [cookies, cookie's]
    modules/posthog_cookies/tests/src/FunctionalJavascript/PosthogCookiesFunctionalJavascriptTest.php:87:49     - Unknown word (cookiesjsr) -- ispatchEvent(new CustomEvent('cookiesjsrSetService', { detail
    	 Suggestions: [cookies, cookie's]
    modules/posthog_cookies/tests/src/FunctionalJavascript/PosthogCookiesFunctionalJavascriptTest.php:151:52    - Unknown word (cookiesjsr) -- ispatchEvent(new CustomEvent('cookiesjsrSetService', { detail
    	 Suggestions: [cookies, cookie's]
    modules/posthog_cookies/tests/src/FunctionalJavascript/PosthogCookiesFunctionalJavascriptTest.php:207:49    - Unknown word (cookiesjsr) -- ispatchEvent(new CustomEvent('cookiesjsrSetService', { detail
    	 Suggestions: [cookies, cookie's]
    modules/posthog_js/src/Form/SettingsForm.php:105:34    - Unknown word (autocapture) -- placeholder' => "{\n  // autocapture: true,\n  // capture
    	 Suggestions: []
    modules/posthog_php/src/Form/SettingsForm.php:38:71     - Unknown word (usind)      -- identifying users on login, usind the users distinct id
    	 Suggestions: [using, USING, sind, Sind, suid]
    modules/posthog_php/src/Sdk.php:24:16     - Unknown word (initalized) -- protected $initalized = FALSE,
    	 Suggestions: [initialized, initialize, initializer, Initialize, INITIALIZE]
    modules/posthog_php/src/Sdk.php:40:16     - Unknown word (initalized) -- if ($this->initalized) {
    	 Suggestions: [initialized, initialize, initializer, Initialize, INITIALIZE]
    modules/posthog_php/src/Sdk.php:49:12     - Unknown word (initalized) -- $this->initalized = TRUE;
    	 Suggestions: [initialized, initialize, initializer, Initialize, INITIALIZE]
    modules/posthog_php/src/Sdk.php:56:17     - Unknown word (initalized) -- if (!$this->initalized) {
    	 Suggestions: [initialized, initialize, initializer, Initialize, INITIALIZE]
    modules/posthog_php/src/Sdk.php:80:17     - Unknown word (initalized) -- if (!$this->initalized) {
    	 Suggestions: [initialized, initialize, initializer, Initialize, INITIALIZE]
    src/Form/SettingsForm.php:94:184    - Unknown word (emmited)    -- indirectly make all emmited events "anonymous" and
    	 Suggestions: [emptied, merited, emoted, emitted, edited]
    src/UserAttributesProvider.php:12:21     - Unknown word (uesr)       -- * Provides posthog uesr properties.
    	 Suggestions: [user, ussr, USSR, usr, esr]
    CSpell: Files checked: 83, Issues found: 13 in 7 files.
    $ WORDS_FILE=_cspell_unrecognized_words.txt
    $ UPDATED_PROJECT_DICTIONARY=_cspell_updated_project_words.txt
    $ touch $_CSPELL_DICTIONARY $WORDS_FILE $UPDATED_PROJECT_DICTIONARY
    $ if [ "$EXIT_CODE" != "" ]; then # collapsed multi-line command
    CSpell: Files checked: 84, Issues found: 13 in 7 files.
    The number of distinct unrecognised/misspelled words is 6
    ------------
    autocapture
    cookiesjsr
    emmited
    initalized
    uesr
    usind
    ------------
    
  • 🇩🇪Germany Anybody Porta Westfalica

    Cspell fixed, I think. PHPCS is a bit more work.

  • Merge request !21Resolve #3506211 "Fix cspell phpstan" → (Merged) created by Anybody
  • First commit to issue fork.
  • 🇩🇪Germany lrwebks Porta Westfalica
  • 🇩🇪Germany lrwebks Porta Westfalica
  • 🇩🇪Germany Grevil

    Changes LGTM! Pipeline is completely green! Merging.

  • Pipeline finished with Skipped
    about 2 months ago
    #426531
  • 🇩🇪Germany Anybody Porta Westfalica
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024