diff --git a/core/modules/path/lib/Drupal/path/Controller/PathController.php b/core/modules/path/lib/Drupal/path/Controller/PathController.php index a8fae4a..84f31d0 100644 --- a/core/modules/path/lib/Drupal/path/Controller/PathController.php +++ b/core/modules/path/lib/Drupal/path/Controller/PathController.php @@ -13,6 +13,7 @@ class PathController { /** + * Controller routines for path routes. * @todo Remove path_admin_overview(). */ public function adminOverview($keys = NULL) { @@ -21,6 +22,7 @@ public function adminOverview($keys = NULL) { } /** + * Controller routines for path routes. * @todo Remove path_admin_edit(). */ public function adminEdit($path) { @@ -30,6 +32,7 @@ public function adminEdit($path) { } /** + * Controller routines for path routes. * @todo Remove path_admin_edit(). */ public function adminAdd() { diff --git a/core/modules/path/lib/Drupal/path/Plugin/Field/FieldType/PathItem.php b/core/modules/path/lib/Drupal/path/Plugin/Field/FieldType/PathItem.php index 8125ff9..e6a2cbc 100644 --- a/core/modules/path/lib/Drupal/path/Plugin/Field/FieldType/PathItem.php +++ b/core/modules/path/lib/Drupal/path/Plugin/Field/FieldType/PathItem.php @@ -17,7 +17,8 @@ * @FieldType( * id = "path", * label = @Translation("Path"), - * description = @Translation("An entity field containing a path alias and related data."), + * description = @Translation("An entity field containing + * a path alias and related data."), * configurable = FALSE * ) */ diff --git a/core/modules/path/lib/Drupal/path/Tests/PathAliasTest.php b/core/modules/path/lib/Drupal/path/Tests/PathAliasTest.php index e97101d..57fc914 100644 --- a/core/modules/path/lib/Drupal/path/Tests/PathAliasTest.php +++ b/core/modules/path/lib/Drupal/path/Tests/PathAliasTest.php @@ -19,6 +19,9 @@ class PathAliasTest extends PathTestBase { */ public static $modules = array('path'); + /** + * {@inheritdoc} + */ public static function getInfo() { return array( 'name' => 'Path alias functionality', @@ -27,18 +30,25 @@ public static function getInfo() { ); } - function setUp() { + /** + * {@inheritdoc} + */ + public function setUp() { parent::setUp(); // Create test user and login. - $web_user = $this->drupalCreateUser(array('create page content', 'edit own page content', 'administer url aliases', 'create url aliases')); + $web_user = $this->drupalCreateUser(array( + 'create page content', + 'edit own page content', + 'administer url aliases', + 'create url aliases')); $this->drupalLogin($web_user); } /** * Tests the path cache. */ - function testPathCache() { + public function testPathCache() { // Create test node. $node1 = $this->drupalCreateNode(); @@ -69,7 +79,7 @@ function testPathCache() { /** * Tests alias functionality through the admin interfaces. */ - function testAdminAlias() { + public function testAdminAlias() { // Create test node. $node1 = $this->drupalCreateNode(); @@ -88,9 +98,10 @@ function testAdminAlias() { $pid = $this->getPID($edit['alias']); $previous = $edit['alias']; - $edit['alias'] = "- ._~!$'\"()*@[]?&+%#,;=:" . // "Special" ASCII characters. - "%23%25%26%2B%2F%3F" . // Characters that look like a percent-escaped string. - "éøïвβ中國書۞"; // Characters from various non-ASCII alphabets. + // "Special" ASCII characters. + // Characters that look like a percent-escaped string. + // Characters from various non-ASCII alphabets. + $edit['alias'] = "- ._~!$'\"()*@[]?&+%#,;=:%23%25%26%2B%2F%3Féøïвβ中國書۞"; $this->drupalPostForm('admin/config/search/path/edit/' . $pid, $edit, t('Save')); // Confirm that the alias works. @@ -109,7 +120,7 @@ function testAdminAlias() { // Set alias to second test node. $edit['source'] = 'node/' . $node2->id(); - // leave $edit['alias'] the same + // Leave $edit['alias'] the same. $this->drupalPostForm('admin/config/search/path/add', $edit, t('Save')); // Confirm no duplicate was created. @@ -140,7 +151,7 @@ function testAdminAlias() { /** * Tests alias functionality through the node interfaces. */ - function testNodeAlias() { + public function testNodeAlias() { // Create test node. $node1 = $this->drupalCreateNode(); @@ -162,9 +173,10 @@ function testNodeAlias() { // Change alias to one containing "exotic" characters. $previous = $edit['path[alias]']; - $edit['path[alias]'] = "- ._~!$'\"()*@[]?&+%#,;=:" . // "Special" ASCII characters. - "%23%25%26%2B%2F%3F" . // Characters that look like a percent-escaped string. - "éøïвβ中國書۞"; // Characters from various non-ASCII alphabets. + // "Special" ASCII characters. + // Characters that look like a percent-escaped string. + // Characters from various non-ASCII alphabets. + $edit['path[alias]'] = "- ._~!$'\"()*@[]?&+%#,;=:%23%25%26%2B%2F%3Féøïвβ中國書۞"; $this->drupalPostForm('node/' . $node1->id() . '/edit', $edit, t('Save')); // Confirm that the alias works. @@ -199,20 +211,21 @@ function testNodeAlias() { /** * Returns the path ID. * - * @param $alias + * @param string $alias * A string containing an aliased path. * * @return int * Integer representing the path ID. */ - function getPID($alias) { - return db_query("SELECT pid FROM {url_alias} WHERE alias = :alias", array(':alias' => $alias))->fetchField(); + public function getPID($alias) { + return db_query("SELECT pid FROM {url_alias} WHERE alias = :alias", array( + ':alias' => $alias))->fetchField(); } /** * Tests that duplicate aliases fail validation. */ - function testDuplicateNodeAlias() { + public function testDuplicateNodeAlias() { // Create one node with a random alias. $node_one = $this->drupalCreateNode(); $edit = array(); diff --git a/core/modules/path/lib/Drupal/path/Tests/PathLanguageTest.php b/core/modules/path/lib/Drupal/path/Tests/PathLanguageTest.php index 0653743..704c147 100644 --- a/core/modules/path/lib/Drupal/path/Tests/PathLanguageTest.php +++ b/core/modules/path/lib/Drupal/path/Tests/PathLanguageTest.php @@ -21,6 +21,9 @@ class PathLanguageTest extends PathTestBase { */ public static $modules = array('path', 'locale', 'content_translation'); + /** + * {@inheritdoc} + */ public static function getInfo() { return array( 'name' => 'Path aliases with translated nodes', @@ -29,7 +32,10 @@ public static function getInfo() { ); } - function setUp() { + /** + * {@inheritdoc} + */ + public function setUp() { parent::setUp(); $permissions = array( @@ -76,7 +82,7 @@ function setUp() { /** * Test alias functionality through the admin interfaces. */ - function testAliasTranslation() { + public function testAliasTranslation() { $english_node = $this->drupalCreateNode(array('type' => 'page', 'langcode' => 'en')); $english_alias = $this->randomName(); diff --git a/core/modules/path/lib/Drupal/path/Tests/PathLanguageUiTest.php b/core/modules/path/lib/Drupal/path/Tests/PathLanguageUiTest.php index 5c97eff..7673794 100644 --- a/core/modules/path/lib/Drupal/path/Tests/PathLanguageUiTest.php +++ b/core/modules/path/lib/Drupal/path/Tests/PathLanguageUiTest.php @@ -19,6 +19,9 @@ class PathLanguageUiTest extends PathTestBase { */ public static $modules = array('path', 'locale'); + /** + * {@inheritdoc} + */ public static function getInfo() { return array( 'name' => 'Path aliases with languages', @@ -27,11 +30,20 @@ public static function getInfo() { ); } - function setUp() { + /** + * {@inheritdoc} + */ + public function setUp() { parent::setUp(); // Create and login user. - $web_user = $this->drupalCreateUser(array('edit any page content', 'create page content', 'administer url aliases', 'create url aliases', 'administer languages', 'access administration pages')); + $web_user = $this->drupalCreateUser(array( + 'edit any page content', + 'create page content', + 'administer url aliases', + 'create url aliases', + 'administer languages', + 'access administration pages')); $this->drupalLogin($web_user); // Enable French language. @@ -48,7 +60,7 @@ function setUp() { /** * Tests that a language-neutral URL alias works. */ - function testLanguageNeutralUrl() { + public function testLanguageNeutralUrl() { $name = $this->randomName(8); $edit = array(); $edit['source'] = 'admin/config/search/path'; @@ -62,7 +74,7 @@ function testLanguageNeutralUrl() { /** * Tests that a default language URL alias works. */ - function testDefaultLanguageUrl() { + public function testDefaultLanguageUrl() { $name = $this->randomName(8); $edit = array(); $edit['source'] = 'admin/config/search/path'; @@ -77,7 +89,7 @@ function testDefaultLanguageUrl() { /** * Tests that a non-default language URL alias works. */ - function testNonDefaultUrl() { + public function testNonDefaultUrl() { $name = $this->randomName(8); $edit = array(); $edit['source'] = 'admin/config/search/path'; diff --git a/core/modules/path/lib/Drupal/path/Tests/PathTaxonomyTermTest.php b/core/modules/path/lib/Drupal/path/Tests/PathTaxonomyTermTest.php index c483d9e..5b1c40f 100644 --- a/core/modules/path/lib/Drupal/path/Tests/PathTaxonomyTermTest.php +++ b/core/modules/path/lib/Drupal/path/Tests/PathTaxonomyTermTest.php @@ -19,6 +19,9 @@ class PathTaxonomyTermTest extends PathTestBase { */ public static $modules = array('taxonomy'); + /** + * {@inheritdoc} + */ public static function getInfo() { return array( 'name' => 'Taxonomy term URL aliases', @@ -27,7 +30,10 @@ public static function getInfo() { ); } - function setUp() { + /** + * {@inheritdoc} + */ + public function setUp() { parent::setUp(); // Create a Tags vocabulary for the Article node type. @@ -38,14 +44,17 @@ function setUp() { $vocabulary->save(); // Create and login user. - $web_user = $this->drupalCreateUser(array('administer url aliases', 'administer taxonomy', 'access administration pages')); + $web_user = $this->drupalCreateUser(array( + 'administer url aliases', + 'administer taxonomy', + 'access administration pages')); $this->drupalLogin($web_user); } /** * Tests alias functionality through the admin interfaces. */ - function testTermAlias() { + public function testTermAlias() { // Create a term in the default 'Tags' vocabulary with URL alias. $vocabulary = entity_load('taxonomy_vocabulary', 'tags'); $description = $this->randomName(); diff --git a/core/modules/path/lib/Drupal/path/Tests/PathTestBase.php b/core/modules/path/lib/Drupal/path/Tests/PathTestBase.php index 97f3f81..d3cd1b2 100644 --- a/core/modules/path/lib/Drupal/path/Tests/PathTestBase.php +++ b/core/modules/path/lib/Drupal/path/Tests/PathTestBase.php @@ -21,7 +21,10 @@ */ public static $modules = array('node', 'path'); - function setUp() { + /** + * {@inheritdoc} + */ + public function setUp() { parent::setUp(); // Create Basic page and Article node types. diff --git a/core/modules/path/path.admin.inc b/core/modules/path/path.admin.inc index d22fe66..c8eeaff 100644 --- a/core/modules/path/path.admin.inc +++ b/core/modules/path/path.admin.inc @@ -102,10 +102,10 @@ function path_admin_overview($keys = NULL) { /** * Page callback: Returns a form creating or editing a path alias. * - * @param $path + * @param string $path * An array containing the path ID, source, alias, and language code. * - * @return + * @return output * A form for adding or editing a URL alias. * * @see path_menu() @@ -129,7 +129,7 @@ function path_admin_edit($path = array()) { /** * Form constructor for the path administration form. * - * @param $path + * @param string $path * An array containing the path ID, source, alias, and language code. * * @ingroup forms @@ -137,7 +137,11 @@ function path_admin_edit($path = array()) { * @see path_admin_form_submit() * @see path_admin_form_delete_submit() */ -function path_admin_form($form, &$form_state, $path = array('source' => '', 'alias' => '', 'langcode' => Language::LANGCODE_NOT_SPECIFIED, 'pid' => NULL)) { +function path_admin_form($form, &$form_state, $path = array( + 'source' => '', + 'alias' => '', + 'langcode' => Language::LANGCODE_NOT_SPECIFIED, + 'pid' => NULL)) { $form['source'] = array( '#type' => 'textfield', '#title' => t('Existing system path'), @@ -180,7 +184,7 @@ function path_admin_form($form, &$form_state, $path = array('source' => '', 'ali else { $form['langcode'] = array( '#type' => 'value', - '#value' => $path['langcode'] + '#value' => $path['langcode'], ); } @@ -301,7 +305,7 @@ function path_admin_filter_form($form, &$form_state, $keys = '') { '#type' => 'submit', '#value' => t('Filter'), '#submit' => array('path_admin_filter_form_submit_filter'), - ); + ); if ($keys) { $form['basic']['reset'] = array( '#type' => 'submit', diff --git a/core/modules/path/path.api.php b/core/modules/path/path.api.php index c69b97d..6758d86 100644 --- a/core/modules/path/path.api.php +++ b/core/modules/path/path.api.php @@ -13,7 +13,7 @@ /** * Respond to a path being inserted. * - * @param $path + * @param string $path * An associative array containing the following keys: * - source: The internal system path. * - alias: The URL alias. @@ -34,7 +34,7 @@ function hook_path_insert($path) { /** * Respond to a path being updated. * - * @param $path + * @param string $path * An associative array containing the following keys: * - source: The internal system path. * - alias: The URL alias. @@ -53,7 +53,7 @@ function hook_path_update($path) { /** * Respond to a path being deleted. * - * @param $path + * @param string $path * An associative array containing the following keys: * - source: The internal system path. * - alias: The URL alias.