Skip to content

Commit 3273f94

Browse files
committed
Interface properties.
1 parent 8320af5 commit 3273f94

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

spec.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -897,6 +897,30 @@ class Example
897897
}
898898
```
899899

900+
## 4.10 Interface properties
901+
902+
Abstract roperties may be defined in interfaces or abstract classes, but are required to
903+
specify if they must support `get` operations, `set` operations, or both.
904+
905+
* The operation block MUST be on the same line as the property.
906+
* There MUST be a single space between the property name and the operation block `{}`.
907+
* There MUST be a single space after the opening `{`.
908+
* There MUST be a single space before the closing `}`;
909+
* There MUST NOT be a space between the operation and its required semicolon.
910+
* If multiple operations are specified, they MUST be separated by a single space.
911+
* The `get` operation MUST be listed before the `set` operation.
912+
913+
```php
914+
interface Example
915+
{
916+
public string $readable { get; }
917+
918+
public string $writeable { set; }
919+
920+
public string $both { get; set; }
921+
}
922+
```
923+
900924
## 5. Control Structures
901925

902926
The general style rules for control structures are as follows:

0 commit comments

Comments
 (0)