Skip to content

Commit b1b453e

Browse files
committed
MappedObject is an interface instead of abstract class
1 parent c775245 commit b1b453e

34 files changed

+135
-169
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ use Orisai\ObjectMapper\MappedObject;
4646
use Orisai\ObjectMapper\Attributes\Expect\MappedObjectValue;
4747
use Orisai\ObjectMapper\Attributes\Expect\StringValue;
4848

49-
final class UserInput extends MappedObject
49+
final class UserInput implements MappedObject
5050
{
5151

5252
/** @StringValue(notEmpty=true) */
@@ -64,7 +64,7 @@ final class UserInput extends MappedObject
6464
```php
6565
use Orisai\ObjectMapper\MappedObject;
6666

67-
final class UserAddressInput extends MappedObject
67+
final class UserAddressInput implements MappedObject
6868
{
6969
// ...
7070
}

docs/README.md

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ After you have finished [setup](#setup), define a mapped object:
104104
use Orisai\ObjectMapper\MappedObject;
105105
use Orisai\ObjectMapper\Attributes\Expect\StringValue;
106106

107-
final class UserInput extends MappedObject
107+
final class UserInput implements MappedObject
108108
{
109109

110110
/** @StringValue(notEmpty=true) */
@@ -171,7 +171,7 @@ Expects bool
171171
use Orisai\ObjectMapper\Attributes\Expect\BoolValue;
172172
use Orisai\ObjectMapper\MappedObject;
173173

174-
final class BoolInput extends MappedObject
174+
final class BoolInput implements MappedObject
175175
{
176176

177177
/** @BoolValue() */
@@ -209,7 +209,7 @@ Expects any of cases from given list
209209
use Orisai\ObjectMapper\Attributes\Expect\ArrayEnumValue;
210210
use Orisai\ObjectMapper\MappedObject;
211211

212-
final class ArrayEnumInput extends MappedObject
212+
final class ArrayEnumInput implements MappedObject
213213
{
214214

215215
public const Cases = [
@@ -256,7 +256,7 @@ Expects float or int
256256
use Orisai\ObjectMapper\Attributes\Expect\FloatValue;
257257
use Orisai\ObjectMapper\MappedObject;
258258

259-
final class FloatInput extends MappedObject
259+
final class FloatInput implements MappedObject
260260
{
261261

262262
/** @FloatValue() */
@@ -310,7 +310,7 @@ use Orisai\ObjectMapper\Attributes\Expect\InstanceOfValue;
310310
use Orisai\ObjectMapper\MappedObject;
311311
use stdClass;
312312

313-
final class InstanceofInput extends MappedObject
313+
final class InstanceofInput implements MappedObject
314314
{
315315

316316
/** @InstanceOfValue(stdClass::class) */
@@ -342,7 +342,7 @@ Expects int
342342
use Orisai\ObjectMapper\Attributes\Expect\IntValue;
343343
use Orisai\ObjectMapper\MappedObject;
344344

345-
final class IntInput extends MappedObject
345+
final class IntInput implements MappedObject
346346
{
347347

348348
/** @IntValue() */
@@ -393,7 +393,7 @@ Expects any value
393393
use Orisai\ObjectMapper\Attributes\Expect\MixedValue;
394394
use Orisai\ObjectMapper\MappedObject;
395395

396-
final class MixedInput extends MappedObject
396+
final class MixedInput implements MappedObject
397397
{
398398

399399
/**
@@ -425,7 +425,7 @@ Expects null
425425
use Orisai\ObjectMapper\Attributes\Expect\NullValue;
426426
use Orisai\ObjectMapper\MappedObject;
427427

428-
final class NullInput extends MappedObject
428+
final class NullInput implements MappedObject
429429
{
430430

431431
/**
@@ -468,7 +468,7 @@ use Orisai\ObjectMapper\Attributes\Expect\NullValue;
468468
use Orisai\ObjectMapper\Attributes\Expect\StringValue;
469469
use Orisai\ObjectMapper\MappedObject;
470470

471-
final class NullInput extends MappedObject
471+
final class NullInput implements MappedObject
472472
{
473473

474474
/**
@@ -500,7 +500,7 @@ Expects any object
500500
use Orisai\ObjectMapper\Attributes\Expect\ObjectValue;
501501
use Orisai\ObjectMapper\MappedObject;
502502

503-
final class ObjectInput extends MappedObject
503+
final class ObjectInput implements MappedObject
504504
{
505505

506506
/** @ObjectValue() */
@@ -529,7 +529,7 @@ Expects any scalar value - int|float|string|bool
529529
use Orisai\ObjectMapper\Attributes\Expect\ScalarValue;
530530
use Orisai\ObjectMapper\MappedObject;
531531

532-
final class ScalarInput extends MappedObject
532+
final class ScalarInput implements MappedObject
533533
{
534534

535535
/**
@@ -561,7 +561,7 @@ Expects string
561561
use Orisai\ObjectMapper\Attributes\Expect\StringValue;
562562
use Orisai\ObjectMapper\MappedObject;
563563

564-
final class StringInput extends MappedObject
564+
final class StringInput implements MappedObject
565565
{
566566

567567
/** @StringValue() */
@@ -621,7 +621,7 @@ use Orisai\ObjectMapper\Attributes\Expect\StringValue;
621621
use Orisai\ObjectMapper\Attributes\Expect\Url;
622622
use Orisai\ObjectMapper\MappedObject;
623623

624-
final class AllOfInput extends MappedObject
624+
final class AllOfInput implements MappedObject
625625
{
626626

627627
/**
@@ -661,7 +661,7 @@ use Orisai\ObjectMapper\Attributes\Expect\NullValue;
661661
use Orisai\ObjectMapper\Attributes\Expect\StringValue;
662662
use Orisai\ObjectMapper\MappedObject;
663663

664-
final class AnyOfInput extends MappedObject
664+
final class AnyOfInput implements MappedObject
665665
{
666666

667667
/**
@@ -703,7 +703,7 @@ use Orisai\ObjectMapper\Attributes\Expect\MixedValue;
703703
use Orisai\ObjectMapper\Attributes\Expect\StringValue;
704704
use Orisai\ObjectMapper\MappedObject;
705705

706-
final class ArrayOfInput extends MappedObject
706+
final class ArrayOfInput implements MappedObject
707707
{
708708

709709
/**
@@ -772,7 +772,7 @@ use Orisai\ObjectMapper\Attributes\Expect\StringValue;
772772
use Orisai\ObjectMapper\Attributes\Expect\MixedValue;
773773
use Orisai\ObjectMapper\MappedObject;
774774

775-
final class ListOfInput extends MappedObject
775+
final class ListOfInput implements MappedObject
776776
{
777777

778778
/**
@@ -837,7 +837,7 @@ Expects value of a `BackedEnum` case
837837
use Orisai\ObjectMapper\Attributes\Expect\BackedEnumValue;
838838
use Orisai\ObjectMapper\MappedObject;
839839

840-
final class BackedEnumInput extends MappedObject
840+
final class BackedEnumInput implements MappedObject
841841
{
842842

843843
#[BackedEnumValue(ExampleEnum::class)]
@@ -882,7 +882,7 @@ use Orisai\ObjectMapper\Attributes\Expect\BackedEnumValue;
882882
use Orisai\ObjectMapper\Attributes\Expect\StringValue;
883883
use Orisai\ObjectMapper\MappedObject;
884884

885-
final class BackedEnumInput extends MappedObject
885+
final class BackedEnumInput implements MappedObject
886886
{
887887

888888
#[AnyOf([
@@ -914,7 +914,7 @@ use DateTimeImmutable;
914914
use Orisai\ObjectMapper\Attributes\Expect\DateTimeValue;
915915
use Orisai\ObjectMapper\MappedObject;
916916

917-
final class DateTimeInput extends MappedObject
917+
final class DateTimeInput implements MappedObject
918918
{
919919

920920
/** @DateTimeValue() */
@@ -967,15 +967,15 @@ use Orisai\ObjectMapper\Attributes\Expect\MappedObjectValue;
967967
use Orisai\ObjectMapper\Attributes\Expect\StringValue;
968968
use Orisai\ObjectMapper\MappedObject;
969969

970-
final class MappedObjectInput extends MappedObject
970+
final class MappedObjectInput implements MappedObject
971971
{
972972

973973
/** @MappedObjectValue(InnerInput::class) */
974974
public InnerInput $field;
975975

976976
}
977977

978-
class InnerInput extends MappedObject
978+
class InnerInput implements MappedObject
979979
{
980980

981981
/**
@@ -1010,7 +1010,7 @@ Expects valid url address
10101010
use Orisai\ObjectMapper\Attributes\Expect\Url;
10111011
use Orisai\ObjectMapper\MappedObject;
10121012

1013-
final class UrlInput extends MappedObject
1013+
final class UrlInput implements MappedObject
10141014
{
10151015

10161016
/** @Url() */
@@ -1039,7 +1039,7 @@ Each field can be made optional by assigning default value to property:
10391039
use Orisai\ObjectMapper\Attributes\Expect\StringValue;
10401040
use Orisai\ObjectMapper\MappedObject;
10411041

1042-
final class OptionalInput extends MappedObject
1042+
final class OptionalInput implements MappedObject
10431043
{
10441044

10451045
/** @StringValue() */
@@ -1055,7 +1055,7 @@ which are impossible to send:
10551055
use Orisai\ObjectMapper\Attributes\Expect\StringValue;
10561056
use Orisai\ObjectMapper\MappedObject;
10571057

1058-
final class AnotherOptionalInput extends MappedObject
1058+
final class AnotherOptionalInput implements MappedObject
10591059
{
10601060

10611061
/** @StringValue() */
@@ -1076,7 +1076,7 @@ use Orisai\ObjectMapper\Attributes\Expect\NullValue;
10761076
use Orisai\ObjectMapper\Attributes\Expect\StringValue;
10771077
use Orisai\ObjectMapper\MappedObject;
10781078

1079-
final class NullableVariantsInput extends MappedObject
1079+
final class NullableVariantsInput implements MappedObject
10801080
{
10811081

10821082
/**
@@ -1148,7 +1148,7 @@ Unknown fields are removed from data and are not available in mapped object.
11481148
```php
11491149
use Orisai\ObjectMapper\MappedObject;
11501150

1151-
final class WithUnknownValuesInput extends MappedObject
1151+
final class WithUnknownValuesInput implements MappedObject
11521152
{
11531153

11541154
}
@@ -1183,7 +1183,7 @@ use Orisai\ObjectMapper\Attributes\Expect\MappedObjectValue;
11831183
use Orisai\ObjectMapper\Attributes\Expect\StringValue;
11841184
use Orisai\ObjectMapper\MappedObject;
11851185

1186-
final class MainInput extends MappedObject
1186+
final class MainInput implements MappedObject
11871187
{
11881188

11891189
/**
@@ -1197,7 +1197,7 @@ final class MainInput extends MappedObject
11971197

11981198
}
11991199

1200-
final class FullInput extends MappedObject
1200+
final class FullInput implements MappedObject
12011201
{
12021202

12031203
/** @IntValue(min=0) */
@@ -1211,7 +1211,7 @@ final class FullInput extends MappedObject
12111211

12121212
}
12131213

1214-
final class IdOnlyInput extends MappedObject
1214+
final class IdOnlyInput implements MappedObject
12151215
{
12161216

12171217
/** @IntValue(min=0) */
@@ -1237,7 +1237,7 @@ Keys from input data (fields) are mapped to object properties of the same name,
12371237
use Orisai\ObjectMapper\Attributes\Expect\MixedValue;
12381238
use Orisai\ObjectMapper\MappedObject;
12391239

1240-
final class DefaultMappingInput extends MappedObject
1240+
final class DefaultMappingInput implements MappedObject
12411241
{
12421242

12431243
/**
@@ -1264,7 +1264,7 @@ use Orisai\ObjectMapper\Attributes\Expect\MixedValue;
12641264
use Orisai\ObjectMapper\Attributes\Modifiers\FieldName;
12651265
use Orisai\ObjectMapper\MappedObject;
12661266

1267-
final class CustomMappingInput extends MappedObject
1267+
final class CustomMappingInput implements MappedObject
12681268
{
12691269

12701270
/**
@@ -1299,7 +1299,7 @@ see [default values](#optional-fields-and-default-values)). By default, you have
12991299
use Orisai\ObjectMapper\Attributes\Expect\BoolValue;
13001300
use Orisai\ObjectMapper\MappedObject;
13011301

1302-
final class ModesExampleInput extends MappedObject
1302+
final class ModesExampleInput implements MappedObject
13031303
{
13041304

13051305
/** @BoolValue() */
@@ -1383,7 +1383,7 @@ use Orisai\ObjectMapper\Attributes\Callbacks\After;
13831383
use Orisai\ObjectMapper\Attributes\Expect\StringValue;
13841384
use Orisai\ObjectMapper\Context\FieldContext;
13851385

1386-
final class WithCallbackInput extends MappedObject
1386+
final class WithCallbackInput implements MappedObject
13871387
{
13881388

13891389
/**
@@ -1440,7 +1440,7 @@ use Orisai\ObjectMapper\Context\MappedObjectContext;
14401440
* @Before("beforeObject")
14411441
* @After("afterObject")
14421442
*/
1443-
final class WithMappedObjectCallbacksInput extends MappedObject
1443+
final class WithMappedObjectCallbacksInput implements MappedObject
14441444
{
14451445

14461446
/**
@@ -1489,7 +1489,7 @@ use Orisai\ObjectMapper\Attributes\Callbacks\After;
14891489
use Orisai\ObjectMapper\Attributes\Expect\StringValue;
14901490
use Orisai\ObjectMapper\Context\FieldContext;
14911491

1492-
final class WithFieldCallbacksInput extends MappedObject
1492+
final class WithFieldCallbacksInput implements MappedObject
14931493
{
14941494

14951495
/**
@@ -1524,7 +1524,7 @@ use Orisai\ObjectMapper\Attributes\Callbacks\After;
15241524
use Orisai\ObjectMapper\Attributes\Expect\StringValue;
15251525
use Orisai\ObjectMapper\Context\FieldContext;
15261526

1527-
final class WithNotInvokedCallbackInput extends MappedObject
1527+
final class WithNotInvokedCallbackInput implements MappedObject
15281528
{
15291529

15301530
/**
@@ -1557,7 +1557,7 @@ use Orisai\ObjectMapper\MappedObject;
15571557
use Orisai\ObjectMapper\Attributes\Callbacks\After;
15581558
use Orisai\ObjectMapper\Attributes\Expect\MixedValue;
15591559

1560-
final class WithReturningCallbackInput extends MappedObject
1560+
final class WithReturningCallbackInput implements MappedObject
15611561
{
15621562

15631563
/**
@@ -1588,7 +1588,7 @@ use Orisai\ObjectMapper\Attributes\Expect\StringValue;
15881588
use Orisai\ObjectMapper\Exception\ValueDoesNotMatch;
15891589
use Orisai\ObjectMapper\Types\Value;
15901590

1591-
final class WithNotReturningCallbackInput extends MappedObject
1591+
final class WithNotReturningCallbackInput implements MappedObject
15921592
{
15931593

15941594
/**
@@ -1618,7 +1618,7 @@ use Orisai\ObjectMapper\Attributes\Expect\MixedValue;
16181618
use Orisai\ObjectMapper\Exception\ValueDoesNotMatch;
16191619
use Orisai\ObjectMapper\Types\Value;
16201620

1621-
final class WithComplexCallbackInput extends MappedObject
1621+
final class WithComplexCallbackInput implements MappedObject
16221622
{
16231623

16241624
private ExampleService $service;
@@ -1681,7 +1681,7 @@ Since PHP 8.0 annotations can be written as attributes.
16811681
use Orisai\ObjectMapper\Attributes\Expect\MixedValue;
16821682
use Orisai\ObjectMapper\MappedObject;
16831683

1684-
final class WithAnnotationsAndAttributesInput extends MappedObject
1684+
final class WithAnnotationsAndAttributesInput implements MappedObject
16851685
{
16861686

16871687
/** @MixedValue() */
@@ -1726,7 +1726,7 @@ use Orisai\ObjectMapper\MappedObject;
17261726
/**
17271727
* @CreateWithoutConstructor()
17281728
*/
1729-
final class ConstructorUsingVO extends MappedObject
1729+
final class ConstructorUsingVO implements MappedObject
17301730
{
17311731

17321732
/** @StringValue() */

0 commit comments

Comments
 (0)