Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jigish.addweb created an issue. See original summary.

jigish.addweb’s picture

StatusFileSize
new6.67 KB

Here's the patch that resolves the error that mentioned above.

oknate’s picture

Status: Active » Postponed (maintainer needs more info)

The patch changes many things that shouldn't be changed. Closing for now.

oknate’s picture

Title: README.txt does not follow best practices » Coding standards fixes
Assigned: jigish.addweb » Unassigned
Issue summary: View changes
Status: Postponed (maintainer needs more info) » Needs work
Issue tags: +Novice
oknate’s picture

Issue summary: View changes
oknate’s picture

Re-opening. I see a bunch of "Line exceeds 80 characters" warnings.

I haven't looked closely at the lines in question. I think these were missed because of the way I was linting the code, it was only fixing the ones it could automatically fix, using phpcbf, rather than just outputting a report using phpcs.

Once we fix these, I'll check the code base regularly with phpcs before committing code.

joshi.rohit100’s picture

Issue tags: +#DCD19

Adding for DCD-2019 code sprint.

willtryagain’s picture

Assigned: Unassigned » willtryagain
willtryagain’s picture

Assigned: willtryagain » Unassigned
sushyl’s picture

Issue tags: -#DCD19
otrolopezmas’s picture

Status: Needs work » Needs review
StatusFileSize
new22.17 KB

Ran codesniffer and fixed all issues I found. I solved some of the comment lines, that were longer than 80 character, reducing the first line to an anecdotal version and then inserting the full comment in the following lines, where it's allowed to have multiple lines.

Status: Needs review » Needs work

The last submitted patch, 11: 3036556-11.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

otrolopezmas’s picture

Tests are failing because of parent classes argument hints. Is there a way to fix this? Or this issue needs to be in standby until core is fixed?

nikitagupta’s picture

Assigned: Unassigned » nikitagupta
nikitagupta’s picture

Assigned: nikitagupta » Unassigned
Status: Needs work » Needs review
StatusFileSize
new25.33 KB
new8.69 KB

Update the patch #11 also fixed the test case.

nmatja’s picture

StatusFileSize
new46.61 KB
new32.46 KB

Updated the patch #15.

guilhermevp’s picture

Assigned: Unassigned » guilhermevp
guilhermevp’s picture

Assigned: guilhermevp » Unassigned
StatusFileSize
new38.22 KB

Sending patch. Testing with phpcs will not return a clean state because some changes would result in worst readability. This patch has no interdiff, but is a sudo-reroll of #16

anabpv’s picture

Assigned: Unassigned » anabpv

I will review this

anabpv’s picture

Assigned: anabpv » Unassigned
StatusFileSize
new74.14 KB

I ran Code Sniffer and Code Beautify and fixed:
- 80 characters lines
- Dependency injections
- Access restriction comment
- Unused variables
- t() calls avoidance
- trigger_error for the deprecated method
- Doc comments
- @see message

Awaiting for review.

Thank you!

tmaiochi’s picture

Assigned: Unassigned » tmaiochi

I'll review this.

anabpv’s picture

StatusFileSize
new74.14 KB

Apologies, I had a syntax error in the patch #20.
Hopefully this new one is correct.

Thank you

anabpv’s picture

StatusFileSize
new74.14 KB

Update of patch #22 (another syntax error)

anabpv’s picture

StatusFileSize
new74.14 KB

Update of patch #23 (another syntax error)

tmaiochi’s picture

Assigned: tmaiochi » Unassigned
Status: Needs review » Reviewed & tested by the community

Steps performed:
(1) Installed module
(2) Reproduced the issue.
(3) Applied patch.
(4) Code review on changes.
(5) Tested again with patch, issue resolved.
The patch #24 correctly applied all coding standards.

avpaderno’s picture

Title: Coding standards fixes » Fix the issues reported by phpcs
Category: Bug report » Task
Priority: Normal » Minor
Issue tags: -Novice +Coding standards

I am not sure why only the Drupal ruleset is used, when there is also the DrupalPractice ruleset.

avpaderno’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll
kaustab_roy’s picture

Assigned: Unassigned » kaustab_roy
avpaderno’s picture

Assigned: kaustab_roy » Unassigned

Issues should be assigned to somebody who creates a patch or a MR in the next hours, not after more than 12 hours. This means blocking an issue for which somebody else could have worked on.

sakthi_dev’s picture

StatusFileSize
new82.85 KB

Created a patch after verifying with DrupalPractice ruleset with . Please review.

avpaderno’s picture

Issue tags: -Needs reroll
  * @addtogroup hooks
- * @{

The last line is necessary and it should not be removed.

 /**
- * Alter the information provided in \Drupal\entity_browser\Annotation\EntityBrowserDisplay.
+ * Alter the information provided in.
+ *
+ * \Drupal\entity_browser\Annotation\EntityBrowserDisplay.

Short descriptions cannot be split like that.
Alter must use the third person singular.

- * TODO see if we can get away without overriding entire IEF function.
+ * @todo see if we can get away without overriding entire IEF function.

What follows @todo is a sentence: It starts with a capitalized word and ends with a period (preferable), a question mark, or an exclamation mark.

 /**
- * AJAX command to rerender a formatted text field without any transformation
- * filters.
+ * AJAX command to rerender a formatted text without transformation filters.
  */

I am not sure that removing field is correct. The existing comment is about a field, while the changed comment is about a formatted text (which is not a field).

   /**
-   * The ID for the details element.
+   * Details element ID.

That description is missing a definite article.

 /**
- * Class EntityBrowserEditForm.
+ * Entity browser edit form class.
  */
 class EntityBrowserEditForm extends EntityForm {

That description does not say what the class does.

-    if ($storage = $this->selectionStorage->get($form_state->get(['entity_browser', 'instance_uuid']))) {
+    if ($storage = $this->selectionStorage->get($form_state->get([
+      'entity_browser',
+      'instance_uuid',
+    ]))) {

As per Drupal coding standards, control structure conditions can be written on a single line, if they are more readable. In this case, the existing code is more readable.

-  /**
-   * {@inheritdoc}
-   */
-  public function displayEntityBrowser(array $element, FormStateInterface $form_state, array &$complete_form, array $persistent_data = []) {
-    parent::displayEntityBrowser($element, $form_state, $complete_form, $persistent_data);
-    // @TODO Implement it.
-  }
-
   /**
    * {@inheritdoc}
    */
   public function selectionCompleted(array $entities) {
-    // @TODO Implement it.
+    // @todo Implement it.
   }

The first method cannot be removed, exactly for the same reason the other one has not been removed: It contains a @todo tag.

+  /**
+   * Turns a render array into an HTML string.
+   *
+   * @var Drupal\Core\Render\RendererInterface
+   */
+  public $renderer;

That description says for what that property is used; it needs to say what that property contains.

+  /**
+   * Constructs a new View object.
+   *

The description for a constructor must start with Constructs a new followed by the class name (including its namespace), and end with object.

+   * @param string $plugin_id
+   *   The plugin_id for the plugin instance.

plugin_id is not an English word.
It is not necessary to say for the plugin instance, since that is a plugin ID.

+   * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher
+   *   Event dispatcher service.

The description is missing a definite article.

+   * @param \Drupal\entity_browser\WidgetValidationManager $validation_manager
+   *   The Widget Validation Manager service.

Only the first word in the description must be capitalized.
There is no need to say service.

+   * @param Drupal\Core\Render\RendererInterface $renderer
+   *   Turns a render array into an HTML string.

That is not the description of what $render contains.

+    /*
+     * @deprecated and removed in entity_browser:8.x-2.2.
+     *   Use ::supportsPreselection instead.
+     *   @see
+     */

@deprecated must be added to the method documentation comment, not inside the method.

+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   Drupal form_state.

There is no need to say Drupal.
form_state is not an English word.

-  protected $widgets_ids;
+  protected $widgetsIds;
 
   /**
    * ID of the default widget.
@@ -40,7 +40,7 @@ abstract class WidgetSelectorBase extends PluginBase implements WidgetSelectorIn
   public function __construct($configuration, $plugin_id, $plugin_definition) {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->setConfiguration($configuration);
-    $this->widget_ids = isset($this->configuration['widget_ids']) ? $this->configuration['widget_ids'] : [];
+    $this->widget_ids = isset($this->configuration['widget_ids']) ?? [];

Since the property name has been changed, $this->widget_ids is setting the wrong property.

roshni27’s picture

Issue summary: View changes
imustakim’s picture

Assigned: Unassigned » imustakim
imustakim’s picture

Assigned: imustakim » Unassigned
Status: Needs work » Needs review
StatusFileSize
new23.81 KB
new94.6 KB

As per suggestions by @apaderno, Changes have been made, and to address some of the concern mentioned in #31, only these errors are remaining.
Assuming these can be ignored. Rest of the errors are fixed.
Patch is updated, please review.

FILE: /Users/specbee/Sites/Projects/entity_browser/src/Form/EntityBrowserForm.php
---------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------------
 131 | ERROR | The array declaration extends to column 100 (the limit is 80). The array content should be split up over multiple lines
---------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/entity_browser/src/Plugin/EntityBrowser/Widget/View.php
-------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------
 41 | WARNING | Line exceeds 80 characters; contains 85 characters
-------------------------------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/entity_browser/src/Plugin/EntityBrowser/Display/Standalone.php
--------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------
 48 | WARNING | Possible useless method overriding detected
--------------------------------------------------------------------------------------------------

Time: 3.16 secs; Memory: 18MB

Status: Needs review » Needs work

The last submitted patch, 34: phpcs-3036556-34.patch, failed testing. View results

Shank115 made their first commit to this issue’s fork.

Shreyas gowda’s picture

StatusFileSize
new84.51 KB

nitin_lama made their first commit to this issue’s fork.

shruu_rao’s picture

Hi,
I tried applying #37 patch. The patch throws

error: corrupt patch at line 16

Please check.

silvi.addweb’s picture

Status: Needs work » Needs review
StatusFileSize
new82.36 KB

Fixed the issues reported by phpcs.

cleavinjosh’s picture

Hi,

I applied the patch #40 and verified that the issues reported by phpcs are fixed.

 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 84340  100 84340    0     0   168k      0 --:--:-- --:--:-- --:--:--  168k
Checking patch entity_browser.api.php...
Checking patch entity_browser.module...
Checking patch entity_browser.views.inc...
Checking patch modules/entity_form/entity_browser_entity_form.module...
Checking patch modules/entity_form/src/Plugin/EntityBrowser/Widget/EntityForm.php...
Checking patch src/Ajax/SelectEntitiesCommand.php...
Checking patch src/Ajax/ValueUpdatedCommand.php...
Checking patch src/Controllers/EntityBrowserController.php...
Checking patch src/Controllers/EntityBrowserFormController.php...
Checking patch src/Controllers/EntityBrowserListBuilder.php...
Checking patch src/DisplayBase.php...
Checking patch src/DisplayInterface.php...
Checking patch src/Element/EntityBrowserElement.php...
Checking patch src/Entity/EntityBrowser.php...
Checking patch src/EntityBrowserInterface.php...
Checking patch src/Events/AlterEntityBrowserDisplayData.php...
Checking patch src/Events/EntitySelectionEvent.php...
Checking patch src/Events/EventBase.php...
Checking patch src/Events/Events.php...
Checking patch src/Events/RegisterJSCallbacks.php...
Checking patch src/Form/EntityBrowserEditForm.php...
Checking patch src/Form/EntityBrowserForm.php...
Checking patch src/Plugin/EntityBrowser/Display/Modal.php...
Checking patch src/Plugin/EntityBrowser/Display/Standalone.php...
Checking patch src/Plugin/EntityBrowser/FieldWidgetDisplay/ImageThumbnail.php...
Checking patch src/Plugin/EntityBrowser/FieldWidgetDisplay/RenderedEntity.php...
Checking patch src/Plugin/EntityBrowser/SelectionDisplay/MultiStepDisplay.php...
Checking patch src/Plugin/EntityBrowser/SelectionDisplay/View.php...
Checking patch src/Plugin/EntityBrowser/Widget/Upload.php...
Checking patch src/Plugin/EntityBrowser/Widget/View.php...
Checking patch src/Plugin/EntityBrowser/WidgetSelector/DropDown.php...
Checking patch src/Plugin/EntityBrowser/WidgetSelector/Single.php...
Checking patch src/Plugin/EntityBrowser/WidgetSelector/Tabs.php...
Checking patch src/Plugin/Field/FieldWidget/EntityReferenceBrowserWidget.php...
Checking patch src/Plugin/Field/FieldWidget/FileBrowserWidget.php...
Checking patch src/Plugin/views/display/EntityBrowser.php...
Checking patch src/Plugin/views/field/SelectForm.php...
Checking patch src/Plugin/views/filter/ContextualBundle.php...
Checking patch src/RouteSubscriber.php...
Checking patch src/SelectionDisplayBase.php...
Checking patch src/SelectionDisplayInterface.php...
Checking patch src/WidgetBase.php...
Checking patch src/WidgetInterface.php...
Checking patch src/WidgetSelectorBase.php...
Checking patch tests/modules/entity_browser_test/entity_browser_test.routing.yml...
Checking patch tests/modules/entity_browser_test/src/Form/FormElementTest.php...
Checking patch tests/modules/entity_browser_test/src/Plugin/EntityBrowser/Widget/DummyWidget.php...
Checking patch tests/src/Functional/EntityBrowserUITest.php...
Checking patch tests/src/Functional/FormElementTest.php...
Checking patch tests/src/FunctionalJavascript/CardinalityTest.php...
Checking patch tests/src/FunctionalJavascript/ConfigurationTest.php...
Checking patch tests/src/FunctionalJavascript/EntityBrowserTest.php...
Checking patch tests/src/FunctionalJavascript/EntityBrowserViewsWidgetTest.php...
Checking patch tests/src/FunctionalJavascript/EntityBrowserWebDriverTestBase.php...
Checking patch tests/src/FunctionalJavascript/EntityReferenceWidgetTest.php...
Checking patch tests/src/FunctionalJavascript/FieldWidgetConfigTest.php...
Checking patch tests/src/FunctionalJavascript/InlineEntityFormTest.php...
Checking patch tests/src/FunctionalJavascript/ParagraphsTest.php...
Checking patch tests/src/FunctionalJavascript/PluginsTest.php...
Checking patch tests/src/Kernel/Plugin/FieldWidgetDisplayTest.php...
Applied patch entity_browser.api.php cleanly.
Applied patch entity_browser.module cleanly.
Applied patch entity_browser.views.inc cleanly.
Applied patch modules/entity_form/entity_browser_entity_form.module cleanly.
Applied patch modules/entity_form/src/Plugin/EntityBrowser/Widget/EntityForm.php cleanly.
Applied patch src/Ajax/SelectEntitiesCommand.php cleanly.
Applied patch src/Ajax/ValueUpdatedCommand.php cleanly.
Applied patch src/Controllers/EntityBrowserController.php cleanly.
Applied patch src/Controllers/EntityBrowserFormController.php cleanly.
Applied patch src/Controllers/EntityBrowserListBuilder.php cleanly.
Applied patch src/DisplayBase.php cleanly.
Applied patch src/DisplayInterface.php cleanly.
Applied patch src/Element/EntityBrowserElement.php cleanly.
Applied patch src/Entity/EntityBrowser.php cleanly.
Applied patch src/EntityBrowserInterface.php cleanly.
Applied patch src/Events/AlterEntityBrowserDisplayData.php cleanly.
Applied patch src/Events/EntitySelectionEvent.php cleanly.
Applied patch src/Events/EventBase.php cleanly.
Applied patch src/Events/Events.php cleanly.
Applied patch src/Events/RegisterJSCallbacks.php cleanly.
Applied patch src/Form/EntityBrowserEditForm.php cleanly.
Applied patch src/Form/EntityBrowserForm.php cleanly.
Applied patch src/Plugin/EntityBrowser/Display/Modal.php cleanly.
Applied patch src/Plugin/EntityBrowser/Display/Standalone.php cleanly.
Applied patch src/Plugin/EntityBrowser/FieldWidgetDisplay/ImageThumbnail.php cleanly.
Applied patch src/Plugin/EntityBrowser/FieldWidgetDisplay/RenderedEntity.php cleanly.
Applied patch src/Plugin/EntityBrowser/SelectionDisplay/MultiStepDisplay.php cleanly.
Applied patch src/Plugin/EntityBrowser/SelectionDisplay/View.php cleanly.
Applied patch src/Plugin/EntityBrowser/Widget/Upload.php cleanly.
Applied patch src/Plugin/EntityBrowser/Widget/View.php cleanly.
Applied patch src/Plugin/EntityBrowser/WidgetSelector/DropDown.php cleanly.
Applied patch src/Plugin/EntityBrowser/WidgetSelector/Single.php cleanly.
Applied patch src/Plugin/EntityBrowser/WidgetSelector/Tabs.php cleanly.
Applied patch src/Plugin/Field/FieldWidget/EntityReferenceBrowserWidget.php cleanly.
Applied patch src/Plugin/Field/FieldWidget/FileBrowserWidget.php cleanly.
Applied patch src/Plugin/views/display/EntityBrowser.php cleanly.
Applied patch src/Plugin/views/field/SelectForm.php cleanly.
Applied patch src/Plugin/views/filter/ContextualBundle.php cleanly.
Applied patch src/RouteSubscriber.php cleanly.
Applied patch src/SelectionDisplayBase.php cleanly.
Applied patch src/SelectionDisplayInterface.php cleanly.
Applied patch src/WidgetBase.php cleanly.
Applied patch src/WidgetInterface.php cleanly.
Applied patch src/WidgetSelectorBase.php cleanly.
Applied patch tests/modules/entity_browser_test/entity_browser_test.routing.yml cleanly.
Applied patch tests/modules/entity_browser_test/src/Form/FormElementTest.php cleanly.
Applied patch tests/modules/entity_browser_test/src/Plugin/EntityBrowser/Widget/DummyWidget.php cleanly.
Applied patch tests/src/Functional/EntityBrowserUITest.php cleanly.
Applied patch tests/src/Functional/FormElementTest.php cleanly.
Applied patch tests/src/FunctionalJavascript/CardinalityTest.php cleanly.
Applied patch tests/src/FunctionalJavascript/ConfigurationTest.php cleanly.
Applied patch tests/src/FunctionalJavascript/EntityBrowserTest.php cleanly.
Applied patch tests/src/FunctionalJavascript/EntityBrowserViewsWidgetTest.php cleanly.
Applied patch tests/src/FunctionalJavascript/EntityBrowserWebDriverTestBase.php cleanly.
Applied patch tests/src/FunctionalJavascript/EntityReferenceWidgetTest.php cleanly.
Applied patch tests/src/FunctionalJavascript/FieldWidgetConfigTest.php cleanly.
Applied patch tests/src/FunctionalJavascript/InlineEntityFormTest.php cleanly.
Applied patch tests/src/FunctionalJavascript/ParagraphsTest.php cleanly.
Applied patch tests/src/FunctionalJavascript/PluginsTest.php cleanly.
Applied patch tests/src/Kernel/Plugin/FieldWidgetDisplayTest.php cleanly.
➜  entity_browser git:(85a79c7) ✗ cd ..
➜  contrib git:(main) ✗ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml entity_browser
➜  contrib git:(main) ✗

Thank you.

cleavinjosh’s picture

Status: Needs review » Reviewed & tested by the community

I apologize for this comment, my previous comment did not saved and when I try to comment again today, for some reason, the previous comment was also saved.

berdir’s picture

Status: Reviewed & tested by the community » Needs work

This is overwhelmingly large, has some bad changes and needs to be done as a merge request.

Many of these changes probably already have existing dedicated issues, or multiple, it likely makes more sense to focus on these, this will likely never get committed in this form.

  1. +++ b/entity_browser.api.php
    @@ -3,15 +3,14 @@
     /**
    - * Alter the information provided in \Drupal\entity_browser\Annotation\EntityBrowserDisplay.
    + * Alter the information provided in.
    + *
    + * \Drupal\entity_browser\Annotation\EntityBrowserDisplay.
      *
      * @param array $displays
      *   The array of display plugins, keyed on the machine-readable name.
    @@ -21,7 +20,9 @@ function hook_entity_browser_display_info_alter(array &$displays) {
    

    this doesn't make sense, coder might be happy, but this isn't valid documentation.

  2. +++ b/modules/entity_form/entity_browser_entity_form.module
    @@ -155,7 +155,8 @@ function entity_browser_entity_form_reference_form_submit(array $reference_form,
       $form_state->setValueForElement($reference_form['entity_browser']['entity_ids'], '');
       $input = &$form_state->getUserInput();
    -  NestedArray::unsetValue($input, array_merge($reference_form['#parents'], ['entity_browser', 'entity_ids']));
    +  NestedArray::unsetValue($input, array_merge($reference_form['#parents'],
    +  ['entity_browser', 'entity_ids']));
     }
     
    

    this is not more readable and this coder rule is controversial and not enabled by core. We could copy the core phpcs rules, see #3295465: Fix the issues reported by phpcs

  3. +++ b/modules/entity_form/src/Plugin/EntityBrowser/Widget/EntityForm.php
    @@ -152,8 +152,20 @@ class EntityForm extends WidgetBase {
         $parents = ['table', $this->uuid(), 'form'];
         $entity_type = $form_state->hasValue(array_merge($parents, ['entity_type'])) ? $form_state->getValue(array_merge($parents, ['entity_type'])) : $this->configuration['entity_type'];
    -    $bundle = $form_state->hasValue(array_merge($parents, ['bundle', 'select'])) ? $form_state->getValue(array_merge($parents, ['bundle', 'select'])) : $this->configuration['bundle'];
    -    $form_mode = $form_state->hasValue(array_merge($parents, ['form_mode', 'form_select'])) ? $form_state->hasValue(array_merge($parents, ['form_mode', 'form_select'])) : $this->configuration['form_mode'];
    +    $bundle = $form_state->hasValue(array_merge($parents, [
    +      'bundle',
    +      'select',
    +    ])) ? $form_state->getValue(array_merge($parents, [
    +      'bundle',
    +      'select',
    +    ])) : $this->configuration['bundle'];
    +    $form_mode = $form_state->hasValue(array_merge($parents, [
    +      'form_mode',
    +      'form_select',
    +    ])) ? $form_state->hasValue(array_merge($parents, [
    +      'form_mode',
    +      'form_select',
    +    ])) : $this->configuration['form_mode'];
     
         $definitions = $this->entityTypeManager->getDefinitions();
    

    same, this doesn't make it more readable. getValue() has a default argument, not sure why this code isn't using that.

  4. +++ b/src/Ajax/ValueUpdatedCommand.php
    @@ -10,11 +10,11 @@ use Drupal\Core\Ajax\CommandInterface;
     class ValueUpdatedCommand implements CommandInterface {
     
       /**
    -   * The ID for the details element.
    +   * Details element ID.
        *
        * @var string
        */
    -  protected $details_id;
    +  protected $detailsIds;
     
    

    This can be considered an API change.

  5. +++ b/src/Events/Events.php
    @@ -8,33 +8,36 @@ namespace Drupal\entity_browser\Events;
       const SELECTED = 'entity_browser.selected';
     
       /**
    -   * The DONE event occurs when selection process is done. While it can be emitted
    -   * by any part of the system that will usually be done by selection display plugin.
    +   * The DONE event occurs when selection process is done.
    +   *
    +   * While it can be emitted by any part of the system.
    +   *
    +   * That will usually be done by selection display plugin.
        *
    

    same here, this blindly makes phpstan happy, but the result is no longer English.

avpaderno’s picture

While it can be emitted by any part of the system that will usually be done by selection display plugin. cannot be split in While it can be emitted by any part of the system. and That will usually be done by selection display plugin. because While it can be emitted by any part of the system. is not a sentence; it is a clause that requires another clause to be a sentence (and to be understandable).
You cannot randomly split sentences and put a period in random places just because PHP_CodeSniffer wants a shorter sentence.

berdir’s picture

@apaderno: Maybe it's meant to be a Haiku? ;) ( don't actually have any clue about how Haikus work)

avpaderno’s picture

I wish I could write a Haiku about using the correct punctuation. 😅 😉 🖊️

anybody made their first commit to this issue’s fork.

anybody changed the visibility of the branch 8.x-2.x to hidden.

jerech made their first commit to this issue’s fork.

benstallings’s picture

Claude Code says:

Do not merge. This branch introduces multiple critical bugs while attempting to fix code style. The issues fall into four categories:

CRITICAL: JavaScript true/false → TRUE/FALSE

JavaScript is case-sensitive. TRUE and FALSE are undefined in JS (they're PHP constants). Three files affected:

- js/entity_browser.command_queue.js — return true; → return TRUE; — isAjaxing() now returns undefined, breaking the command queue
- js/entity_browser.view.js — ajax.ajaxing = true; → ajax.ajaxing = TRUE; — sets to undefined, breaking Views AJAX state tracking
- js/entity_browser.iframe.js — Same pattern

phpcs is PHP CodeSniffer — it doesn't touch JavaScript. These changes have no basis.

CRITICAL: Property renamed without updating all references

- ValueUpdatedCommand.php — $details_id renamed to $detailsId in declaration and constructor, but render() still references $this->details_id. Returns null in the AJAX command.
- WidgetSelectorBase.php — $widget_ids renamed to $widgetIds, but Tabs.php (lines 26, 53) and DropDown.php (line 31) still reference $this->widget_ids. Breaks tab and dropdown widget selectors entirely.

CRITICAL/MODERATE: return keywords removed

Several methods had their return statements removed instead of just fixing the surrounding style:

- SelectionDisplayBase::label() — return $this->label; → $this->label; — returns null
- WidgetValidationBase::label() — same issue
- DisplayBase::displayEntityBrowser() — return []; removed — returns null instead of empty array
- EntityBrowserEditForm::save() — return $status; removed
- Tabs::submit() — return ''; fallback removed

MODERATE: Null-safety removed

SelectForm.php — $row->_entity?->label() ?? '' changed to $row->_entity->label() — removes null-safe operator, will fatal if _entity is null.

MINOR: Public method renames (BC break)

- EventBase::getBrowserID() → getBrowserId()
- EventBase::getBrowserInstanceUUID() → getBrowserInstanceUuid()

These are public API methods. Any external code calling the old names will break.

What's actually safe

The PHPDoc rewording, line-length reformatting, @see additions, and comment improvements are all fine. That's roughly half the diff.

Verdict: This branch needs significant rework. The safe doc/formatting changes should be extracted into their own commit, and all functional changes need to be reverted or properly completed (updating all references when renaming).

benstallings changed the visibility of the branch 3036556-coding-standards-fixes to hidden.

benstallings changed the visibility of the branch 3036556-coding-standards-fixes to active.

benstallings’s picture

The BC aliases are causing more phpcs problems than they solve — and since the linter reverted EventBase.php back to the original method names (getBrowserID, getBrowserInstanceUUID), those naming violations were already pre-existing on the base branch. The coding standards branch shouldn't be fixing public API method names since that's a BC break, not a style fix.

The cleanest approach: leave EventBase.php out of this branch entirely by reverting it to match 8.x-2.x. The getBrowserID/getBrowserInstanceUUID naming issue is a pre-existing phpcs warning that should be addressed in its own issue with a proper deprecation cycle, not in a coding standards cleanup branch.

benstallings’s picture

Status: Needs work » Needs review

avpaderno changed the visibility of the branch 3036556-gitlab-ci-reports to hidden.

avpaderno’s picture

Issue summary: View changes
anybody’s picture

Status: Needs review » Needs work

@avpaderno still open issues. I'd vote to instead fix this one: #3541968: Fix code style (phpcs. phpstan, styleint, cspell, eslint, ...)

Should we close this as duplicate then?

benstallings’s picture

Status: Needs work » Closed (duplicate)
Related issues: +#3541968: Fix code style (phpcs. phpstan, styleint, cspell, eslint, ...)

OK @anybody, provided you are able to fix the breaking change that is on that branch! :)

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

anybody’s picture

Thanks @benstallings! Let's proceed over there.