Fix some code style issues
This commit is contained in:
parent
1bfbcf2ffe
commit
94d1cbb09b
4
.gitignore
vendored
4
.gitignore
vendored
@ -132,6 +132,7 @@ test_config.json
|
|||||||
index.html
|
index.html
|
||||||
tests/db_files/*.db
|
tests/db_files/*.db
|
||||||
build/api/*
|
build/api/*
|
||||||
|
build/cache
|
||||||
build/coverage/*
|
build/coverage/*
|
||||||
build/logs/*
|
build/logs/*
|
||||||
build/pdepend/*
|
build/pdepend/*
|
||||||
@ -139,8 +140,9 @@ build/phpdox/*
|
|||||||
cache.properties
|
cache.properties
|
||||||
tests/settings.json
|
tests/settings.json
|
||||||
.php_cs
|
.php_cs
|
||||||
|
.phpdoc
|
||||||
coverage/*
|
coverage/*
|
||||||
vendor/*
|
vendor
|
||||||
composer.lock
|
composer.lock
|
||||||
docs/phpdoc*
|
docs/phpdoc*
|
||||||
.project
|
.project
|
||||||
|
20
RoboFile.php
20
RoboFile.php
@ -105,7 +105,7 @@ class RoboFile extends Tasks {
|
|||||||
*/
|
*/
|
||||||
public function docs(): void
|
public function docs(): void
|
||||||
{
|
{
|
||||||
$this->_run(['vendor/bin/phpdox']);
|
$this->_run(['tools/phpdox/vendor/bin/phpdox']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -128,18 +128,18 @@ class RoboFile extends Tasks {
|
|||||||
*
|
*
|
||||||
* @param bool $report - if true, generates reports instead of direct output
|
* @param bool $report - if true, generates reports instead of direct output
|
||||||
*/
|
*/
|
||||||
public function phpcs($report = FALSE): void
|
public function phpcs(bool $report = FALSE): void
|
||||||
{
|
{
|
||||||
$dir = __DIR__;
|
$dir = __DIR__;
|
||||||
|
|
||||||
$report_cmd_parts = [
|
$report_cmd_parts = [
|
||||||
'vendor/bin/phpcs',
|
'tools/vendor/bin/phpcs',
|
||||||
"--standard=./build/CodeIgniter",
|
"--standard=./build/CodeIgniter",
|
||||||
"--report-checkstyle=./build/logs/phpcs.xml",
|
"--report-checkstyle=./build/logs/phpcs.xml",
|
||||||
];
|
];
|
||||||
|
|
||||||
$normal_cmd_parts = [
|
$normal_cmd_parts = [
|
||||||
'vendor/bin/phpcs',
|
'tools/vendor/bin/phpcs',
|
||||||
"--standard=./build/CodeIgniter",
|
"--standard=./build/CodeIgniter",
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -148,10 +148,10 @@ class RoboFile extends Tasks {
|
|||||||
$this->_run($cmd_parts);
|
$this->_run($cmd_parts);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function phpmd($report = FALSE): void
|
public function phpmd(bool $report = FALSE): void
|
||||||
{
|
{
|
||||||
$report_cmd_parts = [
|
$report_cmd_parts = [
|
||||||
'vendor/bin/phpmd',
|
'tools/vendor/bin/phpmd',
|
||||||
'./src',
|
'./src',
|
||||||
'xml',
|
'xml',
|
||||||
'cleancode,codesize,controversial,design,naming,unusedcode',
|
'cleancode,codesize,controversial,design,naming,unusedcode',
|
||||||
@ -160,7 +160,7 @@ class RoboFile extends Tasks {
|
|||||||
];
|
];
|
||||||
|
|
||||||
$normal_cmd_parts = [
|
$normal_cmd_parts = [
|
||||||
'vendor/bin/phpmd',
|
'tools/vendor/bin/phpmd',
|
||||||
'./src',
|
'./src',
|
||||||
'ansi',
|
'ansi',
|
||||||
'cleancode,codesize,controversial,design,naming,unusedcode',
|
'cleancode,codesize,controversial,design,naming,unusedcode',
|
||||||
@ -181,7 +181,7 @@ class RoboFile extends Tasks {
|
|||||||
{
|
{
|
||||||
// Command for generating reports
|
// Command for generating reports
|
||||||
$report_cmd_parts = [
|
$report_cmd_parts = [
|
||||||
'vendor/bin/phploc',
|
'tools/vendor/bin/phploc',
|
||||||
'--count-tests',
|
'--count-tests',
|
||||||
'--log-csv=build/logs/phploc.csv',
|
'--log-csv=build/logs/phploc.csv',
|
||||||
'--log-xml=build/logs/phploc.xml',
|
'--log-xml=build/logs/phploc.xml',
|
||||||
@ -191,7 +191,7 @@ class RoboFile extends Tasks {
|
|||||||
|
|
||||||
// Command for generating direct output
|
// Command for generating direct output
|
||||||
$normal_cmd_parts = [
|
$normal_cmd_parts = [
|
||||||
'vendor/bin/phploc',
|
'tools/vendor/bin/phploc',
|
||||||
'--count-tests',
|
'--count-tests',
|
||||||
'src',
|
'src',
|
||||||
'tests'
|
'tests'
|
||||||
@ -284,7 +284,7 @@ class RoboFile extends Tasks {
|
|||||||
protected function phpcpdReport(): void
|
protected function phpcpdReport(): void
|
||||||
{
|
{
|
||||||
$cmd_parts = [
|
$cmd_parts = [
|
||||||
'vendor/bin/phpcpd',
|
'tools/vendor/bin/phpcpd',
|
||||||
'--log-pmd build/logs/pmd-cpd.xml',
|
'--log-pmd build/logs/pmd-cpd.xml',
|
||||||
'src'
|
'src'
|
||||||
];
|
];
|
||||||
|
@ -25,39 +25,6 @@
|
|||||||
<!-- One statement per line -->
|
<!-- One statement per line -->
|
||||||
<rule ref="Generic.Formatting.DisallowMultipleStatements"/>
|
<rule ref="Generic.Formatting.DisallowMultipleStatements"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Classes and functions should be commented -->
|
|
||||||
<rule ref="PEAR.Commenting.ClassComment">
|
|
||||||
<exclude name="PEAR.Commenting.ClassComment.MissingCategoryTag" />
|
|
||||||
<exclude name="PEAR.Commenting.ClassComment.MissingPackageTag" />
|
|
||||||
<exclude name="PEAR.Commenting.ClassComment.MissingAuthorTag" />
|
|
||||||
<exclude name="PEAR.Commenting.ClassComment.MissingLicenseTag" />
|
|
||||||
<exclude name="PEAR.Commenting.ClassComment.MissingLinkTag" />
|
|
||||||
</rule>
|
|
||||||
<rule ref="PEAR.Commenting.FunctionComment">
|
|
||||||
<!-- Exclude this sniff because it doesn't understand multiple types -->
|
|
||||||
<exclude name="PEAR.Commenting.FunctionComment.MissingParamComment" />
|
|
||||||
<exclude name="PEAR.Commenting.FunctionComment.SpacingAfterParamType" />
|
|
||||||
<exclude name="PEAR.Commenting.FunctionComment.SpacingAfterParamName" />
|
|
||||||
</rule>
|
|
||||||
|
|
||||||
<!-- Use warnings for docblock comments for files and variables, since nothing is clearly explained -->
|
|
||||||
<rule ref="PEAR.Commenting.FileComment">
|
|
||||||
<exclude name="PEAR.Commenting.FileComment.InvalidVersion" />
|
|
||||||
<exclude name="PEAR.Commenting.FileComment.MissingCategoryTag" />
|
|
||||||
<properties>
|
|
||||||
<property name="error" value="false"/>
|
|
||||||
</properties>
|
|
||||||
</rule>
|
|
||||||
|
|
||||||
<rule ref="Squiz.Commenting.FunctionCommentThrowTag"/>
|
|
||||||
<rule ref="Squiz.Commenting.VariableComment">
|
|
||||||
<properties>
|
|
||||||
<property name="error" value="false"/>
|
|
||||||
</properties>
|
|
||||||
</rule>
|
|
||||||
|
|
||||||
<!-- Use Allman style indenting. With the exception of Class declarations,
|
<!-- Use Allman style indenting. With the exception of Class declarations,
|
||||||
braces are always placed on a line by themselves, and indented at the same level as the control statement that "owns" them. -->
|
braces are always placed on a line by themselves, and indented at the same level as the control statement that "owns" them. -->
|
||||||
<rule ref="Generic.Functions.OpeningFunctionBraceBsdAllman"/>
|
<rule ref="Generic.Functions.OpeningFunctionBraceBsdAllman"/>
|
||||||
|
@ -32,15 +32,7 @@
|
|||||||
"ext-pdo": "*"
|
"ext-pdo": "*"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"consolidation/robo": "^2.0.0",
|
"phpunit/phpunit": "^9.4"
|
||||||
"monolog/monolog": "^2.0.1",
|
|
||||||
"phploc/phploc": "^7.0",
|
|
||||||
"phpmd/phpmd": "^2.8",
|
|
||||||
"phpstan/phpstan": "^0.12.2",
|
|
||||||
"phpunit/phpunit": "^9.4",
|
|
||||||
"sebastian/phpcpd": "^6.0",
|
|
||||||
"simpletest/simpletest": "^1.1",
|
|
||||||
"squizlabs/php_codesniffer": "^3.0.0"
|
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
@ -56,11 +48,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "robo build",
|
"build": "tools/vendor/bin/robo build",
|
||||||
"clean": "robo clean",
|
"clean": "tools/vendor/bin/robo clean",
|
||||||
|
"docs": "php tools/phpDocumentor run --sourcecode",
|
||||||
"coverage": "phpdbg -qrr -- vendor/bin/phpunit -c build",
|
"coverage": "phpdbg -qrr -- vendor/bin/phpunit -c build",
|
||||||
"pcov": "vendor/bin/phpunit -c build",
|
"pcov": "vendor/bin/phpunit -c build",
|
||||||
"phpstan": "phpstan analyse -l 3 -c phpstan.neon src tests",
|
"phpstan": "tools/vendor/bin/phpstan analyse -l 3 -c phpstan.neon src tests",
|
||||||
"test": "phpunit -c build --no-coverage"
|
"test": "phpunit -c build --no-coverage"
|
||||||
},
|
},
|
||||||
"scripts-descriptions": {
|
"scripts-descriptions": {
|
||||||
|
@ -25,7 +25,8 @@ enum JoinType: string {
|
|||||||
case LEFT = 'left';
|
case LEFT = 'left';
|
||||||
case RIGHT = 'right';
|
case RIGHT = 'right';
|
||||||
|
|
||||||
public static function parse(string|self $val): self {
|
public static function parse(string|self $val): self
|
||||||
|
{
|
||||||
if ($val instanceof self)
|
if ($val instanceof self)
|
||||||
{
|
{
|
||||||
return $val;
|
return $val;
|
||||||
|
@ -23,7 +23,8 @@ enum LikeType: string {
|
|||||||
case AFTER = 'after';
|
case AFTER = 'after';
|
||||||
case BOTH = 'both';
|
case BOTH = 'both';
|
||||||
|
|
||||||
public static function parse(string|self $val): self {
|
public static function parse(string|self $val): self
|
||||||
|
{
|
||||||
if ($val instanceof self)
|
if ($val instanceof self)
|
||||||
{
|
{
|
||||||
return $val;
|
return $val;
|
||||||
|
@ -100,7 +100,6 @@ namespace {
|
|||||||
* connection created.
|
* connection created.
|
||||||
*/
|
*/
|
||||||
function Query(string|object|array|null $params = ''): ?QueryBuilderInterface
|
function Query(string|object|array|null $params = ''): ?QueryBuilderInterface
|
||||||
|
|
||||||
{
|
{
|
||||||
if ($params === NULL)
|
if ($params === NULL)
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
{
|
{
|
||||||
"require": {
|
"require": {
|
||||||
"theseer/phpdox": "*"
|
"consolidation/robo": "^4.0.0",
|
||||||
|
"phploc/phploc": "^7.0",
|
||||||
|
"phpmd/phpmd": "^2.8",
|
||||||
|
"phpstan/phpstan": "^1.9.14",
|
||||||
|
"sebastian/phpcpd": "^6.0",
|
||||||
|
"squizlabs/php_codesniffer": "^3.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
5
tools/phpdox/composer.json
Normal file
5
tools/phpdox/composer.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"require": {
|
||||||
|
"theseer/phpdox": "^0.12.0"
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user