Skip to content

Commit 0bccf20

Browse files
authored
Fixed indents
1 parent 76508b4 commit 0bccf20

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

doc/interfaces-protocols.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,21 @@ In Python, abstract methods can only declare what methods are required in the ob
1818
Abstract classes can be defined in the following way:
1919
```php
2020
<?php
21-
abstract class myAbstractClass {
22-
abstract protected function foo();
23-
21+
abstract class myAbstractClass {
22+
abstract protected function foo();
23+
2424
public function bar() { // Common method
25-
print "Hello world"
25+
print "Hello world"
2626
}
2727
}
2828
?>
2929
```
3030
And can be implemented in the following way (assuming the previously defined abstract class exists):
3131
```php
3232
<?php
33-
class myConcreteClass extends myAbstractClass {
34-
protected function foo() {
35-
print "This is my implementation of the foo method";
33+
class myConcreteClass extends myAbstractClass {
34+
protected function foo() {
35+
print "This is my implementation of the foo method";
3636
}
3737
}
3838
?>
@@ -43,14 +43,14 @@ Abstract classes can be created in the following way (Note: the `ABC` class *mus
4343
from abc import ABC, abstractmethod
4444

4545
class myAbstractClass(ABC):
46-
@abstractmethod
46+
@abstractmethod
4747
def foo(self):
48-
pass
48+
pass
4949
```
5050
And abstract classes can be "implemented" in the following way (assuming the previously defined abstract class exists):
5151
```python
5252
class myClass(myAbstractClass):
53-
def foo(self):
54-
print("This is my implementation of the foo method")
53+
def foo(self):
54+
print("This is my implementation of the foo method")
5555
```
5656
If a class that inherits an abstract class is created and does not implement one of the abstract methods, a `TypeError` exception will be raised.

0 commit comments

Comments
 (0)