Skip to content

Commit 776d03c

Browse files
author
Martin Brecht-Precht
committed
Completed the model interfaces. Needs the handler interfaces as dependency.
1 parent 90d3c1b commit 776d03c

29 files changed

+434
-103
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace Markdom\ModelInterface\Block;
44

5+
use Markdom\Handler\Markdom\MarkdomHandlerInterface;
56
use Markdom\ModelInterface\Common\NodeInterface;
6-
use Markdom\ModelInterface\DocumentInterface;
77

88
/**
99
* Interface BlockInterface

src/Model/Block/BlockSequenceInterface.php renamed to src/Block/BlockListInterface.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
use Markdom\ModelInterface\Common\CountableIteratorInterface;
66

77
/**
8-
* Interface BlockSequenceInterface
8+
* Interface BlockListInterface
99
*
1010
* @package Markdom\ModelInterface\Block
1111
*/
12-
interface BlockSequenceInterface extends CountableIteratorInterface
12+
interface BlockListInterface extends CountableIteratorInterface
1313
{
1414

1515
/**
@@ -29,11 +29,6 @@ public function getParent();
2929
*/
3030
public function size();
3131

32-
/**
33-
* @return bool
34-
*/
35-
public function isEmpty();
36-
3732
/**
3833
* @param BlockInterface $block
3934
* @return bool
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Markdom\ModelInterface\Block;
44

5-
use Markdom\ModelInterface\DocumentInterface;
5+
use Markdom\ModelInterface\Common\NodeInterface;
66

77
/**
88
* Interface BlockParentInterface
@@ -11,7 +11,7 @@
1111
*
1212
* @package Markdom\ModelInterface\Block
1313
*/
14-
interface BlockParentInterface
14+
interface BlockParentInterface extends NodeInterface
1515
{
1616

1717
/**
@@ -20,7 +20,7 @@ interface BlockParentInterface
2020
public function getDocument();
2121

2222
/**
23-
* @return BlockSequenceInterface
23+
* @return BlockListInterface
2424
*/
2525
public function getBlocks();
2626

src/Block/CodeBlockInterface.php

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
3+
namespace Markdom\ModelInterface\Block;
4+
5+
/**
6+
* Interface CodeBlockInterface
7+
*
8+
* @package Markdom\ModelInterface\Block
9+
*/
10+
interface CodeBlockInterface extends BlockInterface
11+
{
12+
13+
/**
14+
* CodeBlock constructor.
15+
*
16+
* @param string $code
17+
* @param string $hint
18+
*/
19+
public function __construct($code, $hint = null);
20+
21+
/**
22+
* @return string
23+
*/
24+
public function getCode();
25+
26+
/**
27+
* @param string $code
28+
* @return $this
29+
*/
30+
public function setCode($code);
31+
32+
/**
33+
* @return string
34+
*/
35+
public function getHint();
36+
37+
/**
38+
* @param string $hint
39+
* @return $this
40+
*/
41+
public function setHint($hint);
42+
43+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
use Markdom\ModelInterface\Content\ContentParentInterface;
66

77
/**
8-
* Interface ContentBlockInterface
8+
* Interface ContentParentBlockInterface
99
*
1010
* @package Markdom\ModelInterface\Block
1111
*/
12-
interface ContentBlockInterface extends BlockInterface, ContentParentInterface
12+
interface ContentParentBlockInterface extends BlockInterface, ContentParentInterface
1313
{
1414

1515
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace Markdom\ModelInterface\Block;
4+
5+
/**
6+
* Interface DivisionBlockInterface
7+
*
8+
* @package Markdom\ModelInterface\Block
9+
*/
10+
interface DivisionBlockInterface extends BlockInterface
11+
{
12+
13+
}

src/Block/DocumentInterface.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
namespace Markdom\ModelInterface\Block;
4+
5+
use Markdom\Handler\Markdom\MarkdomHandlerInterface;
6+
7+
/**
8+
* Interface DocumentInterface
9+
*
10+
* @package Markdom\ModelInterface\Block
11+
*/
12+
interface DocumentInterface extends BlockParentInterface
13+
{
14+
15+
/**
16+
* @param MarkdomHandlerInterface $markdomHandler
17+
* @return void
18+
*/
19+
public function handle(MarkdomHandlerInterface $markdomHandler);
20+
21+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
3+
namespace Markdom\ModelInterface\Block;
4+
5+
/**
6+
* Interface HeadingBlockInterface
7+
*
8+
* @package Markdom\ModelInterface\Block
9+
*/
10+
interface HeadingBlockInterface extends ContentParentBlockInterface
11+
{
12+
13+
const LEVEL_1 = 1;
14+
const LEVEL_2 = 2;
15+
const LEVEL_3 = 3;
16+
const LEVEL_4 = 4;
17+
const LEVEL_5 = 5;
18+
const LEVEL_6 = 6;
19+
20+
/**
21+
* HeadingBlock constructor.
22+
*
23+
* @param int $level
24+
*/
25+
public function __construct($level);
26+
27+
/**
28+
* @return int
29+
*/
30+
public function getLevel();
31+
32+
/**
33+
* @param int $level
34+
* @return $this
35+
*/
36+
public function setLevel($level);
37+
38+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ interface ListBlockInterface extends BlockInterface
1111
{
1212

1313
/**
14-
* @return ListItemSequenceInterface
14+
* @return ListItemListInterface
1515
*/
1616
public function getListItems();
1717

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
namespace Markdom\ModelInterface\Block;
44

5-
use Markdom\ModelInterface\Common\NodeInterface;
5+
use Markdom\Handler\Markdom\MarkdomHandlerInterface;
66

77
/**
88
* Interface ListItemInterface
99
*
1010
* @package Markdom\ModelInterface\Block
1111
*/
12-
interface ListItemInterface extends BlockParentInterface, NodeInterface
12+
interface ListItemInterface extends BlockParentInterface
1313
{
1414

1515
/**

0 commit comments

Comments
 (0)