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

Php7cc task does not work correctly #296

Closed
lucalbert opened this issue Feb 15, 2017 · 2 comments
Closed

Php7cc task does not work correctly #296

lucalbert opened this issue Feb 15, 2017 · 2 comments
Labels

Comments

@lucalbert
Copy link

Q A
Bug yes

My configuration

parameters:
    git_dir: .
    bin_dir: vendor/bin
    tasks:
      php7cc: ~

Composer file

{
  "require-dev" : {
    "phpro/grumphp" : "^0.11.1",
    "sstalle/php7cc": "^1.1"
  }
}

Test files

<?php
// bad.php
$a = mktime(5, 5, 5, 5, 5, 2000, -1);
<?php
// good.php
$a = mktime(5, 5, 5, 5, 5, 2000);

Run Php7cc standalone:

./vendor/bin/php7cc --except=vendor .

Result

File: bad.php
> Line 2: Removed argument $is_dst used for function "mktime"
    mktime(5, 5, 5, 5, 5, 2000, -1);

Checked 2 files in 0.023 second

Run GrumPHP:

./vendor/bin/grumphp run -vvv

Result:

[2017-02-15 12:32:13] GrumPHP.INFO: run command: ls-files ""  [] []
[2017-02-15 12:32:14] GrumPHP.DEBUG: last command (ls-files) duration: 207.75ms [] []
[2017-02-15 12:32:14] GrumPHP.DEBUG: last command (ls-files) return code: 0 [] []
[2017-02-15 12:32:14] GrumPHP.DEBUG: last command (ls-files) output: bad.php composer.json good.php grumphp.yml  [] []
GrumPHP is sniffing your code!
Running task 1/1: Php7cc
Command: 'vendor/bin/php7cc' 'bad.php' 'good.php'

                          ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
           ▄▄▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌           
         ▄▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌
        ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌
        ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌        
  ▄▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌
 ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌        
 ▐█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌        
   ▀█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌        
     ▀▀▓▓▓▓▓▓▓▓▓▓▓▓█▀▀▀▀▀▀▀▀▀▀▀▀▀▀████████████▄
      ▄████████▀▀▀▀▀                 ██████████   
     ███████▀                         ██████▀
      ▐████      ██▌          ██       ████▌      
        ▐█▌                            ███        
         █▌           ▄▄ ▄▄           ▐███        
        ███       ▄▄▄▄▄▄▄▄▄▄▄▄       ▐███         
         ██▄ ▐███████████████████████████
        █▀█████████▌▀▀▀▀▀▀▀▀▀██████████▌▐         
          ███████████▄▄▄▄▄▄▄███████████▌          
         ▐█████████████████████████████           
          █████████████████████████████           
           ██ █████████████████████▐██▀           
            ▀ ▐███████████████████▌ ▐▀            
                ████▀████████▀▐███                
                 ▀█▌  ▐█████  ▐█▌                 
                        ██▀   ▐▀                  
       _    _ _                         _ _
      / \  | | |   __ _  ___   ___   __| | |
     / _ \ | | |  / _` |/ _ \ / _ \ / _` | |
    / ___ \| | | | (_| | (_) | (_) | (_| |_|
   /_/   \_\_|_|  \__, |\___/ \___/ \__,_(_)
                  |___/

But all is not good :(

@veewee veewee added the bug label Feb 16, 2017
@veewee
Copy link
Contributor

veewee commented Feb 16, 2017

Thanks for reporting @lucalbert,

We'll have to dig into this one.

@jyggen
Copy link
Contributor

jyggen commented Feb 20, 2017

The issue seems to be due to php7cc always returning exit code 0.

@jyggen jyggen mentioned this issue Feb 20, 2017
veewee referenced this issue Feb 24, 2017
Only fail when errors are raised
@veewee veewee added this to the Version 0.11.3 milestone Feb 24, 2017
@veewee veewee closed this as completed Feb 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants