bornfight / php-coding-standards

Bornfight php coding standard
5 stars 1 forks source link

Short echo not defined #12

Open tonymrakovcic opened 6 years ago

tonymrakovcic commented 6 years ago
<?=$xy?>

should be declared as wrong

<?= $xy ?>

should be the one we are looking for spaces issue

vilimco commented 6 years ago

To elaborate a little more on the issue. Currently this is considered valid syntax by our code style:

<?="some string"?>

It is much nicer to have it with surrounding spaces:

<?= "some string" ?>

Also, notice for further issues: elaborate more on a problem, or we are gonna get set of unclear issues.

tonymrakovcic commented 6 years ago

it is funny how the dollar something gets eaten so it looks confusing :D try to edit to see my comment

vilimco commented 6 years ago

It's actually markdown behaviour.

For code snippets, use ```php some code ```

Otherwise, markdown parser will try to parse \<?=?> as ?=? tag and, since it is non existing, it will be stripped out :)

tonymrakovcic commented 6 years ago

true story, edited :)

krukru commented 6 years ago

Agreed. Can we get a phpcs rule for this?