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

Remove php in front of vendor/bin/php-cs-fixer fix, since that is wrong #69

Merged
merged 1 commit into from
Oct 9, 2022

Conversation

madsoliver
Copy link
Contributor

Questions Answers
Description? Just a minor change in the README.md that had one error about php-cs-fixer being run with php in front, that is wrong.
Type? bug fix
BC breaks? no
Deprecations? no
Fixed ticket?
How to test? Agree/disagree that that feature is now correctly documented
Possible impacts? none

```php
php vendor/bin/php-cs-fixer fix
```bash
$ vendor/bin/php-cs-fixer fix
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it works 😄

I think for most environments php vendor/bin/php-cs-fixer and vendor/bin/php-cs-fixer both work. But in some env. where the php binary is not registered globally or bash is not able to interpret that this is a PHP script it is needed to put php in front

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @matks 🙂

On my machine (Windows 11 WSL2 with Ubuntu and Docker with the official presta dockerfile) when I run php vendor/bin/php-cs-fixer fix I get the contents of the binary file in the terminal.

or bash is not able to interpret that this is a PHP script

Is it a PHP-script though?
The source code of vendor/bin/php-cs-fixer is:

#!/usr/bin/env sh

dir=$(cd "${0%[/\\]*}" > /dev/null; cd '../friendsofphp/php-cs-fixer' && pwd)

if [ -d /proc/cygdrive ]; then
    case $(which php) in
        $(readlink -n /proc/cygdrive)/*)
            # We are in Cygwin using Windows php, so the path must be translated
            dir=$(cygpath -m "$dir");
            ;;
    esac
fi

"${dir}/php-cs-fixer" "$@"

Copy link
Contributor

@kpodemski kpodemski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can accept it, but I agree with @matks that it should work properly in most scenarios.

Windows is weird ;-)

@matks
Copy link
Contributor

matks commented Oct 9, 2022

I trust @kpodemski and @atomiix opinion: let's merge !

@matks matks merged commit a88421e into PrestaShop:master Oct 9, 2022
@matks matks added this to the 4.2.2 milestone Oct 9, 2022
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

Successfully merging this pull request may close these issues.

None yet

4 participants