Use `::class` notation as much as possible

```
               *             ,
                           _/^\_
                          <     >
         *                 /.-.\         *
                  *        `/&\`                   *
                          ,@.*;@,
                         /_o.I %_\    *
            *           (`'--:o(_@;
                       /`;--.,__ `')             *
                      ;@`o % O,*`'`&\
                *    (`'--)_@ ;o %'()\      *
                     /`;--._`''--._O'@;
                    /&*,()~o`;-.,_ `""`)
         *          /`,@ ;+& () o*`;-';\
                   (`""--.,_0 +% @' &()\
                   /-.,_    ``''--....-'`)  *
              *    /@%;o`:;'--,.__   __.'\
                  ;*,&(); @ % &^;~`"`o;@();         *
                  /(); o^~; & ().o@*&`;&%O\
            jgs   `"="==""==,,,.,="=="==="`
               __.----.(\-''#####---...___...-----._
             '`         \)_`"""""`
                     .--' ')
                   o(  )_-\
                     `"""` `
```
This commit is contained in:
Adrien Crivelli 2016-12-26 13:20:45 +09:00
parent a045a446d5
commit 56245d558e
No known key found for this signature in database
GPG Key ID: B182FD79DC6DE92E
6 changed files with 377 additions and 359 deletions

File diff suppressed because it is too large Load Diff

View File

@ -31,7 +31,7 @@ class ExceptionHandler
*/ */
public function __construct() public function __construct()
{ {
set_error_handler(['\\PhpOffice\\PhpSpreadsheet\\Calculation\\Exception', 'errorHandlerCallback'], E_ALL); set_error_handler([\PhpOffice\PhpSpreadsheet\Calculation\Exception::class, 'errorHandlerCallback'], E_ALL);
} }
/** /**

View File

@ -212,7 +212,7 @@ class OLE
{ {
static $isRegistered = false; static $isRegistered = false;
if (!$isRegistered) { if (!$isRegistered) {
stream_wrapper_register('ole-chainedblockstream', '\\PhpOffice\\PhpSpreadsheet\\Shared\\OLE\\ChainedBlockStream'); stream_wrapper_register('ole-chainedblockstream', \PhpOffice\PhpSpreadsheet\Shared\OLE\ChainedBlockStream::class);
$isRegistered = true; $isRegistered = true;
} }

View File

@ -802,7 +802,7 @@ class AutoFilter
// Execute the filter test // Execute the filter test
$result = $result && $result = $result &&
call_user_func_array( call_user_func_array(
['\\PhpOffice\\PhpSpreadsheet\\Worksheet\\AutoFilter', $columnFilterTest['method']], [self::class, $columnFilterTest['method']],
[$cellValue, $columnFilterTest['arguments']] [$cellValue, $columnFilterTest['arguments']]
); );
// If filter test has resulted in FALSE, exit the loop straightaway rather than running any more tests // If filter test has resulted in FALSE, exit the loop straightaway rather than running any more tests

View File

@ -116,19 +116,19 @@ class Xlsx extends BaseWriter implements IWriter
$this->setSpreadsheet($spreadsheet); $this->setSpreadsheet($spreadsheet);
$writerPartsArray = [ $writerPartsArray = [
'stringtable' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\StringTable', 'stringtable' => \PhpOffice\PhpSpreadsheet\Writer\Xlsx\StringTable::class,
'contenttypes' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\ContentTypes', 'contenttypes' => \PhpOffice\PhpSpreadsheet\Writer\Xlsx\ContentTypes::class,
'docprops' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\DocProps', 'docprops' => \PhpOffice\PhpSpreadsheet\Writer\Xlsx\DocProps::class,
'rels' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\Rels', 'rels' => \PhpOffice\PhpSpreadsheet\Writer\Xlsx\Rels::class,
'theme' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\Theme', 'theme' => \PhpOffice\PhpSpreadsheet\Writer\Xlsx\Theme::class,
'style' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\Style', 'style' => \PhpOffice\PhpSpreadsheet\Writer\Xlsx\Style::class,
'workbook' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\Workbook', 'workbook' => \PhpOffice\PhpSpreadsheet\Writer\Xlsx\Workbook::class,
'worksheet' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\Worksheet', 'worksheet' => \PhpOffice\PhpSpreadsheet\Writer\Xlsx\Worksheet::class,
'drawing' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\Drawing', 'drawing' => \PhpOffice\PhpSpreadsheet\Writer\Xlsx\Drawing::class,
'comments' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\Comments', 'comments' => \PhpOffice\PhpSpreadsheet\Writer\Xlsx\Comments::class,
'chart' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\Chart', 'chart' => \PhpOffice\PhpSpreadsheet\Writer\Xlsx\Chart::class,
'relsvba' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\RelsVBA', 'relsvba' => \PhpOffice\PhpSpreadsheet\Writer\Xlsx\RelsVBA::class,
'relsribbonobjects' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\RelsRibbon', 'relsribbonobjects' => \PhpOffice\PhpSpreadsheet\Writer\Xlsx\RelsRibbon::class,
]; ];
// Initialise writer parts // Initialise writer parts

View File

@ -51,4 +51,13 @@ class CalculationTest extends \PHPUnit_Framework_TestCase
{ {
return Calculation::getInstance()->getFunctions(); return Calculation::getInstance()->getFunctions();
} }
public function testIsImplemented()
{
$calculation = Calculation::getInstance();
$this->assertFalse($calculation->isImplemented('non-existing-function'));
$this->assertFalse($calculation->isImplemented('AREAS'));
$this->assertTrue($calculation->isImplemented('coUNt'));
$this->assertTrue($calculation->isImplemented('abs'));
}
} }