prettier / prettier/plugin-php
[Bug] 2 snippets which make the file no more valid PHP.
Open
Nobody has claimed this yet.
bug
comments
inline
- Dominant language
- PHP
- Stars
- 1.9k
- Forks
- 139
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
On the last prettier version at this time and last php plugin version, those 2 code snippets make the php file invalid after.
SNIPPET 1
Before:
<?=$this->input('before') ?><?=$this->numeric('value');?><?=$this->input('after') ?>
After:
<?=
$this->input('before')
$this->numeric('value')
$this->input('after')
?>
SNIPPET 2
Before:
<?php /* Some text */
if ($this->context ==='cars' || ($this->context !=='cars' && $this->editmode)) : ?>
After:
/* Some text */<?php
/* Some text */
?>if (
$this->context === 'cars' ||
($this->context !== 'cars' && $this->editmode)
): ?>
Hope it help to achieve a stable version.
Big thumbs up for this wonderfull plugin !
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the formatter output with the two PHP snippets shown in the issue using the current Prettier PHP plugin. Trace the formatting path responsible for combining or moving PHP tags, then add regression coverage confirming both formatted results remain valid PHP.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100