Skip to content

Commit

Permalink
Minor phpdoc / code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Damian Mooyman committed Jul 12, 2016
1 parent 5776a03 commit a4da0b0
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
20 changes: 14 additions & 6 deletions api/RSSFeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
use SilverStripe\ORM\SS_List;
use SilverStripe\ORM\ArrayList;
use SilverStripe\ORM\FieldType\DBField;
use SilverStripe\ORM\FieldType\DBHTMLText;


/**
Expand Down Expand Up @@ -195,7 +196,7 @@ public function Description() {
*
* 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');
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -340,15 +344,19 @@ public function rssField($fieldName, $defaultClass = 'Varchar') {
* 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
);
}
}
1 change: 1 addition & 0 deletions control/Controller.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
use SilverStripe\Model\FieldType\DBHTMLText;

use SilverStripe\ORM\DataModel;
use SilverStripe\ORM\FieldType\DBHTMLText;
Expand Down
4 changes: 2 additions & 2 deletions filesystem/flysystem/AssetAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use League\Flysystem\Adapter\Local;
use SilverStripe\ORM\ArrayList;

use SilverStripe\ORM\FieldType\DBHTMLText;

/**
* Adapter for local filesystem based on assets directory
Expand Down Expand Up @@ -119,7 +119,7 @@ protected function configureServer($forceOverwrite = false) {
* 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
Expand Down
2 changes: 1 addition & 1 deletion parsers/ShortcodeParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a4da0b0

Please sign in to comment.