Skip to content

Commit

Permalink
HTML/URL switch to mixed case
Browse files Browse the repository at this point in the history
- Switch ACRONYM casing to MixedCase for "HTML" and "URL" subcomponents
  • Loading branch information
weierophinney committed Aug 5, 2010
1 parent 922afa9 commit 004fa93
Show file tree
Hide file tree
Showing 12 changed files with 65 additions and 37 deletions.
2 changes: 1 addition & 1 deletion library/Zend/Markup/Markup.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public static function addRendererPath($prefix, $path)
* @param array $options
* @return \Zend\Markup\Renderer\AbstractRenderer
*/
public static function factory($parser, $renderer = 'HTML', array $options = array())
public static function factory($parser, $renderer = 'Html', array $options = array())
{
$parserClass = self::getParserLoader()->load($parser);
$rendererClass = self::getRendererLoader()->load($renderer);
Expand Down
24 changes: 24 additions & 0 deletions library/Zend/Markup/Parser/Textile.php
Original file line number Diff line number Diff line change
Expand Up @@ -561,4 +561,28 @@ protected function _extractAttributes(array $matches)
return $attributes;
}

/**
* Build a tree with a certain strategy
*
* @todo IMPLEMENT
* @param array $tokens
* @param string $strategy
*
* @return \Zend\Markup\TokenList
*/
public function buildTree(array $tokens, $strategy = 'default')
{
}

/**
* Tokenize a string
*
* @param string $value
*
* @todo IMPLEMENT
* @return array
*/
public function tokenize($value)
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class HTML extends AbstractRenderer
class Html extends AbstractRenderer
{

/**
Expand Down Expand Up @@ -95,7 +95,7 @@ public function __construct($options = array())
}

$this->_pluginLoader = new PluginLoader(array(
'Zend\Markup\Renderer\Markup\HTML' => 'Zend/Markup/Renderer/Markup/HTML/'
'Zend\Markup\Renderer\Markup\Html' => 'Zend/Markup/Renderer/Markup/Html/'
));

if (!isset($options['useDefaultMarkups']) && isset($options['useDefaultTags'])) {
Expand Down Expand Up @@ -220,10 +220,6 @@ protected function _defineDefaultMarkups()
),
// callback tags
'url' => array(
'type' => 16, // self::TYPE_ALIAS
'name' => 'URL',
),
'URL' => array(
'type' => 6, // self::TYPE_CALLBACK | self::TAG_NORMAL
'callback' => null,
'group' => 'inline',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/**
* @namespace
*/
namespace Zend\Markup\Renderer\Markup\HTML;
namespace Zend\Markup\Renderer\Markup\Html;

use Zend\Markup\Renderer\Markup\AbstractMarkup,
Zend\Markup;
Expand All @@ -34,11 +34,11 @@
* @uses \Zend\Markup\Renderer\AbstractRenderer
* @category Zend
* @package Zend_Markup
* @subpackage Renderer_Markup_HTML
* @subpackage Renderer_Markup_Html
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
abstract class AbstractHTML extends AbstractMarkup
abstract class AbstractHtml extends AbstractMarkup
{

/**
Expand All @@ -54,7 +54,7 @@ abstract class AbstractHTML extends AbstractMarkup
*
* @param array $attributes
*
* @return \Zend\Markup\Renderer\Markup\HTML\AbstractHTML
* @return \Zend\Markup\Renderer\Markup\Html\AbstractHtml
*/
public function setAttributes(array $attributes)
{
Expand All @@ -69,7 +69,7 @@ public function setAttributes(array $attributes)
* @param string $name
* @param string $value
*
* @return \Zend\Markup\Renderer\Markup\HTML\AbstractHTML
* @return \Zend\Markup\Renderer\Markup\Html\AbstractHtml
*/
public function addAttribute($name, $value)
{
Expand All @@ -83,7 +83,7 @@ public function addAttribute($name, $value)
*
* @param string $name
*
* @return \Zend\Markup\Renderer\Markup\HTML\AbstractHTML
* @return \Zend\Markup\Renderer\Markup\Html\AbstractHtml
*/
public function removeAttribute($name)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@
/**
* @namespace
*/
namespace Zend\Markup\Renderer\Markup\HTML;
namespace Zend\Markup\Renderer\Markup\Html;
use Zend\Markup;

/**
* Code markup for HTML
*
* @uses \Zend\Markup\Renderer\Markup\HTML\AbstractHTML
* @uses \Zend\Markup\Renderer\Markup\Html\AbstractHtml
* @uses \Zend\Markup\Token
* @category Zend
* @package Zend_Markup
* @subpackage Renderer_Markup_Html
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Code extends AbstractHTML
class Code extends AbstractHtml
{

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@
/**
* @namespace
*/
namespace Zend\Markup\Renderer\Markup\HTML;
namespace Zend\Markup\Renderer\Markup\Html;
use Zend\Markup\Renderer\Markup;
use Zend\Markup\Token;

/**
* Image markup for HTML
*
* @uses \Zend\Markup\Renderer\HTML
* @uses \Zend\Markup\Renderer\Markup\HTML\AbstractHTML
* @uses \Zend\Markup\Renderer\Html
* @uses \Zend\Markup\Renderer\Markup\Html\AbstractHtml
* @uses \Zend\Markup\Token
* @category Zend
* @package Zend_Markup
* @subpackage Renderer_Html
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Img extends AbstractHTML
class Img extends AbstractHtml
{

/**
Expand All @@ -60,7 +60,7 @@ public function __invoke(Token $token, $text)

// check if the URL is valid
// TODO: use \Zend\Uri for this
if (!\Zend\Markup\Renderer\HTML::isValidUri($uri)) {
if (!\Zend\Markup\Renderer\Html::isValidUri($uri)) {
return $text;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@
/**
* @namespace
*/
namespace Zend\Markup\Renderer\Markup\HTML;
namespace Zend\Markup\Renderer\Markup\Html;
use Zend\Markup;

/**
* List item markup
*
* @uses \Zend\Markup\Renderer\Markup\HTML\AbstractHTML
* @uses \Zend\Markup\Renderer\Markup\Html\AbstractHtml
* @uses \Zend\Markup\Token
* @category Zend
* @package Zend_Markup
* @subpackage Renderer_Markup_Html
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class ListItem extends AbstractHTML
class ListItem extends AbstractHtml
{

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@
/**
* @namespace
*/
namespace Zend\Markup\Renderer\Markup\HTML;
namespace Zend\Markup\Renderer\Markup\Html;
use Zend\Markup;

/**
* Simple replace markup for HTML
*
* @uses \Zend\Markup\Renderer\Markup\HTML\AbstractHTML
* @uses \Zend\Markup\Renderer\Markup\Html\AbstractHtml
* @uses \Zend\Markup\Token
* @category Zend
* @package Zend_Markup
* @subpackage Renderer_Markup_Html
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Replace extends AbstractHTML
class Replace extends AbstractHtml
{

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,22 @@
/**
* @namespace
*/
namespace Zend\Markup\Renderer\Markup\HTML;
namespace Zend\Markup\Renderer\Markup\Html;
use Zend\Markup\Token;

/**
* URL markup for HTML
*
* @uses \Zend\Markup\Renderer\HTML
* @uses \Zend\Markup\Renderer\Markup\HTML\AbstractHTML
* @uses \Zend\Markup\Renderer\Html
* @uses \Zend\Markup\Renderer\Markup\Html\AbstractHtml
* @uses \Zend\Markup\Token
* @category Zend
* @package Zend_Markup
* @subpackage Renderer_Markup_Html
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class URL extends AbstractHTML
class Url extends AbstractHtml
{

/**
Expand All @@ -63,7 +63,7 @@ public function __invoke(Token $token, $text)

// check if the URL is valid
// TODO: use the new Zend\Uri for this
if (!\Zend\Markup\Renderer\HTML::isValidUri($uri)) {
if (!\Zend\Markup\Renderer\Html::isValidUri($uri)) {
return $text;
}

Expand Down
8 changes: 4 additions & 4 deletions tests/Zend/Markup/BBCodeAndHTMLTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
namespace ZendTest\Markup;

use Zend\Markup\Renderer\AbstractRenderer,
Zend\Markup\Renderer\HTML as HTMLRenderer,
Zend\Markup\Renderer\Html as HTMLRenderer,
Zend\Filter;

/**
Expand Down Expand Up @@ -55,7 +55,7 @@ class BbcodeAndHtmlTest extends \PHPUnit_Framework_TestCase
*/
public function setUp()
{
$this->_markup = \Zend\Markup\Markup::factory('Bbcode', 'HTML');
$this->_markup = \Zend\Markup\Markup::factory('Bbcode', 'Html');
}

/**
Expand Down Expand Up @@ -131,8 +131,8 @@ public function testExceptionParserEmptyInput()
public function testAddTags()
{
$this->_markup->getPluginLoader()->addPrefixPath(
'ZendTest\Markup\TestAsset\Renderer\HTML',
'Zend/Markup/TestAsset/Renderer/HTML'
'ZendTest\Markup\TestAsset\Renderer\Html',
'Zend/Markup/TestAsset/Renderer/Html'
);

$this->_markup->addMarkup(
Expand Down
8 changes: 8 additions & 0 deletions tests/Zend/Markup/TestAsset/Parser/MockParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,12 @@ public function parse($value)

return $tree;
}

public function buildTree(array $tokens, $strategy = 'default')
{
}

public function tokenize($value)
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/**
* @namespace
*/
namespace ZendTest\Markup\TestAsset\Renderer\HTML;
namespace ZendTest\Markup\TestAsset\Renderer\Html;

use Zend\Markup\Renderer\AbstractRenderer;

Expand Down

0 comments on commit 004fa93

Please sign in to comment.