mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-10 05:58:42 +00:00
php cs autofix
This commit is contained in:
parent
9f3730c11c
commit
a559cb4e2e
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
|
|
@ -26,7 +26,7 @@ jobs:
|
||||||
- name: Setup Composer
|
- name: Setup Composer
|
||||||
run: composer install
|
run: composer install
|
||||||
- name: Autoformat
|
- name: Autoformat
|
||||||
run: 'vendor/bin/php-cs-fixer fix ./ --rules=''{"array_syntax": {"syntax": "short"}, "blank_line_after_namespace": true, "cast_spaces": {"space": "single"}, "class_attributes_separation": { "elements": ["const", "method", "property"] }, "combine_consecutive_issets": true, "compact_nullable_typehint": true, "declare_strict_types": true, "elseif": true, "encoding": true, "explicit_indirect_variable": true, "explicit_string_variable": true, "function_to_constant": true, "implode_call": true, "increment_style": {"style": "pre"}, "is_null": {"use_yoda_style": false}, "line_ending": true, "logical_operators": true, "lowercase_cast": true, "lowercase_constants": true, "lowercase_keywords": true, "modernize_types_casting": true, "native_constant_invocation": true, "native_function_casing": true, "native_function_invocation": true, "new_with_braces": true, "no_alias_functions": true, "no_closing_tag": true, "no_empty_comment": true, "no_empty_phpdoc": true, "no_empty_statement": true, "no_homoglyph_names": true, "no_mixed_echo_print": {"use": "echo"}, "no_php4_constructor": true, "no_singleline_whitespace_before_semicolons": true, "no_spaces_inside_parenthesis": true, "no_trailing_whitespace": true, "no_unneeded_final_method": true, "no_unused_imports": true, "no_useless_return": true, "no_whitespace_before_comma_in_array": true, "no_whitespace_in_blank_line": true, "non_printable_character": true, "normalize_index_brace": true, "ordered_imports": {"sort_algorithm": "alpha"}, "ordered_interfaces": {"order": "alpha"}, "php_unit_construct": true, "php_unit_internal_class": true, "php_unit_ordered_covers": true, "php_unit_set_up_tear_down_visibility": true, "phpdoc_indent": true, "phpdoc_align": {"align": "vertical"}, "phpdoc_annotation_without_dot": true, "phpdoc_scalar": true, "phpdoc_return_self_reference": {"this": "self"}, "phpdoc_trim": true, "phpdoc_trim_consecutive_blank_line_separation": true, "random_api_migration": true, "self_accessor": true, "return_type_declaration": {"space_before": "one"}, "semicolon_after_instruction": true, "set_type_to_cast": true, "short_scalar_cast": true, "single_blank_line_at_eof": true, "single_line_after_imports": true, "standardize_increment": true, "trailing_comma_in_multiline_array": true, "trim_array_spaces": true, "visibility_required": true, "void_return": true}'' --allow-risky=yes'
|
run: 'vendor/bin/php-cs-fixer fix ./ --rules=''{"array_syntax": {"syntax": "short"}, "blank_line_after_namespace": true, "binary_operator_spaces": {"operators": {"=": "align", ".=": "align", "+=": "align", "-=": "align", "*=": "align", "/=": "align", "|=": "align", "&=": "align", "=>": "align", "??=": "align"}}, "cast_spaces": {"space": "single"}, "class_attributes_separation": { "elements": ["const", "method", "property"] }, "combine_consecutive_issets": true, "compact_nullable_typehint": true, "declare_strict_types": true, "elseif": true, "encoding": true, "explicit_indirect_variable": true, "explicit_string_variable": true, "function_to_constant": true, "implode_call": true, "increment_style": {"style": "pre"}, "is_null": {"use_yoda_style": false}, "line_ending": true, "logical_operators": true, "lowercase_cast": true, "lowercase_constants": true, "lowercase_keywords": true, "modernize_types_casting": true, "native_constant_invocation": true, "native_function_casing": true, "native_function_invocation": true, "new_with_braces": true, "no_alias_functions": true, "no_closing_tag": true, "no_empty_comment": true, "no_empty_phpdoc": true, "no_empty_statement": true, "no_homoglyph_names": true, "no_mixed_echo_print": {"use": "echo"}, "no_php4_constructor": true, "no_singleline_whitespace_before_semicolons": true, "no_spaces_inside_parenthesis": true, "no_trailing_whitespace": true, "no_unneeded_final_method": true, "no_unused_imports": true, "no_useless_return": true, "no_whitespace_before_comma_in_array": true, "no_whitespace_in_blank_line": true, "non_printable_character": true, "normalize_index_brace": true, "ordered_imports": {"sort_algorithm": "alpha"}, "ordered_interfaces": {"order": "alpha"}, "php_unit_construct": true, "php_unit_internal_class": true, "php_unit_ordered_covers": true, "php_unit_set_up_tear_down_visibility": true, "phpdoc_indent": true, "phpdoc_align": {"align": "vertical"}, "phpdoc_annotation_without_dot": true, "phpdoc_scalar": true, "phpdoc_return_self_reference": {"this": "self"}, "phpdoc_trim": true, "phpdoc_trim_consecutive_blank_line_separation": true, "random_api_migration": true, "self_accessor": true, "return_type_declaration": {"space_before": "one"}, "semicolon_after_instruction": true, "set_type_to_cast": true, "short_scalar_cast": true, "single_blank_line_at_eof": true, "single_line_after_imports": true, "standardize_increment": true, "trailing_comma_in_multiline_array": true, "trim_array_spaces": true, "visibility_required": true, "void_return": true}'' --allow-risky=yes'
|
||||||
- name: Check for modified files
|
- name: Check for modified files
|
||||||
id: git-check
|
id: git-check
|
||||||
run: echo ::set-output name=modified::$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi)
|
run: echo ::set-output name=modified::$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi)
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ final class ArticleCorrelationAffinity
|
||||||
// create the affinity table
|
// create the affinity table
|
||||||
foreach ($possibleItems as $item1) {
|
foreach ($possibleItems as $item1) {
|
||||||
foreach ($possibleItems as $item2) {
|
foreach ($possibleItems as $item2) {
|
||||||
if ($item1 !== $item2 &&!isset($this->affinity[$item1][$item2]) && !isset($this->affinity[$item2][$item1])) {
|
if ($item1 !== $item2 && !isset($this->affinity[$item1][$item2]) && !isset($this->affinity[$item2][$item1])) {
|
||||||
$this->affinity[$item1][$item2] = Correlation::bravaisPersonCorrelationCoefficientPopulation($this->items[$item1], $this->items[$item2]);
|
$this->affinity[$item1][$item2] = Correlation::bravaisPersonCorrelationCoefficientPopulation($this->items[$item1], $this->items[$item2]);
|
||||||
$this->affinity[$item2][$item1] = $this->affinity[$item1][$item2];
|
$this->affinity[$item2][$item1] = $this->affinity[$item1][$item2];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1114,7 +1114,7 @@ class Builder extends BuilderAbstract
|
||||||
*/
|
*/
|
||||||
public function join($table, string $type = JoinType::JOIN, string $alias = null) : self
|
public function join($table, string $type = JoinType::JOIN, string $alias = null) : self
|
||||||
{
|
{
|
||||||
if (!\is_string($table)&& !($table instanceof self)) {
|
if (!\is_string($table) && !($table instanceof self)) {
|
||||||
throw new \InvalidArgumentException();
|
throw new \InvalidArgumentException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -90,9 +90,9 @@ class EigenvalueDecompositionTest extends \PHPUnit\Framework\TestCase
|
||||||
$eig = new EigenvalueDecomposition($A);
|
$eig = new EigenvalueDecomposition($A);
|
||||||
|
|
||||||
self::assertEqualsWithDelta([
|
self::assertEqualsWithDelta([
|
||||||
[0, 2/\sqrt(6), 1/\sqrt(3)],
|
[0, 2 / \sqrt(6), 1 / \sqrt(3)],
|
||||||
[1/\sqrt(2), -1/\sqrt(6), 1/\sqrt(3)],
|
[1 / \sqrt(2), -1 / \sqrt(6), 1 / \sqrt(3)],
|
||||||
[-1/\sqrt(2), -1/\sqrt(6), 1/\sqrt(3)],
|
[-1 / \sqrt(2), -1 / \sqrt(6), 1 / \sqrt(3)],
|
||||||
], $eig->getV()->toArray(), 0.2);
|
], $eig->getV()->toArray(), 0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -155,9 +155,9 @@ class EigenvalueDecompositionTest extends \PHPUnit\Framework\TestCase
|
||||||
$eig = new EigenvalueDecomposition($A);
|
$eig = new EigenvalueDecomposition($A);
|
||||||
|
|
||||||
self::assertEqualsWithDelta([
|
self::assertEqualsWithDelta([
|
||||||
[-\sqrt(2/3), \sqrt(2/7), -1/\sqrt(293)],
|
[-\sqrt(2 / 3), \sqrt(2 / 7), -1 / \sqrt(293)],
|
||||||
[-1/\sqrt(6), -3/\sqrt(14), -6/\sqrt(293)],
|
[-1 / \sqrt(6), -3 / \sqrt(14), -6 / \sqrt(293)],
|
||||||
[1/\sqrt(6), -1/\sqrt(14), -16/\sqrt(293)],
|
[1 / \sqrt(6), -1 / \sqrt(14), -16 / \sqrt(293)],
|
||||||
], $eig->getV()->toArray(), 0.2);
|
], $eig->getV()->toArray(), 0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ class IntegrationTest extends \PHPUnit\Framework\TestCase
|
||||||
*/
|
*/
|
||||||
public function testLRect() : void
|
public function testLRect() : void
|
||||||
{
|
{
|
||||||
self::assertEqualsWithDelta(0.235322, Integration::intLeftRect(0.0, 1.0, 100.0, function($x) { return $x**3; }), 0.001);
|
self::assertEqualsWithDelta(0.235322, Integration::intLeftRect(0.0, 1.0, 100.0, function($x) { return $x ** 3; }), 0.001);
|
||||||
self::assertEqualsWithDelta(4.654000, Integration::intLeftRect(1.0, 100.0, 1000.0, function($x) { return 1 / $x; }), 0.001);
|
self::assertEqualsWithDelta(4.654000, Integration::intLeftRect(1.0, 100.0, 1000.0, function($x) { return 1 / $x; }), 0.001);
|
||||||
//self::assertEqualsWithDelta(12499992.500730, Integration::intLeftRect(0.0, 5000.0, 5000000.0, function($x) { return $x; }), 0.001);
|
//self::assertEqualsWithDelta(12499992.500730, Integration::intLeftRect(0.0, 5000.0, 5000000.0, function($x) { return $x; }), 0.001);
|
||||||
//self::assertEqualsWithDelta(17999991.001392, Integration::intLeftRect(0.0, 6000.0, 6000000.0, function($x) { return $x; }), 0.001);
|
//self::assertEqualsWithDelta(17999991.001392, Integration::intLeftRect(0.0, 6000.0, 6000000.0, function($x) { return $x; }), 0.001);
|
||||||
|
|
@ -47,7 +47,7 @@ class IntegrationTest extends \PHPUnit\Framework\TestCase
|
||||||
*/
|
*/
|
||||||
public function testRRect() : void
|
public function testRRect() : void
|
||||||
{
|
{
|
||||||
self::assertEqualsWithDelta(0.245025, Integration::intRightRect(0.0, 1.0, 100.0, function($x) { return $x**3; }), 0.001);
|
self::assertEqualsWithDelta(0.245025, Integration::intRightRect(0.0, 1.0, 100.0, function($x) { return $x ** 3; }), 0.001);
|
||||||
self::assertEqualsWithDelta(4.555991, Integration::intRightRect(1.0, 100.0, 1000.0, function($x) { return 1 / $x; }), 0.001);
|
self::assertEqualsWithDelta(4.555991, Integration::intRightRect(1.0, 100.0, 1000.0, function($x) { return 1 / $x; }), 0.001);
|
||||||
//self::assertEqualsWithDelta(12499997.500729, Integration::intRightRect(0.0, 5000.0, 5000000.0, function($x) { return $x; }), 0.001);
|
//self::assertEqualsWithDelta(12499997.500729, Integration::intRightRect(0.0, 5000.0, 5000000.0, function($x) { return $x; }), 0.001);
|
||||||
//self::assertEqualsWithDelta(17999997.001390, Integration::intRightRect(0.0, 6000.0, 6000000.0, function($x) { return $x; }), 0.001);
|
//self::assertEqualsWithDelta(17999997.001390, Integration::intRightRect(0.0, 6000.0, 6000000.0, function($x) { return $x; }), 0.001);
|
||||||
|
|
@ -60,7 +60,7 @@ class IntegrationTest extends \PHPUnit\Framework\TestCase
|
||||||
*/
|
*/
|
||||||
public function testMRect() : void
|
public function testMRect() : void
|
||||||
{
|
{
|
||||||
self::assertEqualsWithDelta(0.240137, Integration::intMiddleRect(0.0, 1.0, 100.0, function($x) { return $x**3; }), 0.001);
|
self::assertEqualsWithDelta(0.240137, Integration::intMiddleRect(0.0, 1.0, 100.0, function($x) { return $x ** 3; }), 0.001);
|
||||||
self::assertEqualsWithDelta(4.603772, Integration::intMiddleRect(1.0, 100.0, 1000.0, function($x) { return 1 / $x; }), 0.001);
|
self::assertEqualsWithDelta(4.603772, Integration::intMiddleRect(1.0, 100.0, 1000.0, function($x) { return 1 / $x; }), 0.001);
|
||||||
//self::assertEqualsWithDelta(12499995.000729, Integration::intMiddleRect(0.0, 5000.0, 5000000.0, function($x) { return $x; }), 0.001);
|
//self::assertEqualsWithDelta(12499995.000729, Integration::intMiddleRect(0.0, 5000.0, 5000000.0, function($x) { return $x; }), 0.001);
|
||||||
//self::assertEqualsWithDelta(17999994.001391, Integration::intMiddleRect(0.0, 6000.0, 6000000.0, function($x) { return $x; }), 0.001);
|
//self::assertEqualsWithDelta(17999994.001391, Integration::intMiddleRect(0.0, 6000.0, 6000000.0, function($x) { return $x; }), 0.001);
|
||||||
|
|
@ -73,7 +73,7 @@ class IntegrationTest extends \PHPUnit\Framework\TestCase
|
||||||
*/
|
*/
|
||||||
public function testTrapeze() : void
|
public function testTrapeze() : void
|
||||||
{
|
{
|
||||||
self::assertEqualsWithDelta(0.250025, Integration::intTrapezium(0.0, 1.0, 100.0, function($x) { return $x**3; }), 0.001);
|
self::assertEqualsWithDelta(0.250025, Integration::intTrapezium(0.0, 1.0, 100.0, function($x) { return $x ** 3; }), 0.001);
|
||||||
self::assertEqualsWithDelta(4.605986, Integration::intTrapezium(1.0, 100.0, 1000.0, function($x) { return 1 / $x; }), 0.001);
|
self::assertEqualsWithDelta(4.605986, Integration::intTrapezium(1.0, 100.0, 1000.0, function($x) { return 1 / $x; }), 0.001);
|
||||||
//self::assertEqualsWithDelta(12500000.0, Integration::intTrapezium(0.0, 5000.0, 5000000.0, function($x) { return $x; }), 0.001);
|
//self::assertEqualsWithDelta(12500000.0, Integration::intTrapezium(0.0, 5000.0, 5000000.0, function($x) { return $x; }), 0.001);
|
||||||
//self::assertEqualsWithDelta(18000000.0, Integration::intTrapezium(0.0, 6000.0, 6000000.0, function($x) { return $x; }), 0.001);
|
//self::assertEqualsWithDelta(18000000.0, Integration::intTrapezium(0.0, 6000.0, 6000000.0, function($x) { return $x; }), 0.001);
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ class ExponentialDistributionTest extends \PHPUnit\Framework\TestCase
|
||||||
|
|
||||||
public function testMean() : void
|
public function testMean() : void
|
||||||
{
|
{
|
||||||
self::assertEquals(1/3, ExponentialDistribution::getMean(3));
|
self::assertEquals(1 / 3, ExponentialDistribution::getMean(3));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testMode() : void
|
public function testMode() : void
|
||||||
|
|
@ -49,7 +49,7 @@ class ExponentialDistributionTest extends \PHPUnit\Framework\TestCase
|
||||||
|
|
||||||
public function testMedian() : void
|
public function testMedian() : void
|
||||||
{
|
{
|
||||||
self::assertEquals(1/3 * \log(2), ExponentialDistribution::getMedian(3));
|
self::assertEquals(1 / 3 * \log(2), ExponentialDistribution::getMedian(3));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testMgf() : void
|
public function testMgf() : void
|
||||||
|
|
@ -62,12 +62,12 @@ class ExponentialDistributionTest extends \PHPUnit\Framework\TestCase
|
||||||
|
|
||||||
public function testVariance() : void
|
public function testVariance() : void
|
||||||
{
|
{
|
||||||
self::assertEquals(1/(3 ** 2), ExponentialDistribution::getVariance(3));
|
self::assertEquals(1 / (3 ** 2), ExponentialDistribution::getVariance(3));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testStandardDeviation() : void
|
public function testStandardDeviation() : void
|
||||||
{
|
{
|
||||||
self::assertEquals(\sqrt(1/(3 ** 2)), ExponentialDistribution::getStandardDeviation(3));
|
self::assertEquals(\sqrt(1 / (3 ** 2)), ExponentialDistribution::getStandardDeviation(3));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testExKurtosis() : void
|
public function testExKurtosis() : void
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ class GammaDistributionTest extends \PHPUnit\Framework\TestCase
|
||||||
public function testPDFIntegerK() : void
|
public function testPDFIntegerK() : void
|
||||||
{
|
{
|
||||||
self::assertEqualsWithDelta(\exp(-1), GammaDistribution::getPdfIntegerK(1, 1, 1), 0.001);
|
self::assertEqualsWithDelta(\exp(-1), GammaDistribution::getPdfIntegerK(1, 1, 1), 0.001);
|
||||||
self::assertEqualsWithDelta(3 * \exp(-3/4) / 16, GammaDistribution::getPdfIntegerK(3, 2, 4), 0.001);
|
self::assertEqualsWithDelta(3 * \exp(-3 / 4) / 16, GammaDistribution::getPdfIntegerK(3, 2, 4), 0.001);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testMeanK() : void
|
public function testMeanK() : void
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ class LogNormalDistributionTest extends \PHPUnit\Framework\TestCase
|
||||||
|
|
||||||
public function testMean() : void
|
public function testMean() : void
|
||||||
{
|
{
|
||||||
self::assertEqualsWithDelta(\exp(13/2), LogNormalDistribution::getMean(2, 3), 0.001);
|
self::assertEqualsWithDelta(\exp(13 / 2), LogNormalDistribution::getMean(2, 3), 0.001);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testVariance() : void
|
public function testVariance() : void
|
||||||
|
|
@ -38,7 +38,7 @@ class LogNormalDistributionTest extends \PHPUnit\Framework\TestCase
|
||||||
|
|
||||||
public function testStandardDeviation() : void
|
public function testStandardDeviation() : void
|
||||||
{
|
{
|
||||||
self::assertEqualsWithDelta(\exp(13/2) * \sqrt(\exp(9) - 1), LogNormalDistribution::getStandardDeviation(2, 3), 0.001);
|
self::assertEqualsWithDelta(\exp(13 / 2) * \sqrt(\exp(9) - 1), LogNormalDistribution::getStandardDeviation(2, 3), 0.001);
|
||||||
self::assertEqualsWithDelta(\sqrt((\exp(9) - 1) * \exp(13)), LogNormalDistribution::getStandardDeviation(2, 3), 0.001);
|
self::assertEqualsWithDelta(\sqrt((\exp(9) - 1) * \exp(13)), LogNormalDistribution::getStandardDeviation(2, 3), 0.001);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,13 +38,13 @@ class TDistributionTest extends \PHPUnit\Framework\TestCase
|
||||||
|
|
||||||
public function testVariance() : void
|
public function testVariance() : void
|
||||||
{
|
{
|
||||||
self::assertEqualsWithDelta(5/3, TDistribution::getVariance(5), 0.001);
|
self::assertEqualsWithDelta(5 / 3, TDistribution::getVariance(5), 0.001);
|
||||||
self::assertEqualsWithDelta(\PHP_FLOAT_MAX, TDistribution::getVariance(2), 0.001);
|
self::assertEqualsWithDelta(\PHP_FLOAT_MAX, TDistribution::getVariance(2), 0.001);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testStandardDeviation() : void
|
public function testStandardDeviation() : void
|
||||||
{
|
{
|
||||||
self::assertEqualsWithDelta(\sqrt(5/3), TDistribution::getStandardDeviation(5), 0.001);
|
self::assertEqualsWithDelta(\sqrt(5 / 3), TDistribution::getStandardDeviation(5), 0.001);
|
||||||
self::assertEqualsWithDelta(\PHP_FLOAT_MAX, TDistribution::getStandardDeviation(2), 0.001);
|
self::assertEqualsWithDelta(\PHP_FLOAT_MAX, TDistribution::getStandardDeviation(2), 0.001);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user