Skip to content

Commit

Permalink
Merge pull request #53 from thephpleague/protected-elements
Browse files Browse the repository at this point in the history
Make some private elements protected instead for easier extending
  • Loading branch information
colinodell committed Jan 3, 2015
2 parents f281428 + ef5f4b3 commit 7b14b5d
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/Block/Element/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Document extends AbstractBlock
/***
* @var ReferenceMap
*/
private $referenceMap;
protected $referenceMap;

public function __construct()
{
Expand Down
8 changes: 4 additions & 4 deletions src/Block/Element/FencedCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,22 @@ class FencedCode extends AbstractBlock
/**
* @var string
*/
private $info;
protected $info;

/**
* @var int
*/
private $length;
protected $length;

/**
* @var string
*/
private $char;
protected $char;

/**
* @var int
*/
private $offset;
protected $offset;

/**
* @param int $length
Expand Down
4 changes: 2 additions & 2 deletions src/Block/Element/ListBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ class ListBlock extends AbstractBlock
/**
* @var bool
*/
private $tight = false;
protected $tight = false;

/**
* @var ListData
*/
private $data;
protected $data;

public function __construct(ListData $listData)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Block/Element/ListItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ListItem extends AbstractBlock
/**
* @var ListData
*/
private $data;
protected $data;

public function __construct(ListData $listData)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Block/Element/Paragraph.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function finalize(ContextInterface $context)
*
* @return bool
*/
private function parseReferences(ContextInterface $context, Cursor $cursor)
protected function parseReferences(ContextInterface $context, Cursor $cursor)
{
$referenceFound = false;
while ($cursor->getCharacter() === '[' && $context->getReferenceParser()->parse($cursor)) {
Expand Down
8 changes: 4 additions & 4 deletions src/HtmlElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ class HtmlElement
/**
* @var string
*/
private $tagName;
protected $tagName;

/**
* @var string[]
*/
private $attributes = array();
protected $attributes = array();

/**
* @var HtmlElement|HtmlElement[]|string
*/
private $contents;
protected $contents;

/**
* @var bool
*/
private $selfClosing = false;
protected $selfClosing = false;

/**
* @param string $tagName
Expand Down
2 changes: 1 addition & 1 deletion src/Inline/Element/InlineCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class InlineCollection extends AbstractInline
/**
* @var ArrayCollection|AbstractInline[]
*/
private $inlines;
protected $inlines;

public function __construct($inlines)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Inline/Element/Newline.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Newline extends AbstractInline
const HARDBREAK = 0;
const SOFTBREAK = 1;

private $type;
protected $type;

/**
* @param int $breakType
Expand Down
12 changes: 6 additions & 6 deletions src/Inline/Parser/CloseBracketParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class CloseBracketParser extends AbstractInlineParser implements EnvironmentAwar
/**
* @var Environment
*/
private $environment;
protected $environment;

/**
* @return string[]
Expand Down Expand Up @@ -120,7 +120,7 @@ public function setEnvironment(Environment $environment)
* @param int $start
* @param int $end
*/
private function nullify(ArrayCollection $collection, $start, $end)
protected function nullify(ArrayCollection $collection, $start, $end)
{
for ($i = $start; $i < $end; $i++) {
$collection->set($i, null);
Expand All @@ -135,7 +135,7 @@ private function nullify(ArrayCollection $collection, $start, $end)
*
* @return array|bool
*/
private function tryParseLink(Cursor $cursor, ReferenceMap $referenceMap, Delimiter $opener, $startPos)
protected function tryParseLink(Cursor $cursor, ReferenceMap $referenceMap, Delimiter $opener, $startPos)
{
// Check to see if we have a link/image
// Inline link?
Expand All @@ -155,7 +155,7 @@ private function tryParseLink(Cursor $cursor, ReferenceMap $referenceMap, Delimi
*
* @return array|bool
*/
private function tryParseInlineLinkAndTitle(Cursor $cursor)
protected function tryParseInlineLinkAndTitle(Cursor $cursor)
{
$cursor->advance();
$cursor->advanceToFirstNonSpace();
Expand Down Expand Up @@ -188,7 +188,7 @@ private function tryParseInlineLinkAndTitle(Cursor $cursor)
*
* @return Reference|null
*/
private function tryParseReference(Cursor $cursor, ReferenceMap $referenceMap, Delimiter $opener, $startPos)
protected function tryParseReference(Cursor $cursor, ReferenceMap $referenceMap, Delimiter $opener, $startPos)
{
$savePos = $cursor->saveState();
$cursor->advanceToFirstNonSpace();
Expand Down Expand Up @@ -217,7 +217,7 @@ private function tryParseReference(Cursor $cursor, ReferenceMap $referenceMap, D
*
* @return AbstractWebResource
*/
private function createInline($url, InlineCollection $labelInlines, $title, $isImage)
protected function createInline($url, InlineCollection $labelInlines, $title, $isImage)
{
if ($isImage) {
return new Image($url, $labelInlines, $title);
Expand Down
2 changes: 1 addition & 1 deletion src/ReferenceParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ReferenceParser
/**
* @var ReferenceMap
*/
private $referenceMap;
protected $referenceMap;

public function __construct(ReferenceMap $referenceMap)
{
Expand Down

0 comments on commit 7b14b5d

Please sign in to comment.