Skip to content

Commit

Permalink
patch
Browse files Browse the repository at this point in the history
  • Loading branch information
AnourValar committed Dec 20, 2024
1 parent 09b0c9e commit 0fc44c1
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ composer require anourvalar/office
### Phpspreadsheet is required to work with Excel (xlsx).

```bash
composer require phpoffice/phpspreadsheet "^1.29"
composer require phpoffice/phpspreadsheet "^3.6"
```

### Zipstream-php is required to work with Word (docx).
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"require-dev": {
"phpunit/phpunit": "^10.0",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan": "^2.0",
"friendsofphp/php-cs-fixer": "^3.26",
"squizlabs/php_codesniffer": "^3.7",
"vimeo/psalm": "^5.17"
Expand Down
11 changes: 9 additions & 2 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ parameters:
- src
- tests

# The level 9 is the highest level
# The level 10 is the highest level
level: 5

ignoreErrors:
Expand Down Expand Up @@ -32,16 +32,23 @@ parameters:
- '#Match expression does not handle remaining value: mixed#'
- '#Access to an undefined property AnourValar\\Office\\Drivers\\MixInterface\:\:\$spreadsheet#'
- '#Call to an undefined method AnourValar\\Office\\Drivers\\MixInterface\:\:sheet\(\)#'
- '#Call to an undefined method#'
- '#Offset numeric\-string on list\<string> in isset\(\) does not exist\.#'
- '#Format\:\:Docx is always true#'
- '#string\, \(float\|int\) given#'
- '#SaveInterface given\.#'

excludePaths:

checkFunctionNameCase: true
checkInternalClassCaseSensitivity: true
checkAlwaysTrueInstanceof: true
reportMaybesInMethodSignatures: true
reportStaticMethodSignatures: true
checkUninitializedProperties: true
checkDynamicProperties: true
reportAlwaysTrueInLastCondition: true
reportWrongPhpDocTypeInVarTag: true
checkMissingCallableSignature: true
reportPossiblyNonexistentGeneralArrayOffset: true
reportPossiblyNonexistentConstantArrayOffset: true
reportAnyTypeWideningInVarTag: true
2 changes: 1 addition & 1 deletion src/Generated.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Generated
/**
* Handle template's saving
*
* @var \Closure(\AnourValar\Office\Drivers\SaveInterface $driver, \AnourValar\Office\Format $format)
* @var \Closure(\AnourValar\Office\Drivers\SaveInterface $driver, \AnourValar\Office\Format $format): void
*/
protected ?\Closure $hookSave = null;

Expand Down
8 changes: 4 additions & 4 deletions src/GridService.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,28 @@ class GridService
/**
* Actions with template before data inserted
*
* @var \Closure(GridInterface $driver, array &$headers, iterable &$data, string $leftTopCorner)
* @var \Closure(GridInterface $driver, array &$headers, iterable &$data, string $leftTopCorner): void
*/
protected ?\Closure $hookBefore = null;

/**
* Header handler
*
* @var \Closure(GridInterface $driver, mixed $header, string|int $key, string $column)
* @var \Closure(GridInterface $driver, mixed $header, string|int $key, string $column): string
*/
protected ?\Closure $hookHeader = null;

/**
* Row data handler
*
* @var \Closure(GridInterface $driver, mixed $row, string|int $key)
* @var \Closure(GridInterface $driver, mixed $row, string|int $key): array
*/
protected ?\Closure $hookRow = null;

/**
* Actions with template after data inserted
*
* @var \Closure(GridInterface $driver, ?string $headersRange, ?string $dataRange, ?string $totalRange, array $columns)
* @var \Closure(GridInterface $driver, ?string $headersRange, ?string $dataRange, ?string $totalRange, array $columns): void
*/
protected ?\Closure $hookAfter = null;

Expand Down
6 changes: 3 additions & 3 deletions src/SheetsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@ class SheetsService
/**
* Actions with template before data inserted
*
* @var \Closure(SheetsInterface $driver, array &$data)
* @var \Closure(SheetsInterface $driver, array &$data): void
*/
protected ?\Closure $hookBefore = null;

/**
* Cell's value handler (on set)
*
* @var \Closure(SheetsInterface $driver, string $column, int $row, mixed $value, int $sheetIndex)
* @var \Closure(SheetsInterface $driver, string $column, int $row, mixed $value, int $sheetIndex): mixed
*/
protected ?\Closure $hookValue = null;

/**
* Actions with template after data inserted
*
* @var \Closure(SheetsInterface $driver)
* @var \Closure(SheetsInterface $driver): void
*/
protected ?\Closure $hookAfter = null;

Expand Down

0 comments on commit 0fc44c1

Please sign in to comment.