Minor phpdoc / code cleanup

This commit is contained in:
Damian Mooyman 2016-06-03 20:34:59 +12:00
parent 68a9b45a9a
commit 749d28a3c9
4 changed files with 18 additions and 9 deletions

View File

@ -4,6 +4,7 @@
use SilverStripe\ORM\SS_List;
use SilverStripe\ORM\ArrayList;
use SilverStripe\ORM\FieldType\DBField;
use SilverStripe\ORM\FieldType\DBHTMLText;
/**
@ -195,7 +196,7 @@ class RSSFeed extends ViewableData {
*
* TODO: Pass $response object to ->outputToBrowser() to loosen dependence on global state for easier testing/prototyping so dev can inject custom SS_HTTPResponse instance.
*
* @return HTMLText
* @return DBHTMLText
*/
public function outputToBrowser() {
$prevState = Config::inst()->get('SSViewer', 'source_file_comments');
@ -281,9 +282,12 @@ class RSSFeed_Entry extends ViewableData {
/**
* Create a new RSSFeed entry.
* @param ViewableData $entry
* @param string $titleField
* @param string $descriptionField
* @param string $authorField
*/
public function __construct($entry, $titleField, $descriptionField,
$authorField) {
public function __construct($entry, $titleField, $descriptionField, $authorField) {
$this->failover = $entry;
$this->titleField = $titleField;
$this->descriptionField = $descriptionField;
@ -340,15 +344,19 @@ class RSSFeed_Entry extends ViewableData {
* Get a link to this entry
*
* @return string Returns the URL of this entry
* @throws BadMethodCallException
*/
public function AbsoluteLink() {
if($this->failover->hasMethod('AbsoluteLink')) {
return $this->failover->AbsoluteLink();
} else if($this->failover->hasMethod('Link')) {
return Director::absoluteURL($this->failover->Link());
} else {
user_error($this->failover->class . " object has neither an AbsoluteLink nor a Link method."
. " Can't put a link in the RSS feed", E_USER_WARNING);
}
throw new BadMethodCallException(
$this->failover->class .
" object has neither an AbsoluteLink nor a Link method." .
" Can't put a link in the RSS feed", E_USER_WARNING
);
}
}

View File

@ -1,4 +1,5 @@
<?php
use SilverStripe\Model\FieldType\DBHTMLText;
use SilverStripe\ORM\DataModel;
use SilverStripe\ORM\FieldType\DBHTMLText;

View File

@ -4,7 +4,7 @@ namespace SilverStripe\Filesystem\Flysystem;
use League\Flysystem\Adapter\Local;
use SilverStripe\ORM\ArrayList;
use SilverStripe\ORM\FieldType\DBHTMLText;
/**
* Adapter for local filesystem based on assets directory
@ -119,7 +119,7 @@ class AssetAdapter extends Local {
* Render server configuration file from a template file
*
* @param string $template
* @return \HTMLText Rendered results
* @return DBHTMLText Rendered results
*/
protected function renderTemplate($template) {
// Build allowed extensions

View File

@ -3,7 +3,7 @@
/**
* A simple parser that allows you to map BBCode-like "shortcodes" to an arbitrary callback.
* It is a simple regex based parser that allows you to replace simple bbcode-like tags
* within a HTMLText or HTMLVarchar field when rendered into a template. The API is inspired by and very similar to the
* within a DBHTMLText or DBHTMLVarchar field when rendered into a template. The API is inspired by and very similar to the
* [Wordpress implementation](http://codex.wordpress.org/Shortcode_API) of shortcodes.
*
* @see http://doc.silverstripe.org/framework/en/reference/shortcodes