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

include form #74

Closed
alexander-akait opened this issue Feb 20, 2018 · 3 comments · Fixed by #224 or #479
Closed

include form #74

alexander-akait opened this issue Feb 20, 2018 · 3 comments · Fixed by #224 or #479

Comments

@alexander-akait
Copy link
Member

alexander-akait commented Feb 20, 2018

require ('somefile.php');

vs

require 'somefile.php';

All popular framework use this form:
https://github.com/laravel/framework/search?l=PHP&q=require&type=&utf8=%E2%9C%93
https://github.com/symfony/symfony/search?utf8=%E2%9C%93&q=require&type=
https://github.com/yiisoft/yii2/search?l=PHP&q=require&type=&utf8=%E2%9C%93

Vote welcome.

  1. ❤️ - First example
  2. 👍 - Second example
  3. 💯 Output as is
@alexander-akait
Copy link
Member Author

alexander-akait commented Mar 13, 2018

WordPress also use second output.

@ichiriac
Copy link

ichiriac commented Apr 7, 2018

Just for your information, the second choice is better, and there is a reason :

Foo.php

<?php return 'I AM FOO !';

This code :

<?php
echo include('foo.php') . ' MORE OUTPUT';

Does not behaves as expected, and is interpreted as :

<?php
echo include 'foo.php' . ' MORE OUTPUT';

Resulting in a warning with a file not found. So removing parenthesis removes ambiguity on how it will be interpreted.

@alexander-akait
Copy link
Member Author

@ichiriac thanks for feedback, now we use first option, but anyone can post own opinion and vote and we can change this in future

czosel pushed a commit that referenced this issue Jan 28, 2019
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 3.6.0 to 4.0.0.
<details>
<summary>Changelog</summary>

*Sourced from [eslint-config-prettier's changelog](https://github.com/prettier/eslint-config-prettier/blob/master/CHANGELOG.md).*

> ### Version 4.0.0 (2019-01-26)
> 
> - Breaking change: Support for [eslint-plugin-typescript] has been removed and
>   replaced with support for its successor [@typescript-eslint/eslint-plugin].
>   Thanks to TANIGUCHI Masaya ([**ta2gch**](https://github.com/ta2gch)) and everyone else who helped with this!
> - Changed: [arrow-body-style] and [prefer-arrow-callback] are now marked as
>   [special rules][arrow-special], since they might cause problems if using
>   [eslint-plugin-prettier] and `--fix`. They are turned off by default, and the
>   CLI helper tool will _warn_ about them (but not error if you do enable them).
>   This won’t break your linting checks, but do note that these rules will be
>   disabled unless you explicitly enable them again, and that you might see new
>   warnings when running the CLI helper tool.
</details>
<details>
<summary>Commits</summary>

- [`0b04c0d`](prettier/eslint-config-prettier@0b04c0d) eslint-config-prettier v4.0.0
- [`2c84267`](prettier/eslint-config-prettier@2c84267) Update dependencies
- [`81abe0f`](prettier/eslint-config-prettier@81abe0f) Merge branch 'v4'
- [`9fde1aa`](prettier/eslint-config-prettier@9fde1aa) Add arrow-body-style and prefer-arrow-callback as special rules
- [`d1254cd`](prettier/eslint-config-prettier@d1254cd) Replace eslint-plugin-typescript with @typescript-eslint/eslint-plugin ([#74](https://github-redirect.dependabot.com/prettier/eslint-config-prettier/issues/74))
- See full diff in [compare view](prettier/eslint-config-prettier@v3.6.0...v4.0.0)
</details>
<br />

[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=eslint-config-prettier&package-manager=npm_and_yarn&previous-version=3.6.0&new-version=4.0.0)](https://dependabot.com/compatibility-score.html?dependency-name=eslint-config-prettier&package-manager=npm_and_yarn&previous-version=3.6.0&new-version=4.0.0)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot ignore this [patch|minor|major] version` will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants