fixed some PHPDocs

removed my prior changes to the code behaviour

removed errorous PHPDocs

fixed some PHPDocs

removed my prior changes to the code behaviour

removed errorous PHPDocs
This commit is contained in:
Daniel Müller 2015-10-16 16:30:26 +02:00 committed by Samuel Georges
parent b3f318ff81
commit 01c63d6e32
11 changed files with 60 additions and 20 deletions

View File

@ -194,7 +194,7 @@ class CmsException extends ApplicationException
* Override properties of an exception specific to the Twig section
* of a CMS object.
* @param \Exception $exception The exception to modify.
* @return void
* @return bool
*/
protected function processTwig(Exception $exception)
{

View File

@ -74,7 +74,7 @@ class CmsObject implements ArrayAccess
/**
* Loads the object from a cache.
* This method is used by the CMS in the runtime. If the cache is not found, it is created.
* @param \Cms\Classes\Theme $theme Specifies the theme the object belongs to.
* @param $theme Specifies the theme the object belongs to.
* @param string $fileName Specifies the file name, with the extension.
* @return mixed Returns a CMS object instance or null if the object wasn't found.
*/
@ -149,7 +149,7 @@ class CmsObject implements ArrayAccess
/**
* Loads the object from a file.
* This method is used in the CMS back-end. It doesn't use any caching.
* @param \Cms\Classes\Theme $theme Specifies the theme the object belongs to.
* @param $theme Specifies the theme the object belongs to.
* @param string $fileName Specifies the file name, with the extension.
* The file name can contain only alphanumeric symbols, dashes and dots.
* @return mixed Returns a CMS object instance or null if the object wasn't found.
@ -446,7 +446,7 @@ class CmsObject implements ArrayAccess
/**
* Returns the absolute file path.
* @param \Cms\Classes\Theme $theme Specifies a theme the file belongs to.
* @param $theme Specifies a theme the file belongs to.
* @param string$fileName Specifies the file name to return the path to.
* @return string
*/
@ -458,7 +458,7 @@ class CmsObject implements ArrayAccess
/**
* Implements the getter functionality.
* @param string $name
* @return void
* @return null|string
*/
public function __get($name)
{
@ -473,7 +473,7 @@ class CmsObject implements ArrayAccess
/**
* Determine if an attribute exists on the object.
* @param string $key
* @return void
* @return bool
*/
public function __isset($key)
{

View File

@ -59,8 +59,10 @@ class CmsObjectCollection extends CollectionBase
/**
* Returns objects whose component properties match the supplied value.
* @param mixed $components
* @param string $property
* @param string $value
* @param bool $strict
* @return static
*/
public function whereComponent($components, $property, $value, $strict = false)

View File

@ -15,7 +15,7 @@ use SystemException;
class CodeParser
{
/**
* @var Cms\Classes\CmsCompoundObject A reference to the CMS object being parsed.
* @var \Cms\Classes\CmsCompoundObject A reference to the CMS object being parsed.
*/
protected $object;
@ -141,9 +141,9 @@ class CodeParser
/**
* Runs the object's PHP file and returns the corresponding object.
* @param Cms\Classes\Page $page Specifies the CMS page.
* @param Cms\Classes\Layout $layout Specifies the CMS layout.
* @param Cms\Classes\Controller $controller Specifies the CMS controller.
* @param \Cms\Classes\Page $page Specifies the CMS page.
* @param \Cms\Classes\Layout $layout Specifies the CMS layout.
* @param \Cms\Classes\Controller $controller Specifies the CMS controller.
* @return mixed
*/
public function source($page, $layout, $controller)

View File

@ -64,12 +64,12 @@ abstract class ComponentBase extends Extendable
protected $dirName;
/**
* @var Cms\Classes\Controller Controller object.
* @var \Cms\Classes\Controller Controller object.
*/
protected $controller;
/**
* @var Cms\Classes\PageCode Page object object.
* @var \Cms\Classes\PageCode Page object object.
*/
protected $page;
@ -81,6 +81,8 @@ abstract class ComponentBase extends Extendable
/**
* Component constructor. Takes in the page or layout code section object
* and properties set by the page or layout.
* @param null|CodeBase $cmsObject
* @param array $properties
*/
public function __construct(CodeBase $cmsObject = null, $properties = [])
{

View File

@ -670,6 +670,7 @@ class Controller
/**
* Tries to find and run an AJAX handler in the page, layout, components and plugins.
* The method stops as soon as the handler is found.
* @param string $handler name of the ajax handler
* @return boolean Returns true if the handler was found. Returns false otherwise.
*/
protected function runAjaxHandler($handler)
@ -743,7 +744,7 @@ class Controller
/**
* Renders a requested partial.
* The framework uses this method internally.
* @param string $partial The view to load.
* @param string $name The view to load.
* @param array $parameters Parameter variables to pass to the view.
* @param bool $throwException Throw an exception if the partial is not found.
* @return mixed Partial contents or false if not throwing an exception.
@ -954,6 +955,8 @@ class Controller
/**
* Renders a component's default content.
* @param $name
* @param array $parameters
* @return string Returns the component default contents.
*/
public function renderComponent($name, $parameters = [])
@ -976,7 +979,7 @@ class Controller
/**
* Sets the status code for the current web response.
* @param int $code Status code
* @return \Cms\Classes\Controller $this
* @return self
*/
public function setStatusCode($code)
{
@ -1018,7 +1021,7 @@ class Controller
/**
* Returns the Twig loader.
* @return Cms\Twig\Loader
* @return \Cms\Twig\Loader
*/
public function getLoader()
{
@ -1114,6 +1117,9 @@ class Controller
/**
* Looks up the current page URL with supplied parameters and route persistence.
* @param array $parameters
* @param bool $routePersistence
* @return null|string
*/
public function currentPageUrl($parameters = [], $routePersistence = true)
{
@ -1160,8 +1166,8 @@ class Controller
/**
* Returns a routing parameter.
* @param string Routing parameter name.
* @param string Default to use if none is found.
* @param string $name Routing parameter name.
* @param string $default Default to use if none is found.
* @return string
*/
public function param($name, $default = null)
@ -1209,6 +1215,7 @@ class Controller
/**
* Searches the layout and page components by an alias
* @param $name
* @return ComponentBase The component object, if found
*/
public function findComponentByName($name)
@ -1231,6 +1238,7 @@ class Controller
/**
* Searches the layout and page components by an AJAX handler
* @param string $handler
* @return ComponentBase The component object, if found
*/
public function findComponentByHandler($handler)
@ -1252,6 +1260,7 @@ class Controller
/**
* Searches the layout and page components by a partial file
* @param string $partial
* @return ComponentBase The component object, if found
*/
public function findComponentByPartial($partial)
@ -1296,7 +1305,6 @@ class Controller
* The property values should be defined as {{ param }}.
* @param ComponentBase $component The component object.
* @param array $parameters Specifies the partial parameters.
* @return Returns updated properties.
*/
protected function setComponentPropertiesFromParams($component, $parameters = [])
{

View File

@ -65,6 +65,13 @@ class MediaLibraryItem
protected static $videoExtensions;
protected static $audioExtensions;
/**
* @param string $path
* @param int $size
* @param int $lastModified
* @param string $type
* @param string $publicUrl
*/
public function __construct($path, $size, $lastModified, $type, $publicUrl)
{
$this->path = $path;
@ -74,6 +81,9 @@ class MediaLibraryItem
$this->publicUrl = $publicUrl;
}
/**
* @return bool
*/
public function isFile()
{
return $this->type == self::TYPE_FILE;

View File

@ -166,8 +166,8 @@ class Page extends CmsCompoundObject
* - items - an array of arrays with the same keys (url, isActive, items) + the title key.
* The items array should be added only if the $item's $nesting property value is TRUE.
* @param \RainLab\Pages\Classes\MenuItem $item Specifies the menu item.
* @param \Cms\Classes\Theme $theme Specifies the current theme.
* @param string $url Specifies the current page URL, normalized, in lower case
* @param \Cms\Classes\Theme $theme Specifies the current theme.
* The URL is specified relative to the website root, it includes the subdirectory name, if any.
* @return mixed Returns an array. Returns null if the item cannot be resolved.
*/

View File

@ -20,7 +20,7 @@ class Partial extends CmsCompoundObject
/**
* Returns name of a PHP class to us a parent for the PHP class created for the object's PHP section.
* @return mixed Returns the class name or null.
* @return string Returns the class name.
*/
public function getCodeClassParent()
{

View File

@ -19,6 +19,9 @@ class UnknownComponent extends ComponentBase
parent::__construct($cmsObject, $properties);
}
/**
* @return array
*/
public function componentDetails()
{
return [

View File

@ -13,6 +13,9 @@ class ViewBag extends ComponentBase
{
public $isHidden = true;
/**
* @return array
*/
public function componentDetails()
{
return [
@ -21,11 +24,20 @@ class ViewBag extends ComponentBase
];
}
/**
* @param array $properties
* @return array
*/
public function validateProperties(array $properties)
{
return $properties;
}
/**
* @param string $method
* @param array $parameters
* @return mixed
*/
public function __call($method, $parameters)
{
if (array_key_exists($method, $this->properties) && !method_exists($this, $method)) {
@ -35,6 +47,9 @@ class ViewBag extends ComponentBase
return parent::__call($method, $parameters);
}
/**
* @return array
*/
public function defineProperties()
{
$result = [];