Add code style checks.
parent
b6e5502372
commit
0346b9f29d
|
@ -1,3 +1,4 @@
|
|||
/app/vendor
|
||||
/resources/data
|
||||
/scratch
|
||||
.phpcs-cache
|
||||
|
|
|
@ -25,5 +25,14 @@
|
|||
"psr-4": {
|
||||
"RprtCli\\": "src"
|
||||
}
|
||||
},
|
||||
"require-dev": {
|
||||
"squizlabs/php_codesniffer": "^3.5",
|
||||
"phpunit/phpunit": "^9.5",
|
||||
"opsway/psr12-strict-coding-standard": "^0.5.0"
|
||||
},
|
||||
"scripts": {
|
||||
"cs": "phpcs",
|
||||
"cbf": "phpcbf"
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0"?>
|
||||
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
|
||||
|
||||
<arg name="basepath" value="."/>
|
||||
<arg name="cache" value=".phpcs-cache"/>
|
||||
<arg name="colors"/>
|
||||
<arg name="extensions" value="php"/>
|
||||
<arg name="parallel" value="10"/>
|
||||
|
||||
<!-- Show progress -->
|
||||
<arg value="p"/>
|
||||
|
||||
<!-- Paths to check -->
|
||||
<file>src</file>
|
||||
<file>test</file>
|
||||
|
||||
<!-- Include all rules from the Zend Coding Standard -->
|
||||
<rule ref="OpsWayStrictPSR12CodingStandard"/>
|
||||
</ruleset>
|
|
@ -48,14 +48,17 @@ class RprtCommand extends Command {
|
|||
return Command::SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create table from data that is already inline with configuration.
|
||||
*/
|
||||
protected function generateTable($output, $data) {
|
||||
$table = new Table($output);
|
||||
$table->setHeaders(['Project', 'Hours', 'Rate', 'Price']);
|
||||
list($rows, $total_hours, $total_price) = [[], 0, 0];
|
||||
$projects_config = $this->configuration->get('projects');
|
||||
var_dump($projects_config);
|
||||
foreach ($projects_config as $name => $config) {
|
||||
if (!isset($data[$name])) {
|
||||
// @TODO Proper error handling.
|
||||
var_dump('Project ' . $name . ' is not set!');
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -77,7 +77,6 @@ class ConfigurationService implements ConfigurationInterface
|
|||
*/
|
||||
public function getConfig() {
|
||||
if ($this->configFilePath) {
|
||||
var_dump($this->configFilePath);
|
||||
$config = Yaml::parseFile($this->configFilePath);
|
||||
$this->data = $config;
|
||||
return TRUE;
|
||||
|
|
Loading…
Reference in New Issue