Package Details: php-cs-fixer 3.8.0-1

Git Clone URL: (read-only, click to copy)
Package Base: php-cs-fixer
Description: Analyzes some PHP source code and tries to fix coding standards issues (PSR-1 and PSR-2 compatible).
Upstream URL:
Keywords: php
Licenses: MIT
Submitter: bgaleotti
Maintainer: bgaleotti (sanduhrs)
Last Packager: sanduhrs
Votes: 26
Popularity: 0.000063
First Submitted: 2012-08-10 16:53 (UTC)
Last Updated: 2022-04-22 21:07 (UTC)

Latest Comments

vladimir commented on 2022-03-17 13:25 (UTC)

Hello, I am sharing little patch, which makes final phar always executing system installed php. In case one is using something like nix-shell to get older php versions running dependency on environment breaks cs-fixer...

diff --git a/PKGBUILD b/PKGBUILD
index 035ce1f..34ae0e9 100644
@@ -14,6 +14,11 @@ makedepends=("php-humbug-box-bin" "composer" "git")

+prepare() {
+    cd "${srcdir}/${_pkgname}"
+    sed -i '1s|.*|#!/usr/bin/php|' php-cs-fixer
 build() {
   cd "${srcdir}/${_pkgname}"
   php /usr/bin/composer install --prefer-dist --no-dev

system7 commented on 2022-02-18 08:09 (UTC) (edited on 2022-02-18 08:09 (UTC) by system7)

There is a problem w/ update and install too.

❯ yay -S php-cs-fixer
 -> status 200: Too many package results.
status 200: Too many package results.
status 200: Too many package results.
status 200: Too many package results.
status 200: Too many package results.
status 200: Too many package results.

aragon123 commented on 2022-01-23 12:02 (UTC)

Due to the latest php81 update I needed to modify the PKGBUILD such that version 3.5.0 is installed (currently latest). Otherwise php-cs-fixer does not work without an additional environment variable, and recognizes some incorrect formats, which are actually correct.

I do not experience any bugs, so I think it should be save to update. At least it works for me ¯_(ツ)_/¯

tjbp commented on 2021-06-15 20:48 (UTC)

@Krisque: if php-humbug-box-bin is failing to build then your comment belongs on that package rather than this one ;)

Krisque commented on 2021-06-15 20:34 (UTC)

It doesn't work for me: "box.phar ... Failed" "LICENSE ... Passed" "Failed to compile php-humbug-box-bin"

vladimir commented on 2021-04-26 08:40 (UTC)

If this is built in clean chroot it does not work.

To fix the issue add dependency on php-intl and run box in build function this way: php -n -d phar.readonly=Off -d extension=intl /usr/bin/box compile

-n is necessary for people who have xdebug enabled and intl disabled. If it is not present box restart itself wih modified php.ini to disable xdebug but intl disabled again.

Skatox commented on 2021-04-01 15:10 (UTC)

You have to increase the PHP version on depends array. Now it should be:


tjbp commented on 2021-03-12 13:30 (UTC)

Any chance of an update to 2.18 please? 2.17 doesn't have PHP 8 support, which is now stable and used by the php package.

Remedan commented on 2020-11-05 08:49 (UTC)

The php-composer dependency doesn't exist any more. Replacing with composer seems to work.

diff --git i/PKGBUILD w/PKGBUILD
index d332769..742da57 100644
@@ -3,14 +3,14 @@

 pkgdesc="Analyzes some PHP source code and tries to fix coding standards issues (PSR-1 and PSR-2 compatible)."
 depends=("php>=5.6" "php>=7")
-makedepends=("php-humbug-box-bin" "php-composer" "git")
+makedepends=("php-humbug-box-bin" "composer" "git")

Magotchi commented on 2020-05-01 14:20 (UTC) (edited on 2020-05-01 14:29 (UTC) by Magotchi)

This is not necessarily a package bug, as it may well be a pikaur bug, but does anybody know why, when I build this package in pikaur, it tries to use sudo right after the "Updating dependencies" step, as follows?:

==> Validating source files with md5sums...
    php-cs-fixer ... Skipped
==> Extracting sources...
  -> Creating working copy of php-cs-fixer git repo...
Cloning into 'php-cs-fixer'...
Switched to a new branch 'makepkg'
==> Starting build()...
Loading composer repositories with package information
Updating dependencies
[sudo] password for ...:

This does not happen if I freshly clone it and use makepkg.

Edit: It also does not happen in "yay". I guess I'll figure it out and give pikaur a report.

Edit: Hmm. Now when I try it again in pikaur, I can't reproduce it. Weird. This happens to me every time this package needs to update.

hriad commented on 2019-01-13 07:18 (UTC)

Thanks for the diff @danger89

danger89 commented on 2019-01-05 01:50 (UTC) (edited on 2019-01-05 01:57 (UTC) by danger89)

Yes, Finally we have v2.14.0 Sunrise, supporting 7.3 now officially. Diff for pkgbuild:

diff --git a/PKGBUILD b/PKGBUILD
index 05acdbe..042304d 100644
@@ -3,13 +3,13 @@

 pkgdesc="Analyzes some PHP source code and tries to fix coding standards issues (PSR-1 and PSR-2 compatible)."
-depends=("php>=5.6" "php<7.3")
+depends=("php>=5.6" "php>=7")
 makedepends=("php-box" "php-composer" "git")

macfly commented on 2018-03-01 15:44 (UTC)

Thanks for your quick update

sanduhrs commented on 2018-03-01 11:57 (UTC) (edited on 2018-03-01 11:57 (UTC) by sanduhrs)

@macfly that went in by mistake, should have been <7.3 as seen in the composer.json file: Thanks for reporting!

macfly commented on 2018-03-01 09:32 (UTC)

Why do you require php under version 7.2 ? I've just remove it from the PKGBUILD and it seems ok.

Also on sensiolabs site they say: "PHP needs to be a minimum version of PHP 5.6.0." But not incompatibility with php version 7.2

supermario commented on 2016-02-13 19:20 (UTC)

license needs to be an array now. Can you please update the PKGBUILD? license=("MIT")

sanduhrs commented on 2016-01-15 11:33 (UTC)

Fixed the problems, current package should work fine.

soyel commented on 2016-01-04 04:55 (UTC) (edited on 2016-01-04 05:44 (UTC) by soyel)

@sanduhrs PHP in extra is now PHP 7. It causes several problems with the installation of this package with a default PHP install. * Phar is now bundled inside PHP (See Arch PHP maintainer blog : * "open_basedir" is now commented by default (that means no open_basedir in effect). Building... ==> Starting check()... Warning: You must add ':/usr/' to 'open_basedir' setting in your php.ini to use php-cs-fixer ==> ERROR: Makepkg was unable to build php-cs-fixer. Got rid of the whole "check()" function and few "-d" inside the "build()" function made the package installation successful.

sanduhrs commented on 2015-12-21 15:02 (UTC)

Updated the package to inform the user of the runtime requirements.

lakiluki commented on 2015-12-19 14:03 (UTC) (edited on 2015-12-19 14:33 (UTC) by lakiluki)

PHP Fatal error: Class 'Phar' not found in /usr/bin/composer on line 23 Getting this error when installing the package. EDIT: Got it to work by adding the extension to php.ini and adding /usr/bin to open_basedir.

jgmdev commented on 2015-12-03 22:55 (UTC) (edited on 2015-12-04 05:15 (UTC) by jgmdev)

@sanduhrs comes bundled with the php package so there's no need for the install file, since you already indicated php is a dependency. Edit: Never mind I understand what you mean, maybe it should warn about the requirement of enabling for php-cs-fixer to work after install but not exit with error message. Ahh it could also add a .ini file into /etc/php/conf.d to enable

sanduhrs commented on 2015-12-03 17:58 (UTC)

@jgmdev we still have a runtime dependency on to be enabled. So the install file's still needed.

jgmdev commented on 2015-12-03 17:34 (UTC)

@sanduhrs you forgot to remove php-cs-fixer.install

sanduhrs commented on 2015-12-02 09:29 (UTC)

@jgmdev good point! Changed the package accordingly, thanks. Updated to latest upstream, too.

jgmdev commented on 2015-12-02 02:41 (UTC)

Hi, prompting the user to enable and disable phar.readonly isn't necessary if you replace 'php-box build' with: php -d -d phar.readonly=0 /usr/bin/php-box build So the prepare() function and php-cs-fixer.install can be removed.

bgaleotti commented on 2015-08-15 22:43 (UTC)

@sanduhrs merged. I also added you as con-maintainer.

sanduhrs commented on 2015-08-14 21:49 (UTC)

@bgaleotti of course you are right. I moved the check to a prepare method, how about that?

bgaleotti commented on 2015-08-14 18:36 (UTC)

@sanduhrs Added the removal of git-commit. Isn't the warning at post_install too late? I mean, if you don't have configured: phar.readonly = Off it would fail at build becouse php-box won't have the build command enabled.

Stephen304 commented on 2015-08-14 01:04 (UTC)

I forgot to note but to enable the "build" command, the aforementioned edits need to go in the php.ini that resides at /etc/php/php.ini (mine reset so I'm noting this so I can fix it later if I need to) phar.readonly = Off

sanduhrs commented on 2015-08-12 17:14 (UTC)

@bgaleotti package is broken after you removed lin 19 from the pgkbuild. See And please have a look at which contains a working pkgbuild including a message about the required settings. regards.

trichards commented on 2015-08-12 16:05 (UTC)

Building 1.10-1 fails with an error from box: ==> Starting build()... <snip> [RuntimeException] The tag or commit hash could not be retrieved from "/tmp/build/php-cs-fixer/src/PHP-CS-Fixer-1.10": fatal: Not a git repository (or any parent up to mount point /tmp) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set). Complete output:

sanduhrs commented on 2015-08-10 15:17 (UTC)

Update to 1.10:

sanduhrs commented on 2015-07-21 16:03 (UTC)

Add an install hokk to inform people of the requirements:

Stephen304 commented on 2015-06-11 21:27 (UTC)

Turns out I had to set these in my php.ini phar.readonly = Off

Stephen304 commented on 2015-06-11 20:59 (UTC)

I'm getting this error on build: ==> Starting build()... Loading composer repositories with package information Installing dependencies from lock file Nothing to install or update Generating autoload files [InvalidArgumentException] Command "build" is not defined. ==> ERROR: A failure occurred in build(). Aborting... The build failed. Any idea?

falmp commented on 2014-05-12 15:53 (UTC)

Please update to move the .phar file to /usr/share/webapps/bin. You can use this PKGBUILD as template:

jamek commented on 2014-04-05 10:29 (UTC)

The new value of md5 sum: 501733ff21110855b7edb44bda998800

pecenac commented on 2013-11-28 20:45 (UTC)

The md5 sum has changed again. New value is: eb57ef273b8860aa6c98d623d206e5e7

sender commented on 2013-03-28 19:49 (UTC)

md5sum should be: f282fb798eca0b9d7b967c270c49bf13

feydaykyn commented on 2013-03-03 16:03 (UTC)

PKGBUILD 0.2-3 has a wrong checksum, here the one that's passing : 5da172ef5fe8f4d89e33870d3ecdfed3

feydaykyn commented on 2013-02-05 18:13 (UTC)

Hi, new md5sum is 3a9946b65b5bed7e40a60f4b56812ae9, so I guess there is a version bump too :-)

bgaleotti commented on 2012-09-29 21:17 (UTC)

@EpocSquadron done!

commented on 2012-09-19 21:44 (UTC)

Checksum is no longer passing, please generate new ones and update the PKGBUILD. Thanks. :)