Clean up PHPCS Warnings

Created on 13 November 2022, about 2 years ago
Updated 15 August 2024, 3 months ago

Problem/Motivation

There are several PHPCS warnings/errors in the module. This patch cleans up the warnings and moves toward a dependency injection model. Many of the warnings stemmed from empty/missing comments.

Remaining tasks

This is just a start to moving towards using services and dependency injection.

This does not resolve (PHP compatibility) issues within the H5P library.

šŸ“Œ Task
Status

Needs work

Version

2.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
  • PHP 8.1

    The issue particularly affects sites running on PHP version 8.1.0 or later.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • šŸ‡µšŸ‡­Philippines cleavinjosh

    Hi @bbeversdorf,

    I applied patch #2, it was applied smoothly and fixed some pgpcs issues.

    āžœ  h5p git:(2.0.0-alpha2) curl https://www.drupal.org/files/issues/2022-11-13/3320992-Fixes-PHPCS-Issues.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  244k  100  244k    0     0  1239k      0 --:--:-- --:--:-- --:--:-- 1235k
    patching file README.md
    patching file css/h5p_drupal_custom.css
    patching file h5p.install
    patching file h5p.module
    patching file h5p.views.inc
    patching file modules/h5peditor/h5p.services.yml
    patching file modules/h5peditor/h5peditor.module
    patching file modules/h5peditor/src/Controller/H5PEditorAJAXController.php
    patching file modules/h5peditor/src/H5PEditor/H5PEditorDrupalAjax.php
    patching file modules/h5peditor/src/H5PEditor/H5PEditorDrupalStorage.php
    patching file modules/h5peditor/src/H5PEditor/H5PEditorUtilities.php
    patching file modules/h5peditor/src/Plugin/Field/FieldWidget/H5PEditorWidget.php
    patching file src/Controller/H5PAJAX.php
    patching file src/Controller/H5PContentUpgrade.php
    patching file src/Controller/H5PEmbed.php
    patching file src/Controller/H5PLibraryAdmin.php
    patching file src/Entity/H5PContent.php
    patching file src/Event/FinishedEvent.php
    patching file src/Form/H5PAdminSettingsForm.php
    patching file src/Form/H5PContentUpgradeForm.php
    patching file src/Form/H5PLibraryDeleteForm.php
    patching file src/Form/H5PLibraryUploadForm.php
    patching file src/H5PContentStorageSchema.php
    patching file src/H5PContentViewsData.php
    patching file src/H5PDrupal/H5PDrupal.php
    patching file src/H5PDrupal/H5PEvent.php
    patching file src/Plugin/Field/FieldFormatter/H5PDefaultFormatter.php
    patching file src/Plugin/Field/FieldType/H5PItem.php
    patching file src/Plugin/Field/FieldWidget/H5PUploadWidget.php
    patching file src/Plugin/Field/H5PWidgetBase.php
    patching file src/Plugin/views/access/H5PAccessUserPoints.php
    āžœ  h5p git:(2.0.0-alpha2) āœ—

    There are still many issues remaining after I ran phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml.

    I'll be attaching a screenshot for reference since it will be too long if I paste it all here.

    Thank you.

  • šŸ‡µšŸ‡­Philippines cleavinjosh
Production build 0.71.5 2024