Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jqhph committed Dec 20, 2019
1 parent 9b42523 commit 9b05700
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

.idea/
2 changes: 1 addition & 1 deletion src/Exporters/Sheet.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public function getHeadingStyle()
* @param string $name
* @return $this
*/
public function name($name)
public function name(?string $name)
{
if (is_string($name)) {
$this->name = $name;
Expand Down
4 changes: 2 additions & 2 deletions tests/Exporters/XLSX/WithChunkQueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function testStore()
->store($storePath);

// 读取
$this->assertSingleSheet($storePath, 'Sheet1', $users);
$this->assertSingleSheet($storePath, '0', $users);

/*
|---------------------------------------------------------------
Expand Down Expand Up @@ -81,7 +81,7 @@ public function testRaw()
file_put_contents($storePath, $contents);

// 读取
$this->assertSingleSheet($storePath, 'Sheet1', $users);
$this->assertSingleSheet($storePath, '0', $users);

/*
|---------------------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion tests/Exporters/XLSX/WithSheetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public function test()
$storePath = $this->generateTempFilePath('xlsx');

$sheet = Excel::createSheet($users)
->name('test')
->headingStyle(
(new StyleBuilder)
->setFontColor(Color::BLUE)
Expand All @@ -43,7 +44,7 @@ public function test()
Excel::export($sheet)->store($storePath);

// 读取
$this->assertSingleSheet($storePath, 'Sheet1', $users);
$this->assertSingleSheet($storePath, 'test', $users);

/*
|---------------------------------------------------------------
Expand Down

0 comments on commit 9b05700

Please sign in to comment.