Commit 26afcc8c authored by Harsh Panchal's avatar Harsh Panchal Committed by David Flores
Browse files

Issue #3300211 by anoopsingh92, Harsh panchal: Phpcs standard coding issue

parent 7e7c0930
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -8,17 +8,23 @@
use Drupal\fluent\Fluent;

/**
 * Implement fluent.
 *
 * @return \Drupal\fluent\Fluent
 *   Fluent service.
 */
function fluent(): Fluent {
  return \Drupal::service('fluent.service');
}

/**
 * Fieldable entity.
 *
 * @param mixed $entity
 *   Fieldable entity.
 *
 * @return \Drupal\fluent\Fluent
 *   Fluent service
 */
function using($entity): Fluent {
  return \Drupal::service('fluent.service')->using($entity);
+6 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ class FieldResolution {

  /**
   * Control the force skip.
   *
   * @var bool
   */
  private bool $forceSkip = FALSE;
@@ -129,7 +130,9 @@ class FieldResolution {

  /**
   * Force skip if field needs to be resolved.
   *
   * @param bool $force
   *   The force.
   *
   * @return $this
   */
@@ -138,6 +141,9 @@ class FieldResolution {
    return $this;
  }

  /**
   * Needs To Force Skip.
   */
  public function needsToForceSkip(): bool {
    return $this->forceSkip;
  }
+0 −5
Original line number Diff line number Diff line
@@ -3,13 +3,8 @@
namespace Drupal\fluent;

use Drupal\Core\Config\Entity\ConfigEntityInterface;
use Drupal\Core\Field\FieldItemInterface;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem;
use Drupal\Core\TypedData\Plugin\DataType\ItemList;
use Drupal\Core\TypedData\PrimitiveBase;
use Drupal\Core\TypedData\PrimitiveInterface;
use Drupal\Core\TypedData\TypedDataInterface;
use Drupal\fluent\Plugin\FluentFieldResolverManager;

/**
+6 −2
Original line number Diff line number Diff line
@@ -51,8 +51,9 @@ class CommonField extends FluentFieldResolverBase {
    if ($object instanceof FieldItemInterface) {
      try {
        $field = $object->get($fieldName);
      } catch (MissingDataException $e) {
        // @todo: Handle exception.
      }
      catch (MissingDataException $e) {
        // @todo Handle exception.
      }
    }

@@ -63,6 +64,9 @@ class CommonField extends FluentFieldResolverBase {
    return $field;
  }

  /**
   * Resolve Field Item.
   */
  private function resolveFieldItem(ContentEntityInterface $object, string $fieldName) {
    // @todo refactor this code.
    // First try to access as a field
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ class RevisionField extends FluentFieldResolverBase {
      ->getStorage($object->getFieldDefinition()->getTargetEntityTypeId());

    if ($fieldControl->isMultivalued()) {
      // @todo: support multiple load revisions.
      // @todo support multiple load revisions.
      // see NodeStorage:12
      if (!method_exists($storage, 'revisionIds')) {
        throw new \Exception('Don\'t support multiple revisions');
Loading