<s> import logging <EOL> import os <EOL> import functools <EOL> from lintreview . tools import Tool <EOL> from lintreview . tools import run_command <EOL> from lintreview . utils import composer_exists , in_path <EOL> log = logging . getLogger ( __name__ ) <EOL> class Phpcs ( Tool ) : <EOL> name = '<STR_LIT>' <EOL> def check_dependencies ( self ) : <EOL> """<STR_LIT>""" <EOL> return in_path ( '<STR_LIT>' ) or composer_exists ( '<STR_LIT>' ) <EOL> def match_file ( self , filename ) : <EOL> base = os . path . basename ( filename ) <EOL> name , ext = os . path . splitext ( base ) <EOL> return ext == '<STR_LIT>' <EOL> def process_files ( self , files ) : <EOL> """<STR_LIT>""" <EOL> log . debug ( '<STR_LIT>' , files , self . name ) <EOL> command = self . create_command ( files ) <EOL> output = run_command ( <EOL> command , <EOL> ignore_error = True , <EOL> include_errors = False ) <EOL> filename_converter = functools . partial ( <EOL> self . _relativize_filename , <EOL> files ) <EOL> self . _process_checkstyle ( output , filename_converter ) <EOL> def create_command ( self , files ) : <EOL> command = [ '<STR_LIT>' ] <EOL> if composer_exists ( '<STR_LIT>' ) : <EOL> command = [ '<STR_LIT>' ] <EOL> command += [ '<STR_LIT>' ] <EOL> standard = '<STR_LIT>' <EOL> if self . options . get ( '<STR_LIT>' ) : <EOL> standard = self . apply_base ( self . options [ '<STR_LIT>' ] ) <EOL> extension = '<STR_LIT>' <EOL> if self . options . get ( '<STR_LIT>' ) : <EOL> extension = self . options [ '<STR_LIT>' ] <EOL> command += [ '<STR_LIT>' + standard ] <EOL> command += [ '<STR_LIT>' + extension ] <EOL> if self . options . get ( '<STR_LIT>' ) : <EOL> command += [ '<STR_LIT>' + self . options [ '<STR_LIT>' ] ] <EOL> command += files <EOL> return command </s>
