profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/MarkBaker/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

MarkBaker/PHPComplex 1262

PHP Class for handling Complex numbers

MarkBaker/PHPMatrix 1098

PHP Class for handling Matrices

MarkBaker/PHPGeodetic 20

PHPGeodetic is a library written in PHP, providing a set of classes for the handling of Geodetic Latitude/Longitude, ECEF and UTM coordinates, and conversions between datums

MarkBaker/GeneratorQuadTrees 9

QuadTree classes with the search() method implemented as a PHP 5.5 Generator

MarkBaker/GeneratorFunctionExamples 8

Examples of using filter(), map() and reduce() functions for Generators, and equivalent functionality for filter and map using SPL Iterators with Generators

MarkBaker/phpnw15Zephir 1

Zephir tutorial for PHPNW2015

MarkBaker/Benford 0

PHP Class for working with Benford's Law and distributions

MarkBaker/composer 0

Dependency Manager for PHP

pull request commentPHPOffice/PhpSpreadsheet

Very Minor Simplification to Matrix Functions

The good news is that there's a lot less problems (so far) with 8.1 than there were with 8.0

oleibman

comment created time in 5 days

pull request commentPHPOffice/PhpSpreadsheet

Very Minor Simplification to Matrix Functions

shivammathur indicates that he's changed his cache settings for the PHP setup, so it should now be good to pick up the changes to composer for deprecations

oleibman

comment created time in 5 days

issue commentcomposer/composer

Deprecation notices with PHP 8.1

I'm getting deprecation notices with 8.1 as well:

PHP Deprecated:  Return type of Symfony\Component\Console\Helper\HelperSet::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/vendor/symfony/console/Helper/HelperSet.php on line 112
Deprecation Notice: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///usr/local/bin/composer/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:48
Deprecation Notice: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/src/Composer/Repository/ArrayRepository.php:286
Deprecation Notice: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/src/Composer/Repository/WritableArrayRepository.php:286
Deprecation Notice: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/src/Composer/Repository/InstalledFilesystemRepository.php:286
Deprecation Notice: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///usr/local/bin/composer/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:48
Deprecated: Return type of Symfony\Component\Console\Helper\HelperSet::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/vendor/symfony/console/Helper/HelperSet.php on line 112
/home/runner/.cache/composer/files

I'm not sure that these are directly related though, and if your changes will resolve my deprecation notices

sebastianbergmann

comment created time in 5 days

pull request commentPHPOffice/PhpSpreadsheet

Very Minor Simplification to Matrix Functions

Looks like Jordi is already aware of the issue #10008 and has created a fix; but the CI runner is using shivammathur's PHP setup, which is daily cached, so hasn't yet picked up the composer fixes... hopefully it should have resolved itself by tomorrow.

I just wish that Github Actions provided a rerun button for failed pipeline tasks, rather than requiring a new push to trigger a run

oleibman

comment created time in 5 days

pull request commentPHPOffice/PhpSpreadsheet

Very Minor Simplification to Matrix Functions

Something in the nightly build has broken composer:

PHP Deprecated:  Return type of Symfony\Component\Console\Helper\HelperSet::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/vendor/symfony/console/Helper/HelperSet.php on line 112
Deprecation Notice: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///usr/local/bin/composer/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:48
Deprecation Notice: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/src/Composer/Repository/ArrayRepository.php:286
Deprecation Notice: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/src/Composer/Repository/WritableArrayRepository.php:286
Deprecation Notice: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/src/Composer/Repository/InstalledFilesystemRepository.php:286
Deprecation Notice: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///usr/local/bin/composer/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:48
Deprecated: Return type of Symfony\Component\Console\Helper\HelperSet::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/composer/vendor/symfony/console/Helper/HelperSet.php on line 112
/home/runner/.cache/composer/files
oleibman

comment created time in 5 days

issue commentPHPOffice/PhpSpreadsheet

Keep leading 0 in postal code for csv export file

MS Excel's CSV loader will always convert a numeric string into a number value when the csv file is opened in Excel; that's behaviour that only Microsoft could change. The only way to retain that formatting is to use the Data/Get&Transform/FromCSV option inside MS Excel that allows you to specify the rules for import of the different columns

adam314315

comment created time in 5 days

IssuesEvent

issue closedPHPOffice/PhpSpreadsheet

XLSX crashes with autor issue because of illigal offset (array)

This is:


- [ X] a bug report


### What is the expected behavior?

   read the excel proper and handle authorlist issues...

### What is the current behavior?

 "exception": [
        {
            "type": "TypeError",
            "code": 0,
            "message": "Illegal offset type",
            "file": "C:\\REPOS\\Eis20\\eis-pro-backend\\vendor\\phpoffice\\phpspreadsheet\\src\\PhpSpreadsheet\\Reader\\Xlsx.php",
            "line": 884
        }
    ]

### Solution /quickfix

**FILE : PhpOffice\PhpSpreadsheet\Reader\Xlsx.php
LINES 880 - 887**

  // Loop through contents
  foreach ($commentsFile->commentList->comment as $comment) {
      $commentModel = $docSheet->getComment((string) $comment['ref']);
      if (!empty($comment['authorId'] 
      **// !!! prove  for the existent key in the authors array
          && in_array($comment['authorId'], $authors))) {**
          $commentModel->setAuthor($authors[$comment['authorId']]);
      }
      $commentModel->setText($this->parseRichText($comment->text));
  }

closed time in 8 days

Leycarno

Pull request review commentPHPOffice/PhpSpreadsheet

Skip inner loops for empty/default read filter

 public function load(?IReadFilter $readFilter = null, $readDataOnly = false): vo             $rowsAttributes = $this->readRowAttributes($this->worksheetXml->sheetData->row, $readDataOnly);         } +        if ($readFilter !== null && get_class($readFilter) === DefaultReadFilter::class) {+            $readFilter = null;

If it makes a measurable difference, wouldn't it be better to simply have the defaultFilter as null in the BaseReader rather than defaulting it to the DefaultReadFilter?

rvanvelzen

comment created time in 12 days

PullRequestReviewEvent
PullRequestReviewEvent

issue commentPHPOffice/PhpSpreadsheet

formula error with worksheet containing German Umlaute (äöü)

It won't be soon, because it's a fairly major change... the equivalent of switching from a language that had only ever used scalar datatypes before to using objects with properties. I've had a brief look at it, but it isn't at the top of my "todo" list, which includes the new array functions, new operators like implicit row intersection and spillage, and new functions like LAMBDA() and LET()

G-Kevin

comment created time in 12 days

issue commentPHPOffice/PhpSpreadsheet

formula error with worksheet containing German Umlaute (äöü)

There's no missing operator between the first/second elements of the stack array, this is reverse polish notation.

The problem lies in the formula =IF(Wettdaten[[#This Row],[Status]]="","", IF(OR(Wettdaten[[#This Row],[Status]]="Offen",Wettdaten[[#This Row],[Status]]="ToDo"),0, Wettdaten[[#This Row],[Zurück]]-Wettdaten[[#This Row],[Einsatz]])) which is using newer features of Excel calculation that haven't yet been implemented in PHPSpreadsheet's calculation engine. The use of expressions like [[#This Row],[Status]] suggests that you are using Excel's new Data Types that were introduced for Office365

G-Kevin

comment created time in 12 days

issue commentPHPOffice/PhpSpreadsheet

formula error with worksheet containing German Umlaute (äöü)

The umlaute should not cause any problem; and I've just tested to verify that: once with a spreadsheet created using PHPSpreadsheet itself, and once with a spreadsheet created using MS Excel.

Also, the error that you're getting Konten!AB16 -> Konten!AC16 -> Übersicht!S57 -> Formula Error shows a calculation "chain"; the Formula error occurs when trying to evaluate cell Übersicht!S57, which is referenced in a formula in cell Konten!AC16, which is referenced by the formula in cell Konten!AB16; so (for whatever reason) PHPSpreadsheet's Calculation Engine believes that Übersicht!S57 contains a formula.

The Calculation Engine does have a built in debugger, similar to Excel's . and this gist demonstrates how to use it. You might try loading your file and using the debug output from that to help diagnose the problem.

Without more information, such as having a sample spreadsheet that demonstrates this problem, I'm unable to determine what the cause could be; but it certainly isn't that PHPspreadsheet can't handle an umlaute .

G-Kevin

comment created time in 13 days

issue commentPHPOffice/PhpSpreadsheet

formula error with worksheet containing German Umlaute (äöü)

And what is the formula in cell Übersicht!S57?

G-Kevin

comment created time in 13 days

issue closedPHPOffice/PhpSpreadsheet

Resolve new Xlsx changes introduced by MS Office365 moving AutoFilter information into a separate file

This is:

- [ ] a bug report
- [X] a feature request
- [ ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)

What is the expected behavior?

AutoFilter structure information is now maintained in a separate /table<n>.xml file in the /tables subfolder of the zip.

What is the current behavior?

AutoFilter structure information is read from the autoFilters entry in the individual worksheet files.

With changes to the structure of Xlsx files for Office365, autoFilter structure information is moved from the worksheet file. Instead, the worksheet file contains a tableParts entry:

<tableParts count="1">
    <tablePart r:id="rId1"/>
</tableParts>

This may contain multiple parts, and each entry points to an entry in the rels file for that worksheet. This in turn has a pointer to the actual file

<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
    <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/table" Target="../tables/table1.xml"/>
</Relationships>

where the AutoFilter structure is stored.

The actual structural definition of the AutoFilter is otherwise identical, simply moved to a new location.

closed time in 15 days

MarkBaker

push eventPHPOffice/PhpSpreadsheet

Mark Baker

commit sha 15170cf8cdfb40b31baf94f76729bf256fb94459

Issue 2216 resolve office365 auto filter structure move (#2218) * Initial adjustments to Xlsx Reader for two possible locations for AutoFiter information, either on the sheet itself for older files, or in the tables/tableX file for more recent files * Refactor AutoFilter Reader logic into separate methods; preparatory work toward the eventual goal of moving it into its own dedicated AutoFilterTables class * Basic unit tests to verify that the Xlsx Reader can read both the older and Office365 variants of the files used to store AutoFilter structure

view details

push time in 15 days

PR merged PHPOffice/PhpSpreadsheet

Issue 2216 resolve office365 auto filter structure move

This is:

- [X] a bugfix
- [ ] a new feature

Checklist:

  • [X] Changes are covered by unit tests
  • [X] Code style is respected
  • [X] Commit message explains why the change is made (see https://github.com/erlang/otp/wiki/Writing-good-commit-messages)
  • [ ] CHANGELOG.md contains a short summary of the change
  • [ ] Documentation is updated as necessary

Why this change is needed?

With Office365, MS have changed the way that autofilter structures are defined in the Xml, moving information from the worksheet file to a separate tables file, as described in Issue #2216

+152 -2

0 comment

5 changed files

MarkBaker

pr closed time in 15 days

push eventPHPOffice/PhpSpreadsheet

oleibman

commit sha 8729a68338ac23f95595d5a3177d4a6df0ea58f7

Xls Reader Handle MACCENTRALEUROPE With or Without Hyphen (#2213) * Xls Reader Handle MACCENTRALEUROPE With or Without Hyphen Fixes issue #549 and https://github.com/Maatwebsite/Laravel-Excel/issues/989 (which is the source of the new test file). Some systems accept MACCENTRALEUROPE as the name for the appropriate encoding, and some accept MAC-CENTRALEUROPE. I fortunately have access to at least one of each type, and have run the tests on each. CodePage.php has an array of translations from codepage number to string. I now allow the value to itself be an array; if so, the code will test each in turn to see if it can be used in iconv. I did not go fishing for other similar problems. If such show up, they can be dealt with in the same manner as this one. I don't really expect others, since this is a problem not merely for Xls, but, even then, it applies only to BIFF5 and earlier. I also moved XlsTest from Reader to Reader/Xls. * Cache Successful Result For Future Use Per suggestion from @MarkBaker

view details

Mark Baker

commit sha 3babc6cd11d09c2e4690a472c1f8967545fc6a93

Merge branch 'master' into Issue-2216-Resolve-Office365-AutoFilter-Structure-Move

view details

push time in 15 days

push eventPHPOffice/PhpSpreadsheet

oleibman

commit sha 8729a68338ac23f95595d5a3177d4a6df0ea58f7

Xls Reader Handle MACCENTRALEUROPE With or Without Hyphen (#2213) * Xls Reader Handle MACCENTRALEUROPE With or Without Hyphen Fixes issue #549 and https://github.com/Maatwebsite/Laravel-Excel/issues/989 (which is the source of the new test file). Some systems accept MACCENTRALEUROPE as the name for the appropriate encoding, and some accept MAC-CENTRALEUROPE. I fortunately have access to at least one of each type, and have run the tests on each. CodePage.php has an array of translations from codepage number to string. I now allow the value to itself be an array; if so, the code will test each in turn to see if it can be used in iconv. I did not go fishing for other similar problems. If such show up, they can be dealt with in the same manner as this one. I don't really expect others, since this is a problem not merely for Xls, but, even then, it applies only to BIFF5 and earlier. I also moved XlsTest from Reader to Reader/Xls. * Cache Successful Result For Future Use Per suggestion from @MarkBaker

view details

push time in 15 days

PR merged PHPOffice/PhpSpreadsheet

Xls Reader Handle MACCENTRALEUROPE With or Without Hyphen

Fixes issue #549 and https://github.com/Maatwebsite/Laravel-Excel/issues/989 (which is the source of the new test file). Some systems accept MACCENTRALEUROPE as the name for the appropriate encoding, and some accept MAC-CENTRALEUROPE. I fortunately have access to at least one of each type, and have run the tests on each.

CodePage.php has an array of translations from codepage number to string. I now allow the value to itself be an array; if so, the code will test each in turn to see if it can be used in iconv. I did not go fishing for other similar problems. If such show up, they can be dealt with in the same manner as this one. I don't really expect others, since this is a problem not merely for Xls, but, even then, it applies only to BIFF5 and earlier.

I also moved XlsTest from Reader to Reader/Xls.

This is:

- [x] a bugfix
- [ ] a new feature

Checklist:

  • [x] Changes are covered by unit tests
  • [x] Code style is respected
  • [x] Commit message explains why the change is made (see https://github.com/erlang/otp/wiki/Writing-good-commit-messages)
  • [ ] CHANGELOG.md contains a short summary of the change
  • [ ] Documentation is updated as necessary

Why this change is needed?

+76 -21

0 comment

6 changed files

oleibman

pr closed time in 15 days

push eventoleibman/PhpSpreadsheet

Mark Baker

commit sha 3ddd12a49b501c9fddd251982f1f48de22e01b03

Update complex numbe library to version 3 (#2198)

view details

oleibman

commit sha 49e97f0914e7f0d5d3ed7ef7d228566c1af7a0a1

Correct Some Problems Which Will Show Up for PHP8.1 (#2191) * Reader/Gnumeric vs. Scrutinizer Just reviewing Scrutinizer's list of "bugs". There are 19 ascribed to me. For some, I will definitely take no action (e.g. use of bitwise operators in AND, OR, and XOR functions). However, where I can clean things up so that Scrutinizer is satisfied and the resulting code is not too contorted, I will make an attempt. I believe this is the only one with which will involve more than 2 or 3 changes. It fixes 5 items ascribed to me, and 4 to others. * Use Strict Checking for in_array * Correct Some Problems Which Will Show Up for PHP8.1 PHP8.1 wants to issue a message when you use a float where it thinks you ought to be using an int (it wants its implicit casts made explicit). This is causing unit tests to fail. The following corrections are made in this PR: - Calculation.php tests `isset(self::binaryOperators[$token])`, where token can be a float. No numeric values are members of that array, so we can test for numeric before isset. - SharedOle.php packs a float, intending it as an int, in 2 places. I simplified the logic here, and added explicit casts to avoid the problem. This is used by Xls Reader and Writer; as added confirmation, I added some timestamps from before 1970 (i.e. negative values) to Document/EpochTest. Because of this, the test suite has been verified for 32-bit PHP as well as PHP 8.1. - Writer/Xlsx/StringTable tests `isset($aFlippedStringTable[$cellValue])`. This is the same problem as in Calculation, but requires a different solution. The same if statement here also tests that the datatype is string, but it does so after the isset test. Changing the order of these tests avoids the problem. * Update OLE.php

view details

oleibman

commit sha 2ae948a31915c19e2748d26845eee8f4bb012302

Reader/Slk vs. Scrutinizer/Phpstan (#2192) Just reviewing Scrutinizer's list of "bugs". There are 19 ascribed to me. For some, I will definitely take no action (e.g. use of bitwise operators in AND, OR, and XOR functions). However, where I can clean things up so that Scrutinizer is satisfied and the resulting code is not too contorted, I will make an attempt. This PR corrects 3 problems (2 mine) according to Scrutinizer, and 7 per Phpstan. It also moves the Reader Slk tests under their own directory, as is the case for all the other Reader types.

view details

Owen Leibman

commit sha 435ac30b471e151121821745062a9efdc09487a7

Reader/Html vs. Scrutinizer/Phpstan Just reviewing Scrutinizer's list of "bugs". There are 19 ascribed to me. For some, I will definitely take no action (e.g. use of bitwise operators in AND, OR, and XOR functions). However, where I can clean things up so that Scrutinizer is satisfied and the resulting code is not too contorted, I will make an attempt. This PR corrects 2 problems according to Scrutinizer, and about 30 per Phpstan.

view details

Owen Leibman

commit sha b03544469bebe9111f36b442fd6b22146aaa5378

2 Tests vs. Scrutinizer/Phpstan Just reviewing Scrutinizer's list of "bugs". There are 19 ascribed to me. For some, I will definitely take no action (e.g. use of bitwise operators in AND, OR, and XOR functions). However, where I can clean things up so that Scrutinizer is satisfied and the resulting code is not too contorted, I will make an attempt. This PR corrects 2 problems according to Scrutinizer, and 1 per Phpstan. Only test members are involved.

view details

Owen Leibman

commit sha 560e9a885c5c353f626ac6cf722ab0f7a997eec8

CashFlow/Variable/NonPeriodic vs. Scrutinizer/Phpstan Just reviewing Scrutinizer's list of "bugs". There are 19 ascribed to me. For some, I will definitely take no action (e.g. use of bitwise operators in AND, OR, and XOR functions). However, where I can clean things up so that Scrutinizer is satisfied and the resulting code is not too contorted, I will make an attempt. This is the last of this set of changes. It corrects 2 problems according to Scrutinizer, and about 20 per Phpstan.

view details

MarkBaker

commit sha 10a69f998372e8a339f81b97b197a7260f890dd2

Update matrix library to version 3

view details

oleibman

commit sha 075cecd268f11ee612e8c0a968ae54385f526c79

Xlsx Reader Better Namespace Handling Phase 1 First Bugfix (#2204) See issue #2203. An undotted i uncrossed t. When using namespaces, need to call attributes() to access the attributes before trying to access them directly. Failure to do so in castToFormula caused problem for shared formulas. Surprisingly, this didn't show up in unit tests. Perhaps sharing the same formula between two cells isn't common. It did show up in Chart Samples. I've added a test. I was really inclined to merge this right away. Not to worry - I can control myself. It should be moved fairly quickly nevertheless.

view details

Mark Baker

commit sha e2c13bad3044abc68361e28b18203d8f1539ee03

Merge branch 'master' into maceurope

view details

push time in 15 days

push eventPHPOffice/PhpSpreadsheet

MarkBaker

commit sha 7a6a8ac5ffdc79afef52cef24b6c884b9db1be19

Additional test assertions when autofilter structure is defined in the worksheet file

view details

push time in 15 days

PullRequestReviewEvent

Pull request review commentPHPOffice/PhpSpreadsheet

Xls Reader Handle MACCENTRALEUROPE With or Without Hyphen

 public static function validate(string $codePage): bool      */     public static function numberToName(int $codePage): string     {-        if (array_key_exists($codePage, self::$pageArray)) {-            return self::$pageArray[$codePage];+        if (array_key_exists($codePage, self::PAGE_ARRAY)) {+            $value = self::PAGE_ARRAY[$codePage];+            if (is_array($value)) {+                foreach ($value as $encoding) {+                    if (@iconv('UTF-8', $encoding, ' ') !== false) {

Is there any way that we could identify which of the possible charsets for a codepage value is being used on the first request for a file, and then cache that result so that we don't have to do the check for every single request? It's not critical, because it's never going to be more than 3 requests per file, but just wondering.

oleibman

comment created time in 16 days

PullRequestReviewEvent
PullRequestReviewEvent

push eventPHPOffice/PhpSpreadsheet

MarkBaker

commit sha 013b095d58f27df2263f663cea2ad524ae035f0e

Additional test assertions

view details

push time in 16 days