Skip to content

Commit

Permalink
patch
Browse files Browse the repository at this point in the history
  • Loading branch information
AnourValar committed Sep 28, 2022
1 parent cf63392 commit 200b112
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/Sheets/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ protected function shiftFormulas(array &$values, SchemaMapper &$schema, array &$
foreach ($schema->toArray()['rows'] as $action) {
foreach ($values as $row => &$columns) {
foreach ($columns as &$value) {
if (! preg_match('#^\=[A-Z][A-Z\.\d]#', $value)) {
if (! preg_match('#^\=[A-Z][A-Z\.\d]#', (string) $value)) {
continue;
}

Expand Down Expand Up @@ -443,7 +443,7 @@ function ($patterns) use ($action) {

foreach ($values as $row => &$columns) {
foreach ($columns as &$value) {
if (! preg_match('#^\=[A-Z][A-Z\.\d]#', $value)) {
if (! preg_match('#^\=[A-Z][A-Z\.\d]#', (string) $value)) {
continue;
}

Expand Down Expand Up @@ -489,7 +489,7 @@ function ($patterns) use ($action, $row, $prev) {

foreach ($values as $row => &$columns) {
foreach ($columns as &$value) {
if (! preg_match('#^\=[A-Z][A-Z\.\d]#', $value)) {
if (! preg_match('#^\=[A-Z][A-Z\.\d]#', (string) $value)) {
continue;
}

Expand Down
6 changes: 3 additions & 3 deletions src/SheetsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class SheetsService
/**
* Cell's value handler (on set)
*
* @var \Closure(SheetsInterface $driver, string $cell, mixed $value, int $sheetIndex)
* @var \Closure(SheetsInterface $driver, string $cell, mixed $value, int $sheetIndex, string $column, int $row)
*/
protected ?\Closure $hookValue = null;

Expand Down Expand Up @@ -216,10 +216,10 @@ protected function handleData(array $data, SheetsInterface $driver, int $sheetIn

if ($value instanceof \Closure) {
// Private Closure
$value = $value($driver, $column.$row);
$value = $value($driver, $column.$row, $column, $row);
} elseif ($this->hookValue) {
// Hook: value
$value = ($this->hookValue)($driver, $column.$row, $value, $sheetIndex);
$value = ($this->hookValue)($driver, $column.$row, $value, $sheetIndex, $column, $row);
}

if (! $isNull && is_null($value)) {
Expand Down

0 comments on commit 200b112

Please sign in to comment.