Commit f324b3e3 authored by alexpott's avatar alexpott

Issue #2708179 by anoopjohn: Fix 'Drupal.Commenting.FunctionComment' coding...

Issue #2708179 by anoopjohn: Fix 'Drupal.Commenting.FunctionComment' coding standard - Issues related to @throws
parent 55e2442d
......@@ -30,7 +30,7 @@ class ConfigCollectionInfo extends Event {
*
* @throws \InvalidArgumentException
* Exception thrown if $collection is equal to
* \Drupal\Core\Config\StorageInterface::DEFAULT_COLLECTION
* \Drupal\Core\Config\StorageInterface::DEFAULT_COLLECTION.
*/
public function addCollection($collection, ConfigFactoryOverrideInterface $override_service = NULL) {
if ($collection == StorageInterface::DEFAULT_COLLECTION) {
......
......@@ -252,7 +252,8 @@ public function encode($data) {
* Implements Drupal\Core\Config\StorageInterface::decode().
*
* @throws ErrorException
* unserialize() triggers E_NOTICE if the string cannot be unserialized.
* The unserialize() call will trigger E_NOTICE if the string cannot
* be unserialized.
*/
public function decode($raw) {
$data = @unserialize($raw);
......
......@@ -125,7 +125,8 @@ private function parseDefinitions($content, $file)
* @param array $service
* @param string $file
*
* @throws InvalidArgumentException When tags are invalid
* @throws InvalidArgumentException
* When tags are invalid.
*/
private function parseDefinition($id, $service, $file)
{
......@@ -319,7 +320,8 @@ private function parseDefinition($id, $service, $file)
*
* @return array The file content
*
* @throws InvalidArgumentException when the given file is not a local file or when it does not exist
* @throws InvalidArgumentException
* When the given file is not a local file or when it does not exist.
*/
protected function loadFile($file)
{
......@@ -342,7 +344,8 @@ protected function loadFile($file)
*
* @return array
*
* @throws InvalidArgumentException When service file is not valid
* @throws InvalidArgumentException
* When service file is not valid.
*/
private function validate($content, $file)
{
......
......@@ -21,7 +21,7 @@ interface ThemeHandlerInterface {
* Whether any of the given themes have been installed.
*
* @throws \Drupal\Core\Extension\ExtensionNameLengthException
* Thrown when the theme name is to long
* Thrown when the theme name is to long.
*
* @deprecated in Drupal 8.0.x-dev and will be removed before Drupal 9.0.0.
* Use the theme_installer service instead.
......
......@@ -21,7 +21,7 @@ interface ThemeInstallerInterface {
* Whether any of the given themes have been installed.
*
* @throws \Drupal\Core\Extension\ExtensionNameLengthException
* Thrown when the theme name is to long
* Thrown when the theme name is to long.
*/
public function install(array $theme_list, $install_dependencies = TRUE);
......
......@@ -319,8 +319,8 @@ public function renderPlaceholder($placeholder, array $elements);
* The rendered HTML.
*
* @throws \LogicException
* When called outside of a render context. (i.e. outside of a renderRoot(),
* renderPlain() or executeInRenderContext() call.)
* When called outside of a render context (i.e. outside of a renderRoot(),
* renderPlain() or executeInRenderContext() call).
* @throws \Exception
* If a #pre_render callback throws an exception, it is caught to mark the
* renderer as no longer being in a root render call, if any. Then the
......
......@@ -157,10 +157,10 @@ public function getPathFromRoute($name, $parameters = array()) {
* The url path, without any base path, including possible query string.
*
* @throws MissingMandatoryParametersException
* When some parameters are missing that are mandatory for the route
* When some parameters are missing that are mandatory for the route.
* @throws InvalidParameterException
* When a parameter value for a placeholder is not correct because it does
* not match the requirement
* not match the requirement.
*/
protected function doGenerate(array $variables, array $defaults, array $tokens, array $parameters, array $query_params, $name) {
$variables = array_flip($variables);
......
......@@ -298,7 +298,8 @@ public function preSave(EntityStorageInterface $storage) {
* @param \Drupal\Core\Entity\EntityStorageInterface $storage
* The entity storage.
*
* @throws \Drupal\Core\Field\FieldException If the field definition is invalid.
* @throws \Drupal\Core\Field\FieldException
* If the field definition is invalid.
*/
protected function preSaveNew(EntityStorageInterface $storage) {
$entity_manager = \Drupal::entityManager();
......
......@@ -42,7 +42,8 @@ function getDirectoryPath() {
/**
* Implements Drupal\Core\StreamWrapper\StreamWrapperInterface::getExternalUrl().
* @throws \LogicException PO files URL should not be public.
* @throws \LogicException
* PO files URL should not be public.
*/
function getExternalUrl() {
throw new \LogicException('PO files URL should not be public.');
......
......@@ -62,9 +62,6 @@
<exclude name="Drupal.Commenting.FunctionComment.ReturnCommentIndentation"/>
<exclude name="Drupal.Commenting.FunctionComment.SeeAdditionalText"/>
<exclude name="Drupal.Commenting.FunctionComment.SeePunctuation"/>
<exclude name="Drupal.Commenting.FunctionComment.ThrowsComment"/>
<exclude name="Drupal.Commenting.FunctionComment.ThrowsNoFullStop"/>
<exclude name="Drupal.Commenting.FunctionComment.ThrowsNotCapital"/>
<exclude name="Drupal.Commenting.FunctionComment.TypeHintMissing"/>
<exclude name="Drupal.Commenting.FunctionComment.VoidReturn"/>
</rule>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment