diff --git a/code/Controllers/ContentController.php b/code/Controllers/ContentController.php index d4c6ca5640..d4e97740c7 100644 --- a/code/Controllers/ContentController.php +++ b/code/Controllers/ContentController.php @@ -45,11 +45,12 @@ * Subclasses of ContentController are generally instantiated by ModelAsController; this will create * a controller based on the URLSegment action variable, by looking in the SiteTree table. * + * @template T of SiteTree */ class ContentController extends Controller { /** - * @var SiteTree + * @var T */ protected $dataRecord; @@ -71,7 +72,7 @@ class ContentController extends Controller * The ContentController will take the URLSegment parameter from the URL and use that to look * up a SiteTree record. * - * @param SiteTree $dataRecord + * @param T|null $dataRecord */ public function __construct($dataRecord = null) { @@ -110,7 +111,7 @@ public function Link($action = null) * Return the children of a given page. The parent reference can either be a page link or an ID. * * @param string|int $parentRef - * @return SS_List + * @return SS_List */ public function ChildrenOf($parentRef) { @@ -188,7 +189,7 @@ protected function init() */ public function handleRequest(HTTPRequest $request): HTTPResponse { - /** @var SiteTree $child */ + /** @var SiteTree|null $child */ $child = null; $action = $request->param('Action'); @@ -243,6 +244,7 @@ public function project() /** * Returns the associated database record + * @return T */ public function data() { @@ -254,7 +256,7 @@ public function data() /** * Returns a fixed navigation menu of the given level. * @param int $level Menu level to return. - * @return ArrayList + * @return ArrayList */ public function getMenu($level = 1) { @@ -294,6 +296,9 @@ public function getMenu($level = 1) return new ArrayList($visible); } + /** + * @return ArrayList + */ public function Menu($level) { return $this->getMenu($level); diff --git a/code/Controllers/LeftAndMainBatchActionsExtension.php b/code/Controllers/LeftAndMainBatchActionsExtension.php index 8e582972e3..5e6294219b 100644 --- a/code/Controllers/LeftAndMainBatchActionsExtension.php +++ b/code/Controllers/LeftAndMainBatchActionsExtension.php @@ -2,9 +2,13 @@ namespace SilverStripe\CMS\Controllers; +use SilverStripe\Admin\LeftAndMain; use SilverStripe\CMS\Controllers\CMSMain; use SilverStripe\Core\Extension; +/** + * @extends Extension + */ class LeftAndMainBatchActionsExtension extends Extension { public function updateBatchActionsForm(&$form) diff --git a/code/Controllers/LeftAndMainPageIconsExtension.php b/code/Controllers/LeftAndMainPageIconsExtension.php index a735965419..e962322f06 100644 --- a/code/Controllers/LeftAndMainPageIconsExtension.php +++ b/code/Controllers/LeftAndMainPageIconsExtension.php @@ -5,6 +5,7 @@ use Psr\SimpleCache\CacheInterface; use Psr\SimpleCache\InvalidArgumentException; use ReflectionException; +use SilverStripe\Admin\LeftAndMain; use SilverStripe\CMS\Model\SiteTree; use SilverStripe\Core\ClassInfo; use SilverStripe\Core\Config\Config; @@ -16,10 +17,11 @@ /** * Extension to include custom page icons + * + * @extends Extension */ class LeftAndMainPageIconsExtension extends Extension implements Flushable { - /** * @throws InvalidArgumentException * @throws ReflectionException diff --git a/code/Controllers/OldPageRedirector.php b/code/Controllers/OldPageRedirector.php index 0ff0de6095..227790388a 100644 --- a/code/Controllers/OldPageRedirector.php +++ b/code/Controllers/OldPageRedirector.php @@ -10,9 +10,11 @@ use SilverStripe\Control\HTTPResponse_Exception; use SilverStripe\Core\Extension; +/** + * @extends Extension + */ class OldPageRedirector extends Extension { - /** * On every URL that generates a 404, we'll capture it here and see if we can * find an old URL that it should be redirecting to. diff --git a/code/Forms/InternalLinkModalExtension.php b/code/Forms/InternalLinkModalExtension.php index 069de9064e..071c2efb27 100644 --- a/code/Forms/InternalLinkModalExtension.php +++ b/code/Forms/InternalLinkModalExtension.php @@ -9,7 +9,8 @@ /** * Decorates ModalController with insert internal link - * @see ModalController + * + * @extends Extension */ class InternalLinkModalExtension extends Extension { @@ -22,17 +23,6 @@ class InternalLinkModalExtension extends Extension 'editorAnchorLink', ]; - /** - * @return ModalController - */ - public function getOwner() - { - /** @var ModalController $owner */ - $owner = $this->owner; - return $owner; - } - - /** * Form for inserting internal link pages * diff --git a/code/Model/RedirectorPageController.php b/code/Model/RedirectorPageController.php index 51dce80d47..79d1446bac 100644 --- a/code/Model/RedirectorPageController.php +++ b/code/Model/RedirectorPageController.php @@ -7,6 +7,8 @@ /** * Controller for the {@link RedirectorPage}. + * + * @extends PageController */ class RedirectorPageController extends PageController { @@ -26,7 +28,6 @@ class RedirectorPageController extends PageController */ public function index(HTTPRequest $request) { - /** @var RedirectorPage $page */ $page = $this->data(); // Redirect if we can diff --git a/code/Model/SiteTree.php b/code/Model/SiteTree.php index f8e2b9d19c..f455ca4eff 100755 --- a/code/Model/SiteTree.php +++ b/code/Model/SiteTree.php @@ -1966,7 +1966,7 @@ public function getLiveURLSegment() /** * Get the back-link tracking objects that link to this page * - * @return ArrayList|DataObject[] + * @return ArrayList */ public function BackLinkTracking() { @@ -2007,7 +2007,7 @@ public function BackLinkTracking() * Returns the pages that depend on this page. This includes virtual pages, pages that link to it, etc. * * @param bool $includeVirtuals Set to false to exlcude virtual pages. - * @return ArrayList|SiteTree[] + * @return ArrayList */ public function DependentPages($includeVirtuals = true) { @@ -2057,7 +2057,7 @@ public function DependentPages($includeVirtuals = true) /** * Return all virtual pages that link to this page. * - * @return DataList + * @return DataList */ public function VirtualPages() { diff --git a/code/Model/SiteTreeExtension.php b/code/Model/SiteTreeExtension.php index dd1cfab272..e1b73a5c6e 100644 --- a/code/Model/SiteTreeExtension.php +++ b/code/Model/SiteTreeExtension.php @@ -7,6 +7,9 @@ /** * Plug-ins for additional functionality in your SiteTree classes. + * + * @template T of SiteTree + * @extends DataExtension */ abstract class SiteTreeExtension extends DataExtension { diff --git a/code/Model/SiteTreeLinkTracking.php b/code/Model/SiteTreeLinkTracking.php index 15283596b2..8adb8aa9d6 100644 --- a/code/Model/SiteTreeLinkTracking.php +++ b/code/Model/SiteTreeLinkTracking.php @@ -28,6 +28,8 @@ * * @property DataObject|SiteTreeLinkTracking $owner * @method ManyManyThroughList LinkTracking() + * + * @extends DataExtension */ class SiteTreeLinkTracking extends DataExtension { diff --git a/code/Search/ContentControllerSearchExtension.php b/code/Search/ContentControllerSearchExtension.php index 64091f17d2..6cfae5a86c 100644 --- a/code/Search/ContentControllerSearchExtension.php +++ b/code/Search/ContentControllerSearchExtension.php @@ -2,6 +2,7 @@ namespace SilverStripe\CMS\Search; +use SilverStripe\CMS\Controllers\ContentController; use SilverStripe\Control\HTTPRequest; use SilverStripe\Core\Extension; use SilverStripe\Forms\TextField; @@ -12,6 +13,8 @@ /** * Extension to provide a search interface when applied to ContentController + * + * @extends Extension */ class ContentControllerSearchExtension extends Extension {