Testing command: phpcbf --standard=Drupal .

The following code (templates/breadcrumb.tpl.php):

<nav aria-labelledby="breadcrumb_title" class="breadcrumb" role="navigation">
<p class="hide" id="breadcrumb_title"><?php echo t('You are here'); ?> </p>
  <ul class="breadcrumb">
    <li><?php echo implode('</li><li> ', $variables['breadcrumb']); ?></li>
  </ul>
</nav>

is converted into:

<nav aria-labelledby="breadcrumb_title" class="breadcrumb" role="navigation">
<p class="hide" id="breadcrumb_title"><?php
/**
 * @file
 */
echo t('You are here'); ?> </p>
  <ul class="breadcrumb">
    <li><?php echo implode('</li><li> ', $variables['breadcrumb']); ?></li>
  </ul>
</nav>

I think the solution could be to add with @file in it at the beginning of the file instead.

Comments

kenorb created an issue. See original summary.

kenorb’s picture

Another example.

File: http://cgit.drupalcode.org/booking_timeslots/tree/templates/tutorial.tpl...

Line:

              <img src="/<?php print $dir; ?>/images/tutorial_opening_hours_venue.png" style="border: 0;" />

is changed to:

              <img src="/<?php
/**
 * @file
 */
print $dir; ?>/images/tutorial_opening_hours_venue.png" style="border: 0;" />

  • klausi committed c5f3b8f on 8.x-2.x
    Issue #2611252: Coder adds @file in the middle of template
    
klausi’s picture

Status: Active » Fixed

Committed a fix, thanks for reporting!

Status: Fixed » Closed (fixed)

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