Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for alternative syntax #120

Open
n9iels opened this issue Aug 25, 2015 · 3 comments
Open

Support for alternative syntax #120

n9iels opened this issue Aug 25, 2015 · 3 comments

Comments

@n9iels
Copy link

n9iels commented Aug 25, 2015

Is there currently a way to avoid errors when using a inline php syntax?
Like this:

<?php if ($condition == true) : ?>
    <p>Yes</p>
<?php endif; ?>
@mbabker
Copy link
Contributor

mbabker commented Aug 25, 2015

Change the InlineControlStructureSniff to allow it. Generally the only place it's allowed though is layout files. These files are exempted in the CMS (see https://github.com/joomla/joomla-cms/blob/staging/build/phpcs/Joomla/ruleset.xml#L138), so if you're using this ruleset in a project you'd need to tweak the ruleset a bit.

@n9iels
Copy link
Author

n9iels commented Aug 25, 2015

Strange enough I don't get the error that is generated in this file (Inline control structures are not allowed).
When taking this file for example https://github.com/joomla/joomla-cms/blob/staging/components/com_content/views/form/tmpl/edit.php#L61 codesniffer says:
Expected "if (...)\n"; found "if (...) "

@vess
Copy link
Contributor

vess commented Aug 26, 2015

That error message is coming from the ControlSignatureSniff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants