Skip to content

Commit c1eb1ff

Browse files
author
Martin Brecht-Precht
committed
Merge remote-tracking branch 'origin/master'
# Conflicts: # composer.json # src/Block/BlockInterface.php # src/Block/DocumentInterface.php # src/Block/ListBlockInterface.php # src/Content/ContentInterface.php
2 parents 1904b58 + 5dc9659 commit c1eb1ff

File tree

8 files changed

+98
-67
lines changed

8 files changed

+98
-67
lines changed

.codeclimate.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
engines:
22
duplication:
33
enabled: true
4+
exclude_fingerprints:
5+
- 677dcaea63986631c0aecab6fc511f1c
6+
- f5d52454fcb0dd64edf1c226dbdb2110
7+
- d9593838ba526376aff5421735393d8e
48
config:
59
languages:
610
- ruby

composer.json

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
{
2-
"name": "markdom/model-interface",
3-
"type": "library",
4-
"description": "Markdom domain model interfaces written in PHP",
5-
"keywords": [
6-
"Markdom",
7-
"Model",
8-
"Interface"
9-
],
10-
"homepage": "http://markenwerk.net/",
11-
"license": "MIT",
12-
"authors": [
13-
{
14-
"name": "Martin Brecht-Precht",
15-
"email": "mb@markenwerk.net",
16-
"homepage": "http://markenwerk.net"
17-
}
18-
],
19-
"autoload": {
20-
"psr-4": {
21-
"Markdom\\ModelInterface\\": "src"
22-
}
23-
},
24-
"require": {
25-
"php": "^7.1",
26-
"markdom/handler-interface": "^1.1"
27-
}
2+
"name": "markdom/model-interface",
3+
"type": "library",
4+
"description": "Markdom domain model interfaces written in PHP",
5+
"keywords": [
6+
"Markdom",
7+
"Model",
8+
"Interface"
9+
],
10+
"homepage": "http://markenwerk.net/",
11+
"license": "MIT",
12+
"authors": [
13+
{
14+
"name": "Martin Brecht-Precht",
15+
"email": "mb@markenwerk.net",
16+
"homepage": "http://markenwerk.net"
17+
}
18+
],
19+
"autoload": {
20+
"psr-4": {
21+
"Markdom\\ModelInterface\\": "src"
22+
}
23+
},
24+
"require": {
25+
"php": ">=5.3",
26+
"markdom/handler-interface": "^1.0.10"
27+
}
2828
}

src/Block/BlockInterface.php

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,20 @@
1616
interface BlockInterface extends NodeInterface
1717
{
1818

19-
public const TYPE_CODE = BlockType::TYPE_CODE;
20-
public const TYPE_COMMENT = BlockType::TYPE_COMMENT;
21-
public const TYPE_DIVISION = BlockType::TYPE_DIVISION;
22-
public const TYPE_HEADING = BlockType::TYPE_HEADING;
23-
public const TYPE_UNORDERED_LIST = BlockType::TYPE_UNORDERED_LIST;
24-
public const TYPE_ORDERED_LIST = BlockType::TYPE_ORDERED_LIST;
25-
public const TYPE_LIST_ITEM = BlockType::TYPE_LIST_ITEM;
26-
public const TYPE_PARAGRAPH = BlockType::TYPE_PARAGRAPH;
27-
public const TYPE_QUOTE = BlockType::TYPE_QUOTE;
19+
const BLOCK_TYPE_CODE = BlockType::TYPE_CODE;
20+
const BLOCK_TYPE_COMMENT = BlockType::TYPE_COMMENT;
21+
const BLOCK_TYPE_DIVISION = BlockType::TYPE_DIVISION;
22+
const BLOCK_TYPE_HEADING = BlockType::TYPE_HEADING;
23+
const BLOCK_TYPE_UNORDERED_LIST = BlockType::TYPE_UNORDERED_LIST;
24+
const BLOCK_TYPE_ORDERED_LIST = BlockType::TYPE_ORDERED_LIST;
25+
const BLOCK_TYPE_LIST_ITEM = BlockType::TYPE_LIST_ITEM;
26+
const BLOCK_TYPE_PARAGRAPH = BlockType::TYPE_PARAGRAPH;
27+
const BLOCK_TYPE_QUOTE = BlockType::TYPE_QUOTE;
2828

2929
/**
3030
* @return string
3131
*/
32-
public function getBlockType(): string;
33-
34-
/**
35-
* @return BlockInterface
36-
*/
37-
public function getBlock(): BlockInterface;
32+
public function getBlockType();
3833

3934
/**
4035
* @param BlockParentInterface $blockParent
@@ -50,12 +45,12 @@ public function onDetach();
5045
/**
5146
* @return BlockParentInterface
5247
*/
53-
public function getParent(): BlockParentInterface;
48+
public function getParent();
5449

5550
/**
5651
* @param HandlerInterface $markdomHandler
5752
* @return void
5853
*/
59-
public function onHandle(HandlerInterface $markdomHandler): void;
54+
public function onHandle(HandlerInterface $markdomHandler);
6055

6156
}

src/Block/BlockParentInterface.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@
1414
interface BlockParentInterface extends NodeInterface
1515
{
1616

17+
const BLOCK_PARENT_TYPE_DOCUMENT = 'DOCUMENT';
18+
const BLOCK_PARENT_TYPE_LIST_ITEM = 'LIST_ITEM';
19+
const BLOCK_PARENT_TYPE_QUOTE = 'QUOTE';
20+
21+
/**
22+
* @return string
23+
*/
24+
public function getBlockParentType();
25+
1726
/**
1827
* @return BlockSequenceInterface
1928
*/

src/Block/DocumentInterface.php

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

33
namespace Markdom\ModelInterface\Block;
44

5-
use Markdom\HandlerInterface\HandlerInterface;
5+
use Markdom\DispatcherInterface\DispatcherInterface;
66

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

15-
/**
16-
* @param HandlerInterface $markdomHandler
17-
* @return void
18-
*/
19-
public function handle(HandlerInterface $markdomHandler): void;
20-
2115
}

src/Block/ListBlockInterface.php

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,29 @@
1010
interface ListBlockInterface extends BlockInterface
1111
{
1212

13+
const LIST_BLOCK_TYPE_ORDERED_LIST = 'ORDERED_LIST';
14+
const LIST_BLOCK_TYPE_UNORDERED_LIST = 'UNORDERED_LIST';
15+
16+
/**
17+
* @return string
18+
*/
19+
public function getListBlockType();
20+
1321
/**
1422
* @return ListItemSequenceInterface
1523
*/
16-
public function getListItems(): ListItemSequenceInterface;
24+
public function getItems();
25+
26+
/**
27+
* @param ListItemInterface $listItem
28+
* @return $this
29+
*/
30+
public function addItem(ListItemInterface $listItem);
31+
32+
/**
33+
* @param ListItemInterface[] $listItems
34+
* @return $this
35+
*/
36+
public function addItems(array $listItems);
1737

1838
}

src/Content/ContentInterface.php

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use Markdom\Common\ContentType;
66
use Markdom\HandlerInterface\HandlerInterface;
7-
use Markdom\ModelInterface\Block\ContentParentBlockInterface;
7+
use Markdom\ModelInterface\Block\BlockInterface;
88
use Markdom\ModelInterface\Common\NodeInterface;
99

1010
/**
@@ -17,27 +17,27 @@
1717
interface ContentInterface extends NodeInterface
1818
{
1919

20-
public const TYPE_CODE = ContentType::TYPE_CODE;
21-
public const TYPE_EMPHASIS = ContentType::TYPE_EMPHASIS;
22-
public const TYPE_IMAGE = ContentType::TYPE_IMAGE;
23-
public const TYPE_LINE_BREAK = ContentType::TYPE_LINE_BREAK;
24-
public const TYPE_LINK = ContentType::TYPE_LINK;
25-
public const TYPE_TEXT = ContentType::TYPE_TEXT;
20+
const CONTENT_TYPE_CODE = ContentType::TYPE_CODE;
21+
const CONTENT_TYPE_EMPHASIS = ContentType::TYPE_EMPHASIS;
22+
const CONTENT_TYPE_IMAGE = ContentType::TYPE_IMAGE;
23+
const CONTENT_TYPE_LINE_BREAK = ContentType::TYPE_LINE_BREAK;
24+
const CONTENT_TYPE_LINK = ContentType::TYPE_LINK;
25+
const CONTENT_TYPE_TEXT = ContentType::TYPE_TEXT;
2626

2727
/**
2828
* @return string
2929
*/
30-
public function getContentType(): string;
30+
public function getContentType();
3131

3232
/**
3333
* @return ContentParentInterface
3434
*/
35-
public function getParent(): ContentParentInterface;
35+
public function getParent();
3636

3737
/**
38-
* @return ContentParentBlockInterface
38+
* @return BlockInterface
3939
*/
40-
public function getBlock(): ContentParentBlockInterface;
40+
public function getBlock();
4141

4242
/**
4343
* @param ContentParentInterface $contentParent
@@ -52,8 +52,7 @@ public function onDetach();
5252

5353
/**
5454
* @param HandlerInterface $markdomHandler
55-
* @return void
5655
*/
57-
public function onHandle(HandlerInterface $markdomHandler): void;
56+
public function onHandle(HandlerInterface $markdomHandler);
5857

5958
}

src/Content/ContentParentInterface.php

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

33
namespace Markdom\ModelInterface\Content;
44

5-
use Markdom\ModelInterface\Block\ContentParentBlockInterface;
5+
use Markdom\ModelInterface\Block\BlockInterface;
66
use Markdom\ModelInterface\Common\NodeInterface;
77

88
/**
@@ -15,8 +15,18 @@
1515
interface ContentParentInterface extends NodeInterface
1616
{
1717

18+
const CONTENT_PARENT_TYPE_EMPHASIS = 'EMPHASIS';
19+
const CONTENT_PARENT_TYPE_HEADING = 'HEADING';
20+
const CONTENT_PARENT_TYPE_LINK = 'LINK';
21+
const CONTENT_PARENT_TYPE_PARAGRAPH = 'PARAGRAPH';
22+
23+
/**
24+
* @return string
25+
*/
26+
public function getContentParentType();
27+
1828
/**
19-
* @return ContentParentBlockInterface
29+
* @return BlockInterface
2030
*/
2131
public function getBlock(): ContentParentBlockInterface;
2232

0 commit comments

Comments
 (0)