From caf70935b646538d0d68f0c4200effe5d04783c4 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Mar 2012 21:31:27 +0100 Subject: [PATCH 1/7] Used constants instead of string literals for mvc events --- src/View.php | 49 +++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/src/View.php b/src/View.php index ef385dc1..195fe35a 100644 --- a/src/View.php +++ b/src/View.php @@ -22,6 +22,7 @@ use Zend\EventManager\EventCollection, Zend\EventManager\EventManager, + Zend\Mvc\MvcEvent, Zend\Stdlib\RequestDescription as Request, Zend\Stdlib\ResponseDescription as Response; @@ -50,8 +51,8 @@ class View /** * Set MVC request object - * - * @param Request $request + * + * @param Request $request * @return View */ public function setRequest(Request $request) @@ -61,9 +62,9 @@ public function setRequest(Request $request) } /** - * Set MVC response object - * - * @param Response $response + * Set MVC response object + * + * @param Response $response * @return View */ public function setResponse(Response $response) @@ -74,7 +75,7 @@ public function setResponse(Response $response) /** * Get MVC request object - * + * * @return null|Request */ public function getRequest() @@ -84,7 +85,7 @@ public function getRequest() /** * Get MVC response object - * + * * @return null|Response */ public function getResponse() @@ -94,8 +95,8 @@ public function getResponse() /** * Set the event manager instance - * - * @param EventCollection $events + * + * @param EventCollection $events * @return View */ public function setEventManager(EventCollection $events) @@ -108,7 +109,7 @@ public function setEventManager(EventCollection $events) * Retrieve the event manager instance * * Lazy-loads a default instance if none available - * + * * @return EventCollection */ public function events() @@ -128,11 +129,11 @@ public function events() * Expects a callable. Strategies should accept a ViewEvent object, and should * return a Renderer instance if the strategy is selected. * - * Internally, the callable provided will be subscribed to the "renderer" + * Internally, the callable provided will be subscribed to the "renderer" * event, at the priority specified. - * - * @param callable $callable - * @param int $priority + * + * @param callable $callable + * @param int $priority * @return View */ public function addRenderingStrategy($callable, $priority = 1) @@ -149,11 +150,11 @@ public function addRenderingStrategy($callable, $priority = 1) * * Typical usages for a response strategy are to populate the Response object. * - * Internally, the callable provided will be subscribed to the "response" + * Internally, the callable provided will be subscribed to the "response" * event, at the priority specified. - * - * @param callable $callable - * @param int $priority + * + * @param callable $callable + * @param int $priority * @return View */ public function addResponseStrategy($callable, $priority = 1) @@ -161,7 +162,7 @@ public function addResponseStrategy($callable, $priority = 1) $this->events()->attach('response', $callable, $priority); return $this; } - + /** * Render the provided model. * @@ -181,7 +182,7 @@ public function render(Model $model) $event = $this->getEvent(); $event->setModel($model); $events = $this->events(); - $results = $events->trigger('renderer', $event, function($result) { + $results = $events->trigger(MvcEvent::EVENT_RENDERER, $event, function($result) { return ($result instanceof Renderer); }); $renderer = $results->last(); @@ -217,13 +218,13 @@ public function render(Model $model) $event->setResult($rendered); - $events->trigger('response', $event); + $events->trigger(MvcEvent::EVENT_RESPONSE, $event); } /** * Loop through children, rendering each - * - * @param Model $model + * + * @param Model $model * @return void */ protected function renderChildren(Model $model) @@ -244,7 +245,7 @@ protected function renderChildren(Model $model) /** * Create and return ViewEvent used by render() - * + * * @return ViewEvent */ protected function getEvent() From 1d8ed700197c33e80e6f288a1c7ef756c618aee8 Mon Sep 17 00:00:00 2001 From: Andries Seutens Date: Fri, 23 Mar 2012 19:37:46 +0100 Subject: [PATCH 2/7] Moved Zend\View related events to ViewEvent instead of MvcEvent --- src/Strategy/FeedStrategy.php | 32 ++++++++-------- src/Strategy/JsonStrategy.php | 24 ++++++------ src/Strategy/PhpRendererStrategy.php | 34 ++++++++--------- src/View.php | 8 ++-- src/ViewEvent.php | 55 ++++++++++++++++------------ 5 files changed, 80 insertions(+), 73 deletions(-) diff --git a/src/Strategy/FeedStrategy.php b/src/Strategy/FeedStrategy.php index 04cae632..9686f8ce 100644 --- a/src/Strategy/FeedStrategy.php +++ b/src/Strategy/FeedStrategy.php @@ -51,8 +51,8 @@ class FeedStrategy implements ListenerAggregate /** * Constructor - * - * @param FeedRenderer $renderer + * + * @param FeedRenderer $renderer * @return void */ public function __construct(FeedRenderer $renderer) @@ -62,21 +62,21 @@ public function __construct(FeedRenderer $renderer) /** * Attach the aggregate to the specified event manager - * - * @param EventCollection $events - * @param int $priority + * + * @param EventCollection $events + * @param int $priority * @return void */ public function attach(EventCollection $events, $priority = 1) { - $this->listeners[] = $events->attach('renderer', array($this, 'selectRenderer'), $priority); - $this->listeners[] = $events->attach('response', array($this, 'injectResponse'), $priority); + $this->listeners[] = $events->attach(ViewEvent::EVENT_RENDERER, array($this, 'selectRenderer'), $priority); + $this->listeners[] = $events->attach(ViewEvent::EVENT_RESPONSE, array($this, 'injectResponse'), $priority); } /** * Detach aggregate listeners from the specified event manager - * - * @param EventCollection $events + * + * @param EventCollection $events * @return void */ public function detach(EventCollection $events) @@ -89,10 +89,10 @@ public function detach(EventCollection $events) } /** - * Detect if we should use the FeedRenderer based on model type and/or + * Detect if we should use the FeedRenderer based on model type and/or * Accept header - * - * @param ViewEvent $e + * + * @param ViewEvent $e * @return null|FeedRenderer */ public function selectRenderer(ViewEvent $e) @@ -133,8 +133,8 @@ public function selectRenderer(ViewEvent $e) /** * Inject the response with the feed payload and appropriate Content-Type header - * - * @param ViewEvent $e + * + * @param ViewEvent $e * @return void */ public function injectResponse(ViewEvent $e) @@ -155,10 +155,10 @@ public function injectResponse(ViewEvent $e) if ($result instanceof Feed) { $result = $result->export($renderer->getFeedType()); } - + // Get the content-type header based on feed type $feedType = $renderer->getFeedType(); - $feedType = ('rss' == $feedType) + $feedType = ('rss' == $feedType) ? 'application/rss+xml' : 'application/atom+xml'; diff --git a/src/Strategy/JsonStrategy.php b/src/Strategy/JsonStrategy.php index 15ecbb07..67340dc4 100644 --- a/src/Strategy/JsonStrategy.php +++ b/src/Strategy/JsonStrategy.php @@ -50,8 +50,8 @@ class JsonStrategy implements ListenerAggregate /** * Constructor - * - * @param JsonRenderer $renderer + * + * @param JsonRenderer $renderer * @return void */ public function __construct(JsonRenderer $renderer) @@ -61,21 +61,21 @@ public function __construct(JsonRenderer $renderer) /** * Attach the aggregate to the specified event manager - * - * @param EventCollection $events + * + * @param EventCollection $events * @param int $priority * @return void */ public function attach(EventCollection $events, $priority = 1) { - $this->listeners[] = $events->attach('renderer', array($this, 'selectRenderer'), $priority); - $this->listeners[] = $events->attach('response', array($this, 'injectResponse'), $priority); + $this->listeners[] = $events->attach(ViewEvent::EVENT_RENDERER, array($this, 'selectRenderer'), $priority); + $this->listeners[] = $events->attach(ViewEvent::EVENT_RESPONSE, array($this, 'injectResponse'), $priority); } /** * Detach aggregate listeners from the specified event manager - * - * @param EventCollection $events + * + * @param EventCollection $events * @return void */ public function detach(EventCollection $events) @@ -90,8 +90,8 @@ public function detach(EventCollection $events) /** * Detect if we should use the JsonRenderer based on model type and/or * Accept header - * - * @param ViewEvent $e + * + * @param ViewEvent $e * @return null|JsonRenderer */ public function selectRenderer(ViewEvent $e) @@ -126,8 +126,8 @@ public function selectRenderer(ViewEvent $e) /** * Inject the response with the JSON payload and appropriate Content-Type header - * - * @param ViewEvent $e + * + * @param ViewEvent $e * @return void */ public function injectResponse(ViewEvent $e) diff --git a/src/Strategy/PhpRendererStrategy.php b/src/Strategy/PhpRendererStrategy.php index 0b2fdc3c..9c86aba8 100644 --- a/src/Strategy/PhpRendererStrategy.php +++ b/src/Strategy/PhpRendererStrategy.php @@ -45,7 +45,7 @@ class PhpRendererStrategy implements ListenerAggregate /** * Placeholders that may hold content - * + * * @var array */ protected $contentPlaceholders = array('article', 'content'); @@ -57,8 +57,8 @@ class PhpRendererStrategy implements ListenerAggregate /** * Constructor - * - * @param PhpRenderer $renderer + * + * @param PhpRenderer $renderer * @return void */ public function __construct(PhpRenderer $renderer) @@ -68,7 +68,7 @@ public function __construct(PhpRenderer $renderer) /** * Retrieve the composed renderer - * + * * @return PhpRenderer */ public function getRenderer() @@ -87,7 +87,7 @@ public function setContentPlaceholders(array $contentPlaceholders) $this->contentPlaceholders = $contentPlaceholders; return $this; } - + /** * Get list of possible content placeholders * @@ -100,21 +100,21 @@ public function getContentPlaceholders() /** * Attach the aggregate to the specified event manager - * - * @param EventCollection $events + * + * @param EventCollection $events * @param int $priority * @return void */ public function attach(EventCollection $events, $priority = 1) { - $this->listeners[] = $events->attach('renderer', array($this, 'selectRenderer'), $priority); - $this->listeners[] = $events->attach('response', array($this, 'injectResponse'), $priority); + $this->listeners[] = $events->attach(ViewEvent::EVENT_RENDERER, array($this, 'selectRenderer'), $priority); + $this->listeners[] = $events->attach(ViewEvent::EVENT_RESPONSE, array($this, 'injectResponse'), $priority); } /** * Detach aggregate listeners from the specified event manager - * - * @param EventCollection $events + * + * @param EventCollection $events * @return void */ public function detach(EventCollection $events) @@ -127,10 +127,10 @@ public function detach(EventCollection $events) } /** - * Select the PhpRenderer; typically, this will be registered last or at + * Select the PhpRenderer; typically, this will be registered last or at * low priority. - * - * @param ViewEvent $e + * + * @param ViewEvent $e * @return PhpRenderer */ public function selectRenderer(ViewEvent $e) @@ -142,9 +142,9 @@ public function selectRenderer(ViewEvent $e) * Populate the response object from the View * * Populates the content of the response object from the view rendering - * results. - * - * @param ViewEvent $e + * results. + * + * @param ViewEvent $e * @return void */ public function injectResponse(ViewEvent $e) diff --git a/src/View.php b/src/View.php index 195fe35a..7e8a594d 100644 --- a/src/View.php +++ b/src/View.php @@ -138,7 +138,7 @@ public function events() */ public function addRenderingStrategy($callable, $priority = 1) { - $this->events()->attach('renderer', $callable, $priority); + $this->events()->attach(ViewEvent::EVENT_RENDERER, $callable, $priority); return $this; } @@ -159,7 +159,7 @@ public function addRenderingStrategy($callable, $priority = 1) */ public function addResponseStrategy($callable, $priority = 1) { - $this->events()->attach('response', $callable, $priority); + $this->events()->attach(ViewEvent::EVENT_RESPONSE, $callable, $priority); return $this; } @@ -182,7 +182,7 @@ public function render(Model $model) $event = $this->getEvent(); $event->setModel($model); $events = $this->events(); - $results = $events->trigger(MvcEvent::EVENT_RENDERER, $event, function($result) { + $results = $events->trigger(ViewEvent::EVENT_RENDERER, $event, function($result) { return ($result instanceof Renderer); }); $renderer = $results->last(); @@ -218,7 +218,7 @@ public function render(Model $model) $event->setResult($rendered); - $events->trigger(MvcEvent::EVENT_RESPONSE, $event); + $events->trigger(ViewEvent::EVENT_RESPONSE, $event); } /** diff --git a/src/ViewEvent.php b/src/ViewEvent.php index 92e2e6bd..740842d8 100644 --- a/src/ViewEvent.php +++ b/src/ViewEvent.php @@ -32,6 +32,13 @@ */ class ViewEvent extends Event { + /**#@+ + * View events triggered by eventmanager + */ + const EVENT_RENDERER = 'renderer'; + const EVENT_RESPONSE = 'response'; + /**#@-*/ + /** * @var null|Model */ @@ -59,8 +66,8 @@ class ViewEvent extends Event /** * Set the view model - * - * @param Model $model + * + * @param Model $model * @return ViewEvent */ public function setModel(Model $model) @@ -71,8 +78,8 @@ public function setModel(Model $model) /** * Set the MVC request object - * - * @param Request $request + * + * @param Request $request * @return ViewEvent */ public function setRequest(Request $request) @@ -83,8 +90,8 @@ public function setRequest(Request $request) /** * Set the MVC response object - * - * @param Response $response + * + * @param Response $response * @return ViewEvent */ public function setResponse(Response $response) @@ -95,8 +102,8 @@ public function setResponse(Response $response) /** * Set result of rendering - * - * @param mixed $result + * + * @param mixed $result * @return ViewEvent */ public function setResult($result) @@ -107,7 +114,7 @@ public function setResult($result) /** * Retrieve the view model - * + * * @return null|Model */ public function getModel() @@ -126,7 +133,7 @@ public function setRenderer(Renderer $renderer) $this->renderer = $renderer; return $this; } - + /** * Get value for renderer * @@ -139,7 +146,7 @@ public function getRenderer() /** * Retrieve the MVC request object - * + * * @return null|Request */ public function getRequest() @@ -149,7 +156,7 @@ public function getRequest() /** * Retrieve the MVC response object - * + * * @return null|Response */ public function getResponse() @@ -159,19 +166,19 @@ public function getResponse() /** * Retrieve the result of rendering - * + * * @return mixed */ public function getResult() { return $this->result; } - + /** * Get event parameter - * - * @param string $name - * @param mixed $default + * + * @param string $name + * @param mixed $default * @return mixed */ public function getParam($name, $default = null) @@ -194,7 +201,7 @@ public function getParam($name, $default = null) /** * Get all event parameters - * + * * @return array|\ArrayAccess */ public function getParams() @@ -210,8 +217,8 @@ public function getParams() /** * Set event parameters - * - * @param array|object|ArrayAccess $params + * + * @param array|object|ArrayAccess $params * @return ViewEvent */ public function setParams($params) @@ -231,10 +238,10 @@ public function setParams($params) } /** - * Set an individual event parameter - * - * @param string $name - * @param mixed $value + * Set an individual event parameter + * + * @param string $name + * @param mixed $value * @return ViewEvent */ public function setParam($name, $value) From c6d7477083126af02eabb1f23d9a789616ebdd66 Mon Sep 17 00:00:00 2001 From: Andries Seutens Date: Sat, 24 Mar 2012 20:42:23 +0100 Subject: [PATCH 3/7] Added additional method to Doctype view helper: isRdfa --- src/Helper/Doctype.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Helper/Doctype.php b/src/Helper/Doctype.php index 8af63323..7060e7f1 100644 --- a/src/Helper/Doctype.php +++ b/src/Helper/Doctype.php @@ -196,10 +196,21 @@ public function isXhtml() * * @return boolean */ - public function isHtml5() { + public function isHtml5() + { return (stristr($this->__invoke(), '') ? true : false); } + /** + * Is doctype RDFa? + * + * @return boolean + */ + public function isRdfa() + { + return (stristr($this->getDoctype(), 'rdfa') ? true : false); + } + /** * String representation of doctype * From fc16fff56a17336821a6d6a86a3a2992d68cb650 Mon Sep 17 00:00:00 2001 From: Andries Seutens Date: Sat, 24 Mar 2012 20:45:47 +0100 Subject: [PATCH 4/7] Improved namespace imports for Doctype view helper --- src/Helper/Doctype.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Helper/Doctype.php b/src/Helper/Doctype.php index 7060e7f1..4c25696d 100644 --- a/src/Helper/Doctype.php +++ b/src/Helper/Doctype.php @@ -24,7 +24,9 @@ */ namespace Zend\View\Helper; -use Zend\View\Exception; +use Zend\View\Exception, + Zend\Registry, + ArrayObject; /** * Helper for setting and retrieving the doctype @@ -56,7 +58,6 @@ class Doctype extends AbstractHelper const HTML5 = 'HTML5'; const CUSTOM_XHTML = 'CUSTOM_XHTML'; const CUSTOM = 'CUSTOM'; - /**#@-*/ /** @@ -84,8 +85,8 @@ class Doctype extends AbstractHelper */ public function __construct() { - if (!\Zend\Registry::isRegistered($this->_regKey)) { - $this->_registry = new \ArrayObject(array( + if (!Registry::isRegistered($this->_regKey)) { + $this->_registry = new ArrayObject(array( 'doctypes' => array( self::XHTML11 => '', self::XHTML1_RDFA1 => '', @@ -101,10 +102,10 @@ public function __construct() ) )); - \Zend\Registry::set($this->_regKey, $this->_registry); + Registry::set($this->_regKey, $this->_registry); $this->setDoctype($this->_defaultDoctype); } else { - $this->_registry = \Zend\Registry::get($this->_regKey); + $this->_registry = Registry::get($this->_regKey); } } From 45244a7daef5fc6640310cc772736ae346b6bd8b Mon Sep 17 00:00:00 2001 From: Andries Seutens Date: Sat, 24 Mar 2012 21:04:53 +0100 Subject: [PATCH 5/7] Bugfix XHTML1_RDFA1 was considered as a bogus doctype --- src/Helper/Doctype.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Helper/Doctype.php b/src/Helper/Doctype.php index 4c25696d..dce62580 100644 --- a/src/Helper/Doctype.php +++ b/src/Helper/Doctype.php @@ -121,6 +121,7 @@ public function __invoke($doctype = null) if (null !== $doctype) { switch ($doctype) { case self::XHTML11: + case self::XHTML1_RDFA1: case self::XHTML1_STRICT: case self::XHTML1_TRANSITIONAL: case self::XHTML1_FRAMESET: From 77388944caccbc1603ab27de50159ec25788ced1 Mon Sep 17 00:00:00 2001 From: Andries Seutens Date: Sat, 24 Mar 2012 21:05:26 +0100 Subject: [PATCH 6/7] Improved existing tests to use doctype constants Added addition unit tests upon request from @weierophinney --- test/Helper/DoctypeTest.php | 71 +++++++++++++++++++++++++++++++------ 1 file changed, 60 insertions(+), 11 deletions(-) diff --git a/test/Helper/DoctypeTest.php b/test/Helper/DoctypeTest.php index 55aaac52..33f3c7f2 100644 --- a/test/Helper/DoctypeTest.php +++ b/test/Helper/DoctypeTest.php @@ -39,7 +39,7 @@ class DoctypeTest extends \PHPUnit_Framework_TestCase { /** - * @var Zend_View_Helper_Doctype + * @var Helper\Doctype */ public $helper; @@ -93,13 +93,21 @@ public function testDoctypeMethodReturnsObjectInstance() public function testPassingDoctypeSetsDoctype() { - $doctype = $this->helper->__invoke('XHTML1_STRICT'); - $this->assertEquals('XHTML1_STRICT', $doctype->getDoctype()); + $doctype = $this->helper->__invoke(Helper\Doctype::XHTML1_STRICT); + $this->assertEquals(Helper\Doctype::XHTML1_STRICT, $doctype->getDoctype()); } public function testIsXhtmlReturnsTrueForXhtmlDoctypes() { - foreach (array('XHTML1_STRICT', 'XHTML1_TRANSITIONAL', 'XHTML1_FRAMESET', 'XHTML5') as $type) { + $types = array( + Helper\Doctype::XHTML1_STRICT, + Helper\Doctype::XHTML1_TRANSITIONAL, + Helper\Doctype::XHTML1_FRAMESET, + Helper\Doctype::XHTML1_RDFA1, + Helper\Doctype::XHTML5 + ); + + foreach ($types as $type) { $doctype = $this->helper->__invoke($type); $this->assertEquals($type, $doctype->getDoctype()); $this->assertTrue($doctype->isXhtml()); @@ -112,7 +120,13 @@ public function testIsXhtmlReturnsTrueForXhtmlDoctypes() public function testIsXhtmlReturnsFalseForNonXhtmlDoctypes() { - foreach (array('HTML4_STRICT', 'HTML4_LOOSE', 'HTML4_FRAMESET') as $type) { + $types = array( + Helper\Doctype::HTML4_STRICT, + Helper\Doctype::HTML4_LOOSE, + Helper\Doctype::HTML4_FRAMESET, + ); + + foreach ($types as $type) { $doctype = $this->helper->__invoke($type); $this->assertEquals($type, $doctype->getDoctype()); $this->assertFalse($doctype->isXhtml()); @@ -123,20 +137,31 @@ public function testIsXhtmlReturnsFalseForNonXhtmlDoctypes() $this->assertFalse($doctype->isXhtml()); } - public function testIsHtml5() { - foreach (array('HTML5', 'XHTML5') as $type) { + public function testIsHtml5() + { + foreach (array(Helper\Doctype::HTML5, Helper\Doctype::XHTML5) as $type) { $doctype = $this->helper->__invoke($type); $this->assertEquals($type, $doctype->getDoctype()); $this->assertTrue($doctype->isHtml5()); } - foreach (array('HTML4_STRICT', 'HTML4_LOOSE', 'HTML4_FRAMESET', 'XHTML1_STRICT', 'XHTML1_TRANSITIONAL', 'XHTML1_FRAMESET') as $type) { + $types = array( + Helper\Doctype::HTML4_STRICT, + Helper\Doctype::HTML4_LOOSE, + Helper\Doctype::HTML4_FRAMESET, + Helper\Doctype::XHTML1_STRICT, + Helper\Doctype::XHTML1_TRANSITIONAL, + Helper\Doctype::XHTML1_FRAMESET + ); + + + foreach ($types as $type) { $doctype = $this->helper->__invoke($type); $this->assertEquals($type, $doctype->getDoctype()); $this->assertFalse($doctype->isHtml5()); } } - + public function testCanRegisterCustomHtml5Doctype() { $doctype = $this->helper->__invoke(''); $this->assertEquals('CUSTOM', $doctype->getDoctype()); @@ -168,10 +193,34 @@ public function testMalformedCustomDoctypeRaisesException() public function testStringificationReturnsDoctypeString() { - $doctype = $this->helper->__invoke('XHTML1_STRICT'); + $doctype = $this->helper->__invoke(Helper\Doctype::XHTML1_STRICT); $string = $doctype->__toString(); $registry = \Zend\Registry::get('Zend_View_Helper_Doctype'); - $this->assertEquals($registry['doctypes']['XHTML1_STRICT'], $string); + $this->assertEquals($registry['doctypes'][Helper\Doctype::XHTML1_STRICT], $string); + } + + public function testIsRdfaReturnsTrueForRdfaDoctype() + { + $this->assertFalse($this->helper->isRdfa()); + + $doctypes = array( + Helper\Doctype::XHTML11, + Helper\Doctype::XHTML1_STRICT, + Helper\Doctype::XHTML1_TRANSITIONAL, + Helper\Doctype::XHTML1_FRAMESET, + Helper\Doctype::XHTML_BASIC1, + Helper\Doctype::XHTML5, + Helper\Doctype::HTML4_STRICT, + Helper\Doctype::HTML4_LOOSE, + Helper\Doctype::HTML4_FRAMESET, + Helper\Doctype::HTML5, + ); + + foreach ($doctypes as $type) { + $this->assertFalse($this->helper->__invoke($type)->isRdfa()); + } + + $this->assertTrue($this->helper->__invoke(Helper\Doctype::XHTML1_RDFA1)->isRdfa()); } } From 643d013286c6bd5ac2c34eb34110e60ac25bcaee Mon Sep 17 00:00:00 2001 From: Andries Seutens Date: Sat, 24 Mar 2012 21:36:06 +0100 Subject: [PATCH 7/7] Resolves an issue with the indenting of the isHtml5 method --- src/Helper/Doctype.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Helper/Doctype.php b/src/Helper/Doctype.php index dce62580..64d45228 100644 --- a/src/Helper/Doctype.php +++ b/src/Helper/Doctype.php @@ -193,15 +193,15 @@ public function isXhtml() return (stristr($this->getDoctype(), 'xhtml') ? true : false); } - /** - * Is doctype HTML5? (HeadMeta uses this for validation) - * - * @return boolean - */ - public function isHtml5() + /** + * Is doctype HTML5? (HeadMeta uses this for validation) + * + * @return boolean + */ + public function isHtml5() { - return (stristr($this->__invoke(), '') ? true : false); - } + return (stristr($this->__invoke(), '') ? true : false); + } /** * Is doctype RDFa?