- Assigned to thakurnishant_06
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 7:08am 7 July 2023 - thakurnishant_06 India
Created the patch to fix the coding standard issues and warnings on branch 2.0.x-dev .
Kindly review the patch.
Thank you. - @thakurnishant_06 opened merge request.
- Status changed to Needs work
over 1 year ago 9:00am 7 July 2023 - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
+ /** + * Constructs a BreadcrumbItem object. + */
The class name is missing the namespace.
+ /** + * Creates a new BreadcrumbItem instance. + * + * @param \Drupal\Core\Link|null $link + * (optional) The link associated with the breadcrumb item. + * + * @return \Drupal\consistent_breadcrumbs\BreadcrumbItem + * The BreadcrumbItem instance. + */ public static function create(?Link $link = NULL): BreadcrumbItem {
Since the method returns an instance of the same class, it should be
@return static
.+ * @return $this + * The current BreadcrumbItem object. + */ public function setLink(?Link $link): self {
Since it uses
@return $this
, the return value description is not necessary.+/** + * Defines the interface for Consistent Breadcrumb builders. + */ interface ConsistentBreadcrumbBuilderInterface {
Saying that an interface defines the interface for Consistent Breadcrumb builders is not giving a useful description.
+/** + * Manages the consistent breadcrumb generation. + */ class ConsistentBreadcrumbManager implements ConsistentBreadcrumbManagerInterface {
What is a consistent breadcrumb generation? It is better to say Provides a manager for [โฆ]. or Manages discovery and instantiation of [โฆ] plugins. which are two of the descriptions used by Drupal core for plugin managers.
+ /** + * The static cache backend. + * + * @var \Drupal\Core\Cache\CacheBackendInterface + */ private CacheBackendInterface $staticCache;
It is sufficient to say The cache backend.
+ /** + * The primary breadcrumb builder. + * + * @var \Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface + */ private BreadcrumbBuilderInterface $breadcrumbManager;
The breadcrumb builder. is sufficient.
+ /** + * Constructs a ConsistentBreadcrumbManager object. + * + * @param \Drupal\Core\Cache\CacheBackendInterface $staticCache + * The static cache backend. + * @param \Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface $breadcrumbManager + * The primary breadcrumb builder. + * @param \Drupal\consistent_breadcrumbs\ConsistentBreadcrumbsRoutingHelper $routingHelper + * The routing helper. + * @param \Drupal\Core\Http\RequestStack $requestStack + * The request stack. + */
The class namespace is missing.
/** - * @inheritDoc + * {@inheritDoc} */
It is
{@inheritdoc}
. - Assigned to thakurnishant_06
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 6:25pm 31 July 2023 - Status changed to Needs work
over 1 year ago 11:29pm 31 July 2023 - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
- private function __construct() {} -
The constructor has been declared private to avoid it is used to create an instance of that class. It cannot be removed, or PHP will assign to the class a public constructor.
+ * @return static \Drupal\consistent_breadcrumbs\BreadcrumbItem + * The BreadcrumbItem instance.
When
static
or$this
are used as return type, there is no need to also add the class name. I think in Drupal$this
is used instead ofstatic
, though.+/** + * Provides an interface defining a Consistent Breadcrumb builders. + */ interface ConsistentBreadcrumbBuilderInterface {
An interface that provides an interface is quiteโฆ tautological, especially when the description ends with the interface name.
+/** + * Manages the consistent breadcrumb generation. + */ class ConsistentBreadcrumbManager implements ConsistentBreadcrumbManagerInterface {
The description should be a little better than that.
+ /** + * Constructs a ConsistentBreadcrumbManager object. + *
The description for a constructor must start with
Constructs a new
followed by the class name (including its namespace), and end withobject.
/** - * @inheritDoc + * {@inheritDoc}.
The period is not added after
{@inheritdoc}
. It is{@inheritdoc}
, not{@inheritDoc}
.- // dump(__FUNCTION__ . ':noLink'); + // dump(__FUNCTION__ . ':noLink');.
Periods are not added to commented out code.
+/** + * Defines the interface for the Consistent Breadcrumb Manager. + */
Interface descriptions must not start with Defines.
+/** + * Path-based Consistent Breadcrumb builder implementation. + */
implementation is never used in class descriptions, in Drupal core.
+ * @return string + * The front page path. + */ private function getFrontPagePath() {
The method returns also
NULL
. Hi,
Applied #11 patch , the patch is not get applied and throwing error.- Status changed to Needs review
9 months ago 2:16pm 15 February 2024 - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
apaderno โ changed the visibility of the branch 3196460-FIX-PHPCS-ISSUES to hidden.
- ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
apaderno โ changed the visibility of the branch 2.0.x to hidden.