Release 2.25 (#5109)
This commit is contained in:
@@ -22,7 +22,7 @@ class DemoFull
|
||||
#[Exporter\Expose(name: 'fake-name', label: 'Protected-Property', type: 'boolean')]
|
||||
protected bool $protectedProperty = false;
|
||||
#[Exporter\Expose(label: 'Private-Property', type: 'integer', translationDomain: 'test')]
|
||||
private int $privateProperty = 123; // @phpstan-ignore-line
|
||||
private int $privateProperty = 123; // @phpstan-ignore property.onlyWritten
|
||||
|
||||
#[Exporter\Expose(label: 'Public-Method')]
|
||||
public function publicMethod(): string
|
||||
@@ -47,7 +47,7 @@ class DemoFull
|
||||
return 12345;
|
||||
}
|
||||
|
||||
// @phpstan-ignore-next-line
|
||||
// @phpstan-ignore method.unused
|
||||
#[Exporter\Expose(name: 'fake-method', label: 'Private-Method', type: 'boolean', translationDomain: 'bar')]
|
||||
private function privateMethod(): bool
|
||||
{
|
||||
|
||||
@@ -14,5 +14,5 @@ use App\Export\Annotation as Exporter;
|
||||
class ExpressionOnProperty
|
||||
{
|
||||
#[Exporter\Expose(name: 'accessor', label: 'accessor', exp: 'object.foo')]
|
||||
private $foo; // @phpstan-ignore-line
|
||||
private $foo; // @phpstan-ignore missingType.property, property.unused
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ class AnnotationExtractorTest extends TestCase
|
||||
$this->expectException(ExtractorException::class);
|
||||
$this->expectExceptionMessage('AnnotationExtractor needs a non-empty class name for work');
|
||||
|
||||
/* @phpstan-ignore-next-line */
|
||||
/* @phpstan-ignore argument.type */
|
||||
$sut->extract(new \stdClass());
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ class MetaFieldExtractorTest extends TestCase
|
||||
$this->expectException(ExtractorException::class);
|
||||
$this->expectExceptionMessage('MetaFieldExtractor needs a MetaDisplayEventInterface instance for work');
|
||||
|
||||
/* @phpstan-ignore-next-line */
|
||||
/* @phpstan-ignore argument.type */
|
||||
$sut->extract(new \stdClass());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ class UserPreferenceExtractorTest extends TestCase
|
||||
$this->expectException(ExtractorException::class);
|
||||
$this->expectExceptionMessage('UserPreferenceExtractor needs a UserPreferenceDisplayEvent instance for work');
|
||||
|
||||
/* @phpstan-ignore-next-line */
|
||||
/* @phpstan-ignore argument.type */
|
||||
$sut->extract(new \stdClass());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,12 +28,18 @@ class SpreadsheetExporterTest extends TestCase
|
||||
$sut->registerCellFormatter('foo', new class() implements CellFormatterInterface {
|
||||
public function setFormattedValue(Worksheet $sheet, int $column, int $row, $value): void
|
||||
{
|
||||
if (!\is_scalar($value)) {
|
||||
throw new \InvalidArgumentException('Only scalar values are supported');
|
||||
}
|
||||
$sheet->setCellValue([$column, $row], '##' . $value . '##');
|
||||
}
|
||||
});
|
||||
$sut->registerCellFormatter('bar', new class() implements CellFormatterInterface {
|
||||
public function setFormattedValue(Worksheet $sheet, int $column, int $row, $value): void
|
||||
{
|
||||
if (!\is_scalar($value)) {
|
||||
throw new \InvalidArgumentException('Only scalar values are supported');
|
||||
}
|
||||
$sheet->setCellValue([$column, $row], '~' . $value . '~');
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user