Class: PhpCop::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/phpcop/cli.rb

Overview

The CLI is a class responsible of handling all the command line interface logic

Constant Summary collapse

MSG_END =
'%s fichier traité. %s erreurs.'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCLI

Returns a new instance of CLI.



12
13
14
# File 'lib/phpcop/cli.rb', line 12

def initialize
  @config_store = ConfigStore.new
end

Instance Attribute Details

#config_storeObject (readonly)

Returns the value of attribute config_store.



8
9
10
# File 'lib/phpcop/cli.rb', line 8

def config_store
  @config_store
end

Instance Method Details

#run(_args = ARGV) ⇒ Object

Run all files



17
18
19
20
# File 'lib/phpcop/cli.rb', line 17

def run(_args = ARGV)
  runner = PhpCop::Runner.new(@config_store)
  puts format(MSG_END, runner.count_files, runner.count_errors)
end