Skip to content

Commit 2f5bf29

Browse files
committed
CodeInsertion docs
1 parent 99b5095 commit 2f5bf29

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/CodeInsertion.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,24 @@
55
use Assert\Assertion;
66

77
/**
8-
* Class CodeInsertion.
8+
* This class is a simple DTO to represent a code insertion which should
9+
* be performed on a students solution.
10+
*
911
* @package PhpSchool\PhpWorkshop
1012
* @author Aydin Hassan <[email protected]>
1113
*/
1214
class CodeInsertion
1315
{
16+
/**
17+
* Denotes that the block of code this insertion
18+
* represents, should be inserted at the top of the solution.
19+
*/
1420
const TYPE_BEFORE = 'before';
21+
22+
/**
23+
* Denotes that the block of code this insertion
24+
* represents, should be inserted at the bottom of the solution.
25+
*/
1526
const TYPE_AFTER = 'after';
1627

1728
/**
@@ -33,6 +44,9 @@ class CodeInsertion
3344
private $code;
3445

3546
/**
47+
* Accepts the type on insertion, either static::TYPE_BEFORE or static::TYPE_AFTER
48+
* and a string containing the code to be inserted.
49+
*
3650
* @param string $type
3751
* @param string $code
3852
*/
@@ -46,6 +60,8 @@ public function __construct($type, $code)
4660
}
4761

4862
/**
63+
* Get the type of insertion, either static::TYPE_BEFORE or static::TYPE_AFTER.
64+
*
4965
* @return string
5066
*/
5167
public function getType()
@@ -54,6 +70,8 @@ public function getType()
5470
}
5571

5672
/**
73+
* Get a string containing the code be inserted
74+
*
5775
* @return string
5876
*/
5977
public function getCode()

0 commit comments

Comments
 (0)