8000 fix php 8.1 compatibility ReadOnly and add toArray method annotation · thecodingmachine/tdbm@fd7de15 · GitHub
[go: up one dir, main page]

Skip to content

Commit fd7de15

Browse files
author
thp
committed
fix php 8.1 compatibility ReadOnly and add toArray method annotation
1 parent 2847c66 commit fd7de15

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

src/Utils/AbstractBeanPropertyDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
namespace TheCodingMachine\TDBM\Utils;
55

66
use Doctrine\DBAL\Schema\Table;
7-
use TheCodingMachine\TDBM\Utils\Annotation\ReadOnly;
7+
use TheCodingMachine\TDBM\Utils\Annotation\ReadOnlyColumn;
88
use Laminas\Code\Generator\DocBlock\Tag\ParamTag;
99
use Laminas\Code\Generator\MethodGenerator;
1010

src/Utils/Annotation/AnnotationParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public static function buildWithDefaultAnnotations(array $additionalAnnotations)
4343
'ProtectedGetter' => ProtectedGetter::class,
4444
'ProtectedSetter' => ProtectedSetter::class,
4545
'ProtectedOneToMany' => ProtectedOneToMany::class,
46-
'ReadOnly' => ReadOnly::class,
46+
'ReadOnly' => ReadOnlyColumn::class,
4747
'JsonKey' => JsonKey::class,
4848
'JsonIgnore' => JsonIgnore::class,
4949
'JsonInclude' => JsonInclude::class,

src/Utils/Annotation/ReadOnly.php renamed to src/Utils/Annotation/ReadOnlyColumn.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
*
1111
* @Annotation
1212
*/
13-
final class ReadOnly
13+
final class ReadOnlyColumn
1414
{
1515
}

src/Utils/BeanDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1198,7 +1198,7 @@ public function generateResultIteratorPhpCode(): ?FileGenerator
11981198
$class->setDocBlock((new DocBlockGenerator(
11991199
"The $baseClassName class will iterate over results of $beanClassWithoutNameSpace class.",
12001200
null,
1201-
[new Tag\MethodTag('getIterator', ['\\' . $beanClassName . '[]'])]
1201+
[new Tag\MethodTag('getIterator', ['\\' . $beanClassName . '[]']), new Tag\MethodTag('toArray', ['\\' . $beanClassName . '[]'])]
12021202
))->setWordWrap(false));
12031203

12041204
$file = $this->codeGeneratorListener->onBaseResultIteratorGenerated($file, $this, $this->configuration);

src/Utils/ObjectBeanPropertyDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ private function isSetterProtected(): bool
345345

346346
public function isReadOnly(): bool
347347
{
348-
return $this->findAnnotation(Annotation\ReadOnly::class) !== null;
348+
return $this->findAnnotation(Annotation\ReadOnlyColumn::class) !== null;
349349
}
350350

351351
/**

src/Utils/ScalarBeanPropertyDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ private function isSetterProtected(): bool
421421

422422
public function isReadOnly(): bool
423423
{
424-
return $this->findAnnotation(Annotation\ReadOnly::class) !== null;
424+
return $this->findAnnotation(Annotation\ReadOnlyColumn::class) !== null;
425425
}
426426

427427
private function findAnnotation(string $type): ?object

0 commit comments

Comments
 (0)
0