Problem/Motivation

Fix code style (phpcs. phpstan), see the CI pipeline

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

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

anybody created an issue. See original summary.

anybody’s picture

Title: Fix code style (phpcs. phpstan) » Fix code style (phpcs, phpstan)
partyka’s picture

I just took a peak at the code quality logs, and I agree that the `phpstan` errors should be cleaned up. However, I would like to know if for the `phpcs` issues simply adding a baseline would make more sense. That would require the usage of https://github.com/123inkt/php-codesniffer-baseline, and there's < 100 violations, and just under half are automatically fixable. Either way seems like the same amount of work to me, so just wondering your opinion.

aayushpathak’s picture

working !

aayushpathak’s picture

Status: Active » Needs review

All PHPCS issues are fixed there were more than 100 phpcs violations.
Remaining PHPStan errors are due to missing optional modules (Inline Entity Form, Entity Browser, Rules, ECA) and some out-of-scope warnings.

yusuf_khan’s picture

Status: Needs review » Needs work

@aayushpathak PHPCS issues are fixed , adding phpstan issues for maintainer reference

vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml web/modules/contrib/entityqueue-3582344/
ykhan@COMM--YKHAN-MAC my-drupal-site $ vendor/bin/phpstan analyze web/modules/contrib/entityqueue-3582344/ --level=1 --memory-limit=1G
61/61 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

------ ----------------------------------------------------------------------------
Line src/Form/EntitySubqueueForm.php
------ ----------------------------------------------------------------------------
:226 Class
Drupal\inline_entity_form\Plugin\Field\FieldWidget\InlineEntityFormBase
not found.
🪪 class.notFound
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
:258 Class
Drupal\entity_browser\Plugin\Field\FieldWidget\EntityReferenceBrowserWidge
t not found.
🪪 class.notFound
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
------ ----------------------------------------------------------------------------

------ ----------------------------------------------------------------------------
Line src/Plugin/ECA/Condition/EntityIsInSubqueueCondition.php
------ ----------------------------------------------------------------------------
:21 Class Drupal\entityqueue\Plugin\ECA\Condition\EntityIsInSubqueueCondition
extends unknown class Drupal\eca\Plugin\ECA\Condition\ConditionBase.
🪪 class.notFound (non-ignorable)
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
:27 Call to an undefined method
Drupal\entityqueue\Plugin\ECA\Condition\EntityIsInSubqueueCondition::getVa
lueFromContext().
🪪 method.notFound
:28 Access to an undefined property
Drupal\entityqueue\Plugin\ECA\Condition\EntityIsInSubqueueCondition::$conf
iguration.
🪪 property.notFound
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefine
d-property
:30 Call to an undefined method
Drupal\entityqueue\Plugin\ECA\Condition\EntityIsInSubqueueCondition::negat
ionCheck().
🪪 method.notFound
:39 Drupal\entityqueue\Plugin\ECA\Condition\EntityIsInSubqueueCondition::defau
ltConfiguration() calls parent::defaultConfiguration() but
Drupal\entityqueue\Plugin\ECA\Condition\EntityIsInSubqueueCondition does
not extend any class.
🪪 class.noParent
:48 Call to an undefined method
Drupal\entityqueue\Plugin\ECA\Condition\EntityIsInSubqueueCondition::t().
🪪 method.notFound
:49 Access to an undefined property
Drupal\entityqueue\Plugin\ECA\Condition\EntityIsInSubqueueCondition::$conf
iguration.
🪪 property.notFound
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefine
d-property
:51 Drupal\entityqueue\Plugin\ECA\Condition\EntityIsInSubqueueCondition::build
ConfigurationForm() calls parent::buildConfigurationForm() but
Drupal\entityqueue\Plugin\ECA\Condition\EntityIsInSubqueueCondition does
not extend any class.
🪪 class.noParent
:58 Access to an undefined property
Drupal\entityqueue\Plugin\ECA\Condition\EntityIsInSubqueueCondition::$conf
iguration.
🪪 property.notFound
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefine
d-property
:59 Drupal\entityqueue\Plugin\ECA\Condition\EntityIsInSubqueueCondition::submi
tConfigurationForm() calls parent::submitConfigurationForm() but
Drupal\entityqueue\Plugin\ECA\Condition\EntityIsInSubqueueCondition does
not extend any class.
🪪 class.noParent
------ ----------------------------------------------------------------------------

------ ----------------------------------------------------------------------
Line src/Plugin/Field/FieldWidget/EntityqueueDragtableWidget.php
------ ----------------------------------------------------------------------
:106 \Drupal calls should be avoided in classes, use dependency injection
instead
🪪 globalDrupalDependencyInjection.useDependencyInjection
:143 \Drupal calls should be avoided in classes, use dependency injection
instead
🪪 globalDrupalDependencyInjection.useDependencyInjection
:273 \Drupal calls should be avoided in classes, use dependency injection
instead
🪪 globalDrupalDependencyInjection.useDependencyInjection
------ ----------------------------------------------------------------------

------ -----------------------------------------------------------------------
Line src/Plugin/RulesAction/AddItemToSubqueue.php
------ -----------------------------------------------------------------------
:28 Class Drupal\entityqueue\Plugin\RulesAction\AddItemToSubqueue extends
unknown class Drupal\rules\Core\RulesActionBase.
🪪 class.notFound (non-ignorable)
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
------ -----------------------------------------------------------------------

------ ------------------------------------------------------------------------
Line src/Plugin/RulesAction/ClearSubqueueItems.php
------ ------------------------------------------------------------------------
:23 Class Drupal\entityqueue\Plugin\RulesAction\ClearSubqueueItems extends
unknown class Drupal\rules\Core\RulesActionBase.
🪪 class.notFound (non-ignorable)
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
------ ------------------------------------------------------------------------

------ ----------------------------------------------------------------------------
Line src/Plugin/RulesAction/RemoveItemFromSubqueue.php
------ ----------------------------------------------------------------------------
:28 Class Drupal\entityqueue\Plugin\RulesAction\RemoveItemFromSubqueue extends
unknown class Drupal\rules\Core\RulesActionBase.
🪪 class.notFound (non-ignorable)
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
------ ----------------------------------------------------------------------------

------ --------------------------------------------------------------------------
Line src/Plugin/RulesAction/ReverseSubqueueItems.php
------ --------------------------------------------------------------------------
:23 Class Drupal\entityqueue\Plugin\RulesAction\ReverseSubqueueItems extends
unknown class Drupal\rules\Core\RulesActionBase.
🪪 class.notFound (non-ignorable)
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
------ --------------------------------------------------------------------------

------ --------------------------------------------------------------------------
Line src/Plugin/RulesAction/ShuffleSubqueueItems.php
------ --------------------------------------------------------------------------
:23 Class Drupal\entityqueue\Plugin\RulesAction\ShuffleSubqueueItems extends
unknown class Drupal\rules\Core\RulesActionBase.
🪪 class.notFound (non-ignorable)
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
------ --------------------------------------------------------------------------

------ ----------------------------------------------------------------------
Line src/Plugin/migrate/D7EntitysubqueueDeriver.php
------ ----------------------------------------------------------------------
:37 \Drupal calls should be avoided in classes, use dependency injection
instead
🪪 globalDrupalDependencyInjection.useDependencyInjection
------ ----------------------------------------------------------------------

------ -----------------------------------------------------------------------
Line src/Plugin/migrate/source/d7/Entityqueue.php
------ -----------------------------------------------------------------------
:16 Class Drupal\entityqueue\Plugin\migrate\source\d7\Entityqueue extends
deprecated class
Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase:
in drupal:11.3.0 and is removed from drupal:12.0.0. There is no
replacement.
🪪 class.extendsDeprecatedClass
------ -----------------------------------------------------------------------

------ --------------------------------------------------------------------------
Line src/Plugin/migrate/source/d7/Entitysubqueue.php
------ --------------------------------------------------------------------------
:16 Class Drupal\entityqueue\Plugin\migrate\source\d7\Entitysubqueue extends
deprecated class
Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase:
in drupal:11.3.0 and is removed from drupal:12.0.0. There is no
replacement.
🪪 class.extendsDeprecatedClass
------ --------------------------------------------------------------------------

------ ----------------------------------------------------------------------
Line src/Plugin/views/join/CastedFieldJoin.php
------ ----------------------------------------------------------------------
:49 \Drupal calls should be avoided in classes, use dependency injection
instead
🪪 globalDrupalDependencyInjection.useDependencyInjection
:51 \Drupal calls should be avoided in classes, use dependency injection
instead
🪪 globalDrupalDependencyInjection.useDependencyInjection
------ ----------------------------------------------------------------------

------ ----------------------------------------------------------------------
Line src/Plugin/views/relationship/EntityQueueRelationship.php
------ ----------------------------------------------------------------------
:170 \Drupal calls should be avoided in classes, use dependency injection
instead
🪪 globalDrupalDependencyInjection.useDependencyInjection
:170 \Drupal calls should be avoided in classes, use dependency injection
instead
🪪 globalDrupalDependencyInjection.useDependencyInjection
:172 \Drupal calls should be avoided in classes, use dependency injection
instead
🪪 globalDrupalDependencyInjection.useDependencyInjection
:189 \Drupal calls should be avoided in classes, use dependency injection
instead
🪪 globalDrupalDependencyInjection.useDependencyInjection
------ ----------------------------------------------------------------------

[ERROR] Found 29 errors

ykhan@COMM--YKHAN-MAC my-drupal-site $

aayushpathak’s picture

All PHPCS issues have been resolved. The PHPStan errors you’re referring to are due to missing optional contrib modules (Inline Entity Form, Entity Browser, Rules, ECA). The remaining warnings (dependency injection, deprecated APIs) appear to be pre-existing and out of scope for this issue.

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

amateescu’s picture

Status: Needs work » Fixed

Merged into 8.x-1.x, thanks!

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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.