MetadataHandler::handle()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
declare(strict_types=1);
3
4
namespace MisterIcy\ExcelWriter\Handlers;
5
6
use MisterIcy\ExcelWriter\Generator\BasicGenerator;
7
use MisterIcy\ExcelWriter\Generator\GeneratorInterface;
8
9
/**
10
 * Class MetadataHandler
11
 * @package MisterIcy\ExcelWriter\Handlers
12
 */
13
final class MetadataHandler extends AbstractHandler
14
{
15
    /**
16
     * @param BasicGenerator $generator
17
     * @return HandlerInterface
18
     */
19
    public function handle(GeneratorInterface $generator)
20
    {
21
        $spreadsheet = $generator->getSpreadsheet();
0 ignored issues
show
Bug introduced by
The method getSpreadsheet() does not exist on MisterIcy\ExcelWriter\Generator\GeneratorInterface. Since it exists in all sub-types, consider adding an abstract or default implementation to MisterIcy\ExcelWriter\Generator\GeneratorInterface. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

21
        /** @scrutinizer ignore-call */ 
22
        $spreadsheet = $generator->getSpreadsheet();
Loading history...
22
        $spreadsheet->getProperties()
23
            ->setCreator('mistericy/excel-writer');
24
25
        return parent::handle($generator); // TODO: Change the autogenerated stub
26
    }
27
}
28