Skip to content

Experiment to replace the large array of Excel function definitions with a FlyWeight Pattern collection of Value Objects #2714

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -121,7 +121,7 @@
'no_unneeded_final_method' => true,
'no_unreachable_default_argument_value' => true,
'no_unset_cast' => true,
'no_unset_on_property' => true,
'no_unset_on_property' => false,
'no_unused_imports' => true,
'no_useless_else' => true,
'no_useless_return' => true,
4 changes: 4 additions & 0 deletions .phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -19,4 +19,8 @@
<rule ref="PSR12">
<exclude name="PSR2.Methods.MethodDeclaration.Underscore"/>
</rule>

<rule ref="Squiz.Classes.ValidClassName.NotCamelCaps">
<exclude-pattern>*/src/PhpSpreadsheet/Calculation/Engine/Functions/*</exclude-pattern>
</rule>
</ruleset>
5 changes: 1 addition & 4 deletions bin/generate-locales
Original file line number Diff line number Diff line change
@@ -7,10 +7,7 @@ use PhpOffice\PhpSpreadsheetInfra\LocaleGenerator;
require_once 'vendor/autoload.php';

try {
$phpSpreadsheetFunctionsProperty = (new ReflectionClass(Calculation::class))
->getProperty('phpSpreadsheetFunctions');
$phpSpreadsheetFunctionsProperty->setAccessible(true);
$phpSpreadsheetFunctions = $phpSpreadsheetFunctionsProperty->getValue();
$phpSpreadsheetFunctions = Calculation::getInstance()->getFunctions();

$localeGenerator = new LocaleGenerator(
realpath(__DIR__ . '/../src/PhpSpreadsheet/Calculation/locale/'),
8 changes: 6 additions & 2 deletions infra/LocaleGenerator.php
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
namespace PhpOffice\PhpSpreadsheetInfra;

use Exception;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\ExcelFunctions;
use PhpOffice\PhpSpreadsheet\Cell\Cell;
use PhpOffice\PhpSpreadsheet\IOFactory;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
@@ -37,6 +38,9 @@ class LocaleGenerator
*/
protected $translationBaseFolder;

/**
* @var ExcelFunctions
*/
protected $phpSpreadsheetFunctions;

/**
@@ -67,7 +71,7 @@ class LocaleGenerator
public function __construct(
string $translationBaseFolder,
string $translationSpreadsheetName,
array $phpSpreadsheetFunctions,
ExcelFunctions $phpSpreadsheetFunctions,
bool $verbose = false
) {
$this->translationBaseFolder = $translationBaseFolder;
@@ -146,7 +150,7 @@ protected function buildFunctionsFileForLocale($column, $locale): void
$translationValue = $translationCell->getValue();
if ($this->isFunctionCategoryEntry($translationCell)) {
$this->writeFileSectionHeader($functionFile, "{$translationValue} ({$functionName})");
} elseif (!array_key_exists($functionName, $this->phpSpreadsheetFunctions)) {
} elseif (!$this->phpSpreadsheetFunctions->isRecognisedExcelFunction($functionName)) {
$this->log("Function {$functionName} is not defined in PhpSpreadsheet");
} elseif (!empty($translationValue)) {
$functionTranslation = "{$functionName} = {$translationValue}" . self::EOL;
5 changes: 0 additions & 5 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -215,11 +215,6 @@ parameters:
count: 1
path: src/PhpSpreadsheet/Calculation/Calculation.php

-
message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Calculation\\:\\:\\$phpSpreadsheetFunctions has no type specified\\.$#"
count: 1
path: src/PhpSpreadsheet/Calculation/Calculation.php

-
message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Calculation\\\\Calculation\\:\\:\\$returnArrayAsType has no type specified\\.$#"
count: 1
2,527 changes: 12 additions & 2,515 deletions src/PhpSpreadsheet/Calculation/Calculation.php

Large diffs are not rendered by default.

688 changes: 688 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/ExcelFunctions.php

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlAbs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Absolute;

/**
* @inheritDoc
*/
class XlAbs extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'ABS';

/**
* @var string
*/
protected $category = Category::CATEGORY_MATH_AND_TRIG;

/**
* @var callable
*/
protected $functionCall = [Absolute::class, 'evaluate'];

/**
* @var string
*/
protected $argumentCount = '1';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlAccrint.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Financial\Securities\AccruedInterest;

/**
* @inheritDoc
*/
class XlAccrint extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'ACCRINT';

/**
* @var string
*/
protected $category = Category::CATEGORY_FINANCIAL;

/**
* @var callable
*/
protected $functionCall = [AccruedInterest::class, 'periodic'];

/**
* @var string
*/
protected $argumentCount = '4-8';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlAccrintm.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Financial\Securities\AccruedInterest;

/**
* @inheritDoc
*/
class XlAccrintm extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'ACCRINTM';

/**
* @var string
*/
protected $category = Category::CATEGORY_FINANCIAL;

/**
* @var callable
*/
protected $functionCall = [AccruedInterest::class, 'atMaturity'];

/**
* @var string
*/
protected $argumentCount = '3-5';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlAcos.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Trig\Cosine;

/**
* @inheritDoc
*/
class XlAcos extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'ACOS';

/**
* @var string
*/
protected $category = Category::CATEGORY_MATH_AND_TRIG;

/**
* @var callable
*/
protected $functionCall = [Cosine::class, 'acos'];

/**
* @var string
*/
protected $argumentCount = '1';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlAcosh.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Trig\Cosine;

/**
* @inheritDoc
*/
class XlAcosh extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'ACOSH';

/**
* @var string
*/
protected $category = Category::CATEGORY_MATH_AND_TRIG;

/**
* @var callable
*/
protected $functionCall = [Cosine::class, 'acosh'];

/**
* @var string
*/
protected $argumentCount = '1';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlAcot.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Trig\Cotangent;

/**
* @inheritDoc
*/
class XlAcot extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'ACOT';

/**
* @var string
*/
protected $category = Category::CATEGORY_MATH_AND_TRIG;

/**
* @var callable
*/
protected $functionCall = [Cotangent::class, 'acot'];

/**
* @var string
*/
protected $argumentCount = '1';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlAcoth.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Trig\Cotangent;

/**
* @inheritDoc
*/
class XlAcoth extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'ACOTH';

/**
* @var string
*/
protected $category = Category::CATEGORY_MATH_AND_TRIG;

/**
* @var callable
*/
protected $functionCall = [Cotangent::class, 'acoth'];

/**
* @var string
*/
protected $argumentCount = '1';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlAddress.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\LookupRef\Address;

/**
* @inheritDoc
*/
class XlAddress extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'ADDRESS';

/**
* @var string
*/
protected $category = Category::CATEGORY_LOOKUP_AND_REFERENCE;

/**
* @var callable
*/
protected $functionCall = [Address::class, 'cell'];

/**
* @var string
*/
protected $argumentCount = '2-5';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlAggregate.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;

/**
* @inheritDoc
*/
class XlAggregate extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'AGGREGATE';

/**
* @var string
*/
protected $category = Category::CATEGORY_MATH_AND_TRIG;

/**
* @var callable
*/
protected $functionCall = [Functions::class, 'DUMMY'];

/**
* @var string
*/
protected $argumentCount = '3+';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlAmordegrc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Financial\Amortization;

/**
* @inheritDoc
*/
class XlAmordegrc extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'AMORDEGRC';

/**
* @var string
*/
protected $category = Category::CATEGORY_FINANCIAL;

/**
* @var callable
*/
protected $functionCall = [Amortization::class, 'AMORDEGRC'];

/**
* @var string
*/
protected $argumentCount = '6,7';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlAmorlinc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Financial\Amortization;

/**
* @inheritDoc
*/
class XlAmorlinc extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'AMORLINC';

/**
* @var string
*/
protected $category = Category::CATEGORY_FINANCIAL;

/**
* @var callable
*/
protected $functionCall = [Amortization::class, 'AMORLINC'];

/**
* @var string
*/
protected $argumentCount = '6,7';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlAnd.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Logical\Operations;

/**
* @inheritDoc
*/
class XlAnd extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'AND';

/**
* @var string
*/
protected $category = Category::CATEGORY_LOGICAL;

/**
* @var callable
*/
protected $functionCall = [Operations::class, 'logicalAnd'];

/**
* @var string
*/
protected $argumentCount = '1+';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlArabic.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Arabic;

/**
* @inheritDoc
*/
class XlArabic extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'ARABIC';

/**
* @var string
*/
protected $category = Category::CATEGORY_MATH_AND_TRIG;

/**
* @var callable
*/
protected $functionCall = [Arabic::class, 'evaluate'];

/**
* @var string
*/
protected $argumentCount = '1';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlAreas.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;

/**
* @inheritDoc
*/
class XlAreas extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'AREAS';

/**
* @var string
*/
protected $category = Category::CATEGORY_LOOKUP_AND_REFERENCE;

/**
* @var callable
*/
protected $functionCall = [Functions::class, 'DUMMY'];

/**
* @var string
*/
protected $argumentCount = '1';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlArraytotext.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;

/**
* @inheritDoc
*/
class XlArraytotext extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'ARRAYTOTEXT';

/**
* @var string
*/
protected $category = Category::CATEGORY_TEXT_AND_DATA;

/**
* @var callable
*/
protected $functionCall = [Functions::class, 'DUMMY'];

/**
* @var string
*/
protected $argumentCount = '?';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlAsc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;

/**
* @inheritDoc
*/
class XlAsc extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'ASC';

/**
* @var string
*/
protected $category = Category::CATEGORY_TEXT_AND_DATA;

/**
* @var callable
*/
protected $functionCall = [Functions::class, 'DUMMY'];

/**
* @var string
*/
protected $argumentCount = '1';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlAsin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Trig\Sine;

/**
* @inheritDoc
*/
class XlAsin extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'ASIN';

/**
* @var string
*/
protected $category = Category::CATEGORY_MATH_AND_TRIG;

/**
* @var callable
*/
protected $functionCall = [Sine::class, 'asin'];

/**
* @var string
*/
protected $argumentCount = '1';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlAsinh.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Trig\Sine;

/**
* @inheritDoc
*/
class XlAsinh extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'ASINH';

/**
* @var string
*/
protected $category = Category::CATEGORY_MATH_AND_TRIG;

/**
* @var callable
*/
protected $functionCall = [Sine::class, 'asinh'];

/**
* @var string
*/
protected $argumentCount = '1';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlAtan.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Trig\Tangent;

/**
* @inheritDoc
*/
class XlAtan extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'ATAN';

/**
* @var string
*/
protected $category = Category::CATEGORY_MATH_AND_TRIG;

/**
* @var callable
*/
protected $functionCall = [Tangent::class, 'atan'];

/**
* @var string
*/
protected $argumentCount = '1';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlAtan2.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Trig\Tangent;

/**
* @inheritDoc
*/
class XlAtan2 extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'ATAN2';

/**
* @var string
*/
protected $category = Category::CATEGORY_MATH_AND_TRIG;

/**
* @var callable
*/
protected $functionCall = [Tangent::class, 'atan2'];

/**
* @var string
*/
protected $argumentCount = '2';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlAtanh.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Trig\Tangent;

/**
* @inheritDoc
*/
class XlAtanh extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'ATANH';

/**
* @var string
*/
protected $category = Category::CATEGORY_MATH_AND_TRIG;

/**
* @var callable
*/
protected $functionCall = [Tangent::class, 'atanh'];

/**
* @var string
*/
protected $argumentCount = '1';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlAvedev.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Statistical\Averages;

/**
* @inheritDoc
*/
class XlAvedev extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'AVEDEV';

/**
* @var string
*/
protected $category = Category::CATEGORY_STATISTICAL;

/**
* @var callable
*/
protected $functionCall = [Averages::class, 'averageDeviations'];

/**
* @var string
*/
protected $argumentCount = '1+';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlAverage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Statistical\Averages;

/**
* @inheritDoc
*/
class XlAverage extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'AVERAGE';

/**
* @var string
*/
protected $category = Category::CATEGORY_STATISTICAL;

/**
* @var callable
*/
protected $functionCall = [Averages::class, 'average'];

/**
* @var string
*/
protected $argumentCount = '1+';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlAveragea.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Statistical\Averages;

/**
* @inheritDoc
*/
class XlAveragea extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'AVERAGEA';

/**
* @var string
*/
protected $category = Category::CATEGORY_STATISTICAL;

/**
* @var callable
*/
protected $functionCall = [Averages::class, 'averageA'];

/**
* @var string
*/
protected $argumentCount = '1+';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlAverageif.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Statistical\Conditional;

/**
* @inheritDoc
*/
class XlAverageif extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'AVERAGEIF';

/**
* @var string
*/
protected $category = Category::CATEGORY_STATISTICAL;

/**
* @var callable
*/
protected $functionCall = [Conditional::class, 'AVERAGEIF'];

/**
* @var string
*/
protected $argumentCount = '2,3';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlAverageifs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Statistical\Conditional;

/**
* @inheritDoc
*/
class XlAverageifs extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'AVERAGEIFS';

/**
* @var string
*/
protected $category = Category::CATEGORY_STATISTICAL;

/**
* @var callable
*/
protected $functionCall = [Conditional::class, 'AVERAGEIFS'];

/**
* @var string
*/
protected $argumentCount = '3+';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlBahttext.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;

/**
* @inheritDoc
*/
class XlBahttext extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'BAHTTEXT';

/**
* @var string
*/
protected $category = Category::CATEGORY_TEXT_AND_DATA;

/**
* @var callable
*/
protected $functionCall = [Functions::class, 'DUMMY'];

/**
* @var string
*/
protected $argumentCount = '1';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlBase.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Base;

/**
* @inheritDoc
*/
class XlBase extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'BASE';

/**
* @var string
*/
protected $category = Category::CATEGORY_MATH_AND_TRIG;

/**
* @var callable
*/
protected $functionCall = [Base::class, 'evaluate'];

/**
* @var string
*/
protected $argumentCount = '2,3';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlBesseli.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Engineering\BesselI;

/**
* @inheritDoc
*/
class XlBesseli extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'BESSELI';

/**
* @var string
*/
protected $category = Category::CATEGORY_ENGINEERING;

/**
* @var callable
*/
protected $functionCall = [BesselI::class, 'BESSELI'];

/**
* @var string
*/
protected $argumentCount = '2';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlBesselj.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Engineering\BesselJ;

/**
* @inheritDoc
*/
class XlBesselj extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'BESSELJ';

/**
* @var string
*/
protected $category = Category::CATEGORY_ENGINEERING;

/**
* @var callable
*/
protected $functionCall = [BesselJ::class, 'BESSELJ'];

/**
* @var string
*/
protected $argumentCount = '2';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlBesselk.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Engineering\BesselK;

/**
* @inheritDoc
*/
class XlBesselk extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'BESSELK';

/**
* @var string
*/
protected $category = Category::CATEGORY_ENGINEERING;

/**
* @var callable
*/
protected $functionCall = [BesselK::class, 'BESSELK'];

/**
* @var string
*/
protected $argumentCount = '2';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlBessely.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Engineering\BesselY;

/**
* @inheritDoc
*/
class XlBessely extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'BESSELY';

/**
* @var string
*/
protected $category = Category::CATEGORY_ENGINEERING;

/**
* @var callable
*/
protected $functionCall = [BesselY::class, 'BESSELY'];

/**
* @var string
*/
protected $argumentCount = '2';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlBeta_dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;

/**
* @inheritDoc
*/
class XlBeta_dist extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'BETA.DIST';

/**
* @var string
*/
protected $category = Category::CATEGORY_STATISTICAL;

/**
* @var callable
*/
protected $functionCall = [Functions::class, 'DUMMY'];

/**
* @var string
*/
protected $argumentCount = '4-6';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlBeta_inv.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Beta;

/**
* @inheritDoc
*/
class XlBeta_inv extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'BETA.INV';

/**
* @var string
*/
protected $category = Category::CATEGORY_STATISTICAL;

/**
* @var callable
*/
protected $functionCall = [Beta::class, 'inverse'];

/**
* @var string
*/
protected $argumentCount = '3-5';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlBetadist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Beta;

/**
* @inheritDoc
*/
class XlBetadist extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'BETADIST';

/**
* @var string
*/
protected $category = Category::CATEGORY_STATISTICAL;

/**
* @var callable
*/
protected $functionCall = [Beta::class, 'distribution'];

/**
* @var string
*/
protected $argumentCount = '3-5';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlBetainv.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Beta;

/**
* @inheritDoc
*/
class XlBetainv extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'BETAINV';

/**
* @var string
*/
protected $category = Category::CATEGORY_STATISTICAL;

/**
* @var callable
*/
protected $functionCall = [Beta::class, 'inverse'];

/**
* @var string
*/
protected $argumentCount = '3-5';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlBin2dec.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Engineering\ConvertBinary;

/**
* @inheritDoc
*/
class XlBin2dec extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'BIN2DEC';

/**
* @var string
*/
protected $category = Category::CATEGORY_ENGINEERING;

/**
* @var callable
*/
protected $functionCall = [ConvertBinary::class, 'toDecimal'];

/**
* @var string
*/
protected $argumentCount = '1';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlBin2hex.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Engineering\ConvertBinary;

/**
* @inheritDoc
*/
class XlBin2hex extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'BIN2HEX';

/**
* @var string
*/
protected $category = Category::CATEGORY_ENGINEERING;

/**
* @var callable
*/
protected $functionCall = [ConvertBinary::class, 'toHex'];

/**
* @var string
*/
protected $argumentCount = '1,2';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlBin2oct.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Engineering\ConvertBinary;

/**
* @inheritDoc
*/
class XlBin2oct extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'BIN2OCT';

/**
* @var string
*/
protected $category = Category::CATEGORY_ENGINEERING;

/**
* @var callable
*/
protected $functionCall = [ConvertBinary::class, 'toOctal'];

/**
* @var string
*/
protected $argumentCount = '1,2';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlBinom_dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Binomial;

/**
* @inheritDoc
*/
class XlBinom_dist extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'BINOM.DIST';

/**
* @var string
*/
protected $category = Category::CATEGORY_STATISTICAL;

/**
* @var callable
*/
protected $functionCall = [Binomial::class, 'distribution'];

/**
* @var string
*/
protected $argumentCount = '4';
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Binomial;

/**
* @inheritDoc
*/
class XlBinom_dist_range extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'BINOM.DIST.RANGE';

/**
* @var string
*/
protected $category = Category::CATEGORY_STATISTICAL;

/**
* @var callable
*/
protected $functionCall = [Binomial::class, 'range'];

/**
* @var string
*/
protected $argumentCount = '3,4';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlBinom_inv.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Binomial;

/**
* @inheritDoc
*/
class XlBinom_inv extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'BINOM.INV';

/**
* @var string
*/
protected $category = Category::CATEGORY_STATISTICAL;

/**
* @var callable
*/
protected $functionCall = [Binomial::class, 'inverse'];

/**
* @var string
*/
protected $argumentCount = '3';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlBinomdist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\Binomial;

/**
* @inheritDoc
*/
class XlBinomdist extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'BINOMDIST';

/**
* @var string
*/
protected $category = Category::CATEGORY_STATISTICAL;

/**
* @var callable
*/
protected $functionCall = [Binomial::class, 'distribution'];

/**
* @var string
*/
protected $argumentCount = '4';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlBitand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Engineering\BitWise;

/**
* @inheritDoc
*/
class XlBitand extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'BITAND';

/**
* @var string
*/
protected $category = Category::CATEGORY_ENGINEERING;

/**
* @var callable
*/
protected $functionCall = [BitWise::class, 'BITAND'];

/**
* @var string
*/
protected $argumentCount = '2';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlBitlshift.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Engineering\BitWise;

/**
* @inheritDoc
*/
class XlBitlshift extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'BITLSHIFT';

/**
* @var string
*/
protected $category = Category::CATEGORY_ENGINEERING;

/**
* @var callable
*/
protected $functionCall = [BitWise::class, 'BITLSHIFT'];

/**
* @var string
*/
protected $argumentCount = '2';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlBitor.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Engineering\BitWise;

/**
* @inheritDoc
*/
class XlBitor extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'BITOR';

/**
* @var string
*/
protected $category = Category::CATEGORY_ENGINEERING;

/**
* @var callable
*/
protected $functionCall = [BitWise::class, 'BITOR'];

/**
* @var string
*/
protected $argumentCount = '2';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlBitrshift.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Engineering\BitWise;

/**
* @inheritDoc
*/
class XlBitrshift extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'BITRSHIFT';

/**
* @var string
*/
protected $category = Category::CATEGORY_ENGINEERING;

/**
* @var callable
*/
protected $functionCall = [BitWise::class, 'BITRSHIFT'];

/**
* @var string
*/
protected $argumentCount = '2';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlBitxor.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Engineering\BitWise;

/**
* @inheritDoc
*/
class XlBitxor extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'BITXOR';

/**
* @var string
*/
protected $category = Category::CATEGORY_ENGINEERING;

/**
* @var callable
*/
protected $functionCall = [BitWise::class, 'BITXOR'];

/**
* @var string
*/
protected $argumentCount = '2';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlCeiling.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Ceiling;

/**
* @inheritDoc
*/
class XlCeiling extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'CEILING';

/**
* @var string
*/
protected $category = Category::CATEGORY_MATH_AND_TRIG;

/**
* @var callable
*/
protected $functionCall = [Ceiling::class, 'ceiling'];

/**
* @var string
*/
protected $argumentCount = '1-2';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlCeiling_math.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Ceiling;

/**
* @inheritDoc
*/
class XlCeiling_math extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'CEILING.MATH';

/**
* @var string
*/
protected $category = Category::CATEGORY_MATH_AND_TRIG;

/**
* @var callable
*/
protected $functionCall = [Ceiling::class, 'math'];

/**
* @var string
*/
protected $argumentCount = '1-3';
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Ceiling;

/**
* @inheritDoc
*/
class XlCeiling_precise extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'CEILING.PRECISE';

/**
* @var string
*/
protected $category = Category::CATEGORY_MATH_AND_TRIG;

/**
* @var callable
*/
protected $functionCall = [Ceiling::class, 'precise'];

/**
* @var string
*/
protected $argumentCount = '1,2';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlCell.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;

/**
* @inheritDoc
*/
class XlCell extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'CELL';

/**
* @var string
*/
protected $category = Category::CATEGORY_INFORMATION;

/**
* @var callable
*/
protected $functionCall = [Functions::class, 'DUMMY'];

/**
* @var string
*/
protected $argumentCount = '1,2';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlChar.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\TextData\CharacterConvert;

/**
* @inheritDoc
*/
class XlChar extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'CHAR';

/**
* @var string
*/
protected $category = Category::CATEGORY_TEXT_AND_DATA;

/**
* @var callable
*/
protected $functionCall = [CharacterConvert::class, 'character'];

/**
* @var string
*/
protected $argumentCount = '1';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlChidist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\ChiSquared;

/**
* @inheritDoc
*/
class XlChidist extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'CHIDIST';

/**
* @var string
*/
protected $category = Category::CATEGORY_STATISTICAL;

/**
* @var callable
*/
protected $functionCall = [ChiSquared::class, 'distributionRightTail'];

/**
* @var string
*/
protected $argumentCount = '2';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlChiinv.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\ChiSquared;

/**
* @inheritDoc
*/
class XlChiinv extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'CHIINV';

/**
* @var string
*/
protected $category = Category::CATEGORY_STATISTICAL;

/**
* @var callable
*/
protected $functionCall = [ChiSquared::class, 'inverseRightTail'];

/**
* @var string
*/
protected $argumentCount = '2';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlChisq_dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\ChiSquared;

/**
* @inheritDoc
*/
class XlChisq_dist extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'CHISQ.DIST';

/**
* @var string
*/
protected $category = Category::CATEGORY_STATISTICAL;

/**
* @var callable
*/
protected $functionCall = [ChiSquared::class, 'distributionLeftTail'];

/**
* @var string
*/
protected $argumentCount = '3';
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\ChiSquared;

/**
* @inheritDoc
*/
class XlChisq_dist_rt extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'CHISQ.DIST.RT';

/**
* @var string
*/
protected $category = Category::CATEGORY_STATISTICAL;

/**
* @var callable
*/
protected $functionCall = [ChiSquared::class, 'distributionRightTail'];

/**
* @var string
*/
protected $argumentCount = '2';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlChisq_inv.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\ChiSquared;

/**
* @inheritDoc
*/
class XlChisq_inv extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'CHISQ.INV';

/**
* @var string
*/
protected $category = Category::CATEGORY_STATISTICAL;

/**
* @var callable
*/
protected $functionCall = [ChiSquared::class, 'inverseLeftTail'];

/**
* @var string
*/
protected $argumentCount = '2';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlChisq_inv_rt.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\ChiSquared;

/**
* @inheritDoc
*/
class XlChisq_inv_rt extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'CHISQ.INV.RT';

/**
* @var string
*/
protected $category = Category::CATEGORY_STATISTICAL;

/**
* @var callable
*/
protected $functionCall = [ChiSquared::class, 'inverseRightTail'];

/**
* @var string
*/
protected $argumentCount = '2';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlChisq_test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\ChiSquared;

/**
* @inheritDoc
*/
class XlChisq_test extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'CHISQ.TEST';

/**
* @var string
*/
protected $category = Category::CATEGORY_STATISTICAL;

/**
* @var callable
*/
protected $functionCall = [ChiSquared::class, 'test'];

/**
* @var string
*/
protected $argumentCount = '2';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlChitest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\ChiSquared;

/**
* @inheritDoc
*/
class XlChitest extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'CHITEST';

/**
* @var string
*/
protected $category = Category::CATEGORY_STATISTICAL;

/**
* @var callable
*/
protected $functionCall = [ChiSquared::class, 'test'];

/**
* @var string
*/
protected $argumentCount = '2';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlChoose.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\LookupRef\Selection;

/**
* @inheritDoc
*/
class XlChoose extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'CHOOSE';

/**
* @var string
*/
protected $category = Category::CATEGORY_LOOKUP_AND_REFERENCE;

/**
* @var callable
*/
protected $functionCall = [Selection::class, 'CHOOSE'];

/**
* @var string
*/
protected $argumentCount = '2+';
}
30 changes: 30 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlChoosecols.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;

class XlChoosecols extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'CHOOSECOLS';

/**
* @var string
*/
protected $category = Category::CATEGORY_MATH_AND_TRIG;

/**
* @var callable
*/
protected $functionCall = [Functions::class, 'DUMMY'];

/**
* @var string
*/
protected $argumentCount = '2+';
}
30 changes: 30 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlChooserows.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;

class XlChooserows extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'CHOOSEROWS';

/**
* @var string
*/
protected $category = Category::CATEGORY_MATH_AND_TRIG;

/**
* @var callable
*/
protected $functionCall = [Functions::class, 'DUMMY'];

/**
* @var string
*/
protected $argumentCount = '2+';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlClean.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\TextData\Trim;

/**
* @inheritDoc
*/
class XlClean extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'CLEAN';

/**
* @var string
*/
protected $category = Category::CATEGORY_TEXT_AND_DATA;

/**
* @var callable
*/
protected $functionCall = [Trim::class, 'nonPrintable'];

/**
* @var string
*/
protected $argumentCount = '1';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlCode.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\TextData\CharacterConvert;

/**
* @inheritDoc
*/
class XlCode extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'CODE';

/**
* @var string
*/
protected $category = Category::CATEGORY_TEXT_AND_DATA;

/**
* @var callable
*/
protected $functionCall = [CharacterConvert::class, 'code'];

/**
* @var string
*/
protected $argumentCount = '1';
}
38 changes: 38 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlColumn.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlPassByReference;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlPassCellReference;
use PhpOffice\PhpSpreadsheet\Calculation\LookupRef\RowColumnInformation;

/**
* @inheritDoc
*/
class XlColumn extends XlFunctionAbstract
{
use XlPassByReference;
use XlPassCellReference;

/**
* @var string
*/
protected $name = 'COLUMN';

/**
* @var string
*/
protected $category = Category::CATEGORY_LOOKUP_AND_REFERENCE;

/**
* @var callable
*/
protected $functionCall = [RowColumnInformation::class, 'COLUMN'];

/**
* @var string
*/
protected $argumentCount = '-1';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlColumns.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\LookupRef\RowColumnInformation;

/**
* @inheritDoc
*/
class XlColumns extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'COLUMNS';

/**
* @var string
*/
protected $category = Category::CATEGORY_LOOKUP_AND_REFERENCE;

/**
* @var callable
*/
protected $functionCall = [RowColumnInformation::class, 'COLUMNS'];

/**
* @var string
*/
protected $argumentCount = '1';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlCombin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Combinations;

/**
* @inheritDoc
*/
class XlCombin extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'COMBIN';

/**
* @var string
*/
protected $category = Category::CATEGORY_MATH_AND_TRIG;

/**
* @var callable
*/
protected $functionCall = [Combinations::class, 'withoutRepetition'];

/**
* @var string
*/
protected $argumentCount = '2';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlCombina.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Combinations;

/**
* @inheritDoc
*/
class XlCombina extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'COMBINA';

/**
* @var string
*/
protected $category = Category::CATEGORY_MATH_AND_TRIG;

/**
* @var callable
*/
protected $functionCall = [Combinations::class, 'withRepetition'];

/**
* @var string
*/
protected $argumentCount = '2';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlComplex.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Engineering\Complex;

/**
* @inheritDoc
*/
class XlComplex extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'COMPLEX';

/**
* @var string
*/
protected $category = Category::CATEGORY_ENGINEERING;

/**
* @var callable
*/
protected $functionCall = [Complex::class, 'COMPLEX'];

/**
* @var string
*/
protected $argumentCount = '2,3';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlConcat.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\TextData\Concatenate;

/**
* @inheritDoc
*/
class XlConcat extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'CONCAT';

/**
* @var string
*/
protected $category = Category::CATEGORY_TEXT_AND_DATA;

/**
* @var callable
*/
protected $functionCall = [Concatenate::class, 'CONCATENATE'];

/**
* @var string
*/
protected $argumentCount = '1+';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlConcatenate.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\TextData\Concatenate;

/**
* @inheritDoc
*/
class XlConcatenate extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'CONCATENATE';

/**
* @var string
*/
protected $category = Category::CATEGORY_TEXT_AND_DATA;

/**
* @var callable
*/
protected $functionCall = [Concatenate::class, 'CONCATENATE'];

/**
* @var string
*/
protected $argumentCount = '1+';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlConfidence.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Statistical\Confidence;

/**
* @inheritDoc
*/
class XlConfidence extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'CONFIDENCE';

/**
* @var string
*/
protected $category = Category::CATEGORY_STATISTICAL;

/**
* @var callable
*/
protected $functionCall = [Confidence::class, 'CONFIDENCE'];

/**
* @var string
*/
protected $argumentCount = '3';
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Statistical\Confidence;

/**
* @inheritDoc
*/
class XlConfidence_norm extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'CONFIDENCE.NORM';

/**
* @var string
*/
protected $category = Category::CATEGORY_STATISTICAL;

/**
* @var callable
*/
protected $functionCall = [Confidence::class, 'CONFIDENCE'];

/**
* @var string
*/
protected $argumentCount = '3';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlConfidence_t.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;

/**
* @inheritDoc
*/
class XlConfidence_t extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'CONFIDENCE.T';

/**
* @var string
*/
protected $category = Category::CATEGORY_STATISTICAL;

/**
* @var callable
*/
protected $functionCall = [Functions::class, 'DUMMY'];

/**
* @var string
*/
protected $argumentCount = '3';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlConvert.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Engineering\ConvertUOM;

/**
* @inheritDoc
*/
class XlConvert extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'CONVERT';

/**
* @var string
*/
protected $category = Category::CATEGORY_ENGINEERING;

/**
* @var callable
*/
protected $functionCall = [ConvertUOM::class, 'CONVERT'];

/**
* @var string
*/
protected $argumentCount = '3';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlCorrel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Statistical\Trends;

/**
* @inheritDoc
*/
class XlCorrel extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'CORREL';

/**
* @var string
*/
protected $category = Category::CATEGORY_STATISTICAL;

/**
* @var callable
*/
protected $functionCall = [Trends::class, 'CORREL'];

/**
* @var string
*/
protected $argumentCount = '2';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlCos.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Trig\Cosine;

/**
* @inheritDoc
*/
class XlCos extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'COS';

/**
* @var string
*/
protected $category = Category::CATEGORY_MATH_AND_TRIG;

/**
* @var callable
*/
protected $functionCall = [Cosine::class, 'cos'];

/**
* @var string
*/
protected $argumentCount = '1';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlCosh.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Trig\Cosine;

/**
* @inheritDoc
*/
class XlCosh extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'COSH';

/**
* @var string
*/
protected $category = Category::CATEGORY_MATH_AND_TRIG;

/**
* @var callable
*/
protected $functionCall = [Cosine::class, 'cosh'];

/**
* @var string
*/
protected $argumentCount = '1';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlCot.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Trig\Cotangent;

/**
* @inheritDoc
*/
class XlCot extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'COT';

/**
* @var string
*/
protected $category = Category::CATEGORY_MATH_AND_TRIG;

/**
* @var callable
*/
protected $functionCall = [Cotangent::class, 'cot'];

/**
* @var string
*/
protected $argumentCount = '1';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlCoth.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Trig\Cotangent;

/**
* @inheritDoc
*/
class XlCoth extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'COTH';

/**
* @var string
*/
protected $category = Category::CATEGORY_MATH_AND_TRIG;

/**
* @var callable
*/
protected $functionCall = [Cotangent::class, 'coth'];

/**
* @var string
*/
protected $argumentCount = '1';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlCount.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Statistical\Counts;

/**
* @inheritDoc
*/
class XlCount extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'COUNT';

/**
* @var string
*/
protected $category = Category::CATEGORY_STATISTICAL;

/**
* @var callable
*/
protected $functionCall = [Counts::class, 'COUNT'];

/**
* @var string
*/
protected $argumentCount = '1+';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlCounta.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Statistical\Counts;

/**
* @inheritDoc
*/
class XlCounta extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'COUNTA';

/**
* @var string
*/
protected $category = Category::CATEGORY_STATISTICAL;

/**
* @var callable
*/
protected $functionCall = [Counts::class, 'COUNTA'];

/**
* @var string
*/
protected $argumentCount = '1+';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlCountblank.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Statistical\Counts;

/**
* @inheritDoc
*/
class XlCountblank extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'COUNTBLANK';

/**
* @var string
*/
protected $category = Category::CATEGORY_STATISTICAL;

/**
* @var callable
*/
protected $functionCall = [Counts::class, 'COUNTBLANK'];

/**
* @var string
*/
protected $argumentCount = '1';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlCountif.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Statistical\Conditional;

/**
* @inheritDoc
*/
class XlCountif extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'COUNTIF';

/**
* @var string
*/
protected $category = Category::CATEGORY_STATISTICAL;

/**
* @var callable
*/
protected $functionCall = [Conditional::class, 'COUNTIF'];

/**
* @var string
*/
protected $argumentCount = '2';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlCountifs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Statistical\Conditional;

/**
* @inheritDoc
*/
class XlCountifs extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'COUNTIFS';

/**
* @var string
*/
protected $category = Category::CATEGORY_STATISTICAL;

/**
* @var callable
*/
protected $functionCall = [Conditional::class, 'COUNTIFS'];

/**
* @var string
*/
protected $argumentCount = '2+';
}
33 changes: 33 additions & 0 deletions src/PhpSpreadsheet/Calculation/Engine/Functions/XlCoupdaybs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engine\Functions;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use PhpOffice\PhpSpreadsheet\Calculation\Engine\XlFunctionAbstract;
use PhpOffice\PhpSpreadsheet\Calculation\Financial\Coupons;

/**
* @inheritDoc
*/
class XlCoupdaybs extends XlFunctionAbstract
{
/**
* @var string
*/
protected $name = 'COUPDAYBS';

/**
* @var string
*/
protected $category = Category::CATEGORY_FINANCIAL;

/**
* @var callable
*/
protected $functionCall = [Coupons::class, 'COUPDAYBS'];

/**
* @var string
*/
protected $argumentCount = '3,4';
}
Loading