Skip to content

Commit

Permalink
Fix stan
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Fritsch committed Jan 16, 2025
1 parent c033e7f commit 73bce22
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public function testQueryCacheMetadata(): void {
* @param array $expectedResult
* The expected results.
*
* @covers EntitiesWithTerm::resolve
* @covers \Drupal\thunder_gqls\Plugin\GraphQL\DataProducer\EntitiesWithTerm::resolve
*
* @dataProvider providerEntityWithTerms
*/
Expand Down
8 changes: 4 additions & 4 deletions modules/thunder_workflow/src/ThunderWorkflowFormHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Drupal\Core\Url;
use Drupal\content_moderation\ModerationInformationInterface;
use Drupal\content_moderation\StateTransitionValidationInterface;
use Drupal\node\Entity\Node;
use Drupal\node\NodeInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Request;
Expand Down Expand Up @@ -75,7 +76,7 @@ public static function create(ContainerInterface $container): self {
public function formAlter(array &$form, FormStateInterface $form_state): void {
/** @var \Drupal\Core\Entity\ContentEntityFormInterface $form_object */
$form_object = $form_state->getFormObject();
/** @var \Drupal\node\NodeInterface $entity */
/** @var \Drupal\node\Entity\Node $entity */
$entity = $form_object->getEntity();

if (!$this->moderationInfo->isModeratedEntity($entity)) {
Expand Down Expand Up @@ -164,11 +165,10 @@ public function moveStateToActions(NodeInterface $entity, array $form): array {
*
* @param array $form
* The form array.
* @param \Drupal\node\NodeInterface $entity
* @param \Drupal\node\Entity\Node $entity
* The node entity.
*/
public function displayPublishedinformation(array &$form, NodeInterface $entity): void {
/** @var \Drupal\node\Entity\Node $entity */
public function displayPublishedinformation(array &$form, Node $entity): void {
/** @var \Drupal\content_moderation\ContentModerationState $state */
$state = $this->moderationInfo->getWorkflowForEntity($entity)->getTypePlugin()->getState($entity->moderation_state->value);

Expand Down
1 change: 1 addition & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
parameters:
customRulesetUsed: true
reportUnmatchedIgnoredErrors: true
treatPhpDocTypesAsCertain: false
level: 6
ignoreErrors:
# new static() is a best practice in Drupal, so we cannot fix that.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ class EntityReferenceActionsTest extends ThunderJavascriptTestBase {
*/
public function testMediaEditInArticle(): void {

/** @var \Drupal\node\Entity\Node $node */
$node = $this->loadNodeByUuid('36b2e2b2-3df0-43eb-a282-d792b0999c07');
$this->drupalGet($node->toUrl('edit-form'));

Expand Down
1 change: 0 additions & 1 deletion tests/src/FunctionalJavascript/MediaImageModifyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ public function testRemoveAdd(): void {
$this->assertSession()
->elementNotExists('css', '[data-drupal-selector="edit-field-paragraphs-0-subform-field-image-wrapper"] div.messages--error');

/** @var \Drupal\media\Entity\Media $image2 */
$image2 = $this->loadMediaByUuid('a4b2fa51-8340-4982-b792-92e060b71eb9');
$this->selectMedia('field-paragraphs-0-subform-field-image', [$image2->id()]);

Expand Down
4 changes: 2 additions & 2 deletions tests/src/Traits/ThunderTestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ protected function tearDown(): void {
* @param string $uuid
* The uuid.
*
* @return \Drupal\media\MediaInterface
* @return \Drupal\media\Entity\Media
* The media entity.
*
* @throws \Drupal\Core\Entity\EntityStorageException
Expand All @@ -193,7 +193,7 @@ protected function loadMediaByUuid(string $uuid): MediaInterface {
* @param string $uuid
* The uuid.
*
* @return \Drupal\node\NodeInterface
* @return \Drupal\node\Entity\Node
* The node entity.
*
* @throws \Drupal\Core\Entity\EntityStorageException
Expand Down

0 comments on commit 73bce22

Please sign in to comment.