Commit ac7ba212 authored by alexpott's avatar alexpott

Issue #1811858 by Mile23, deepakaryan1988: Add missing type hinting to File module docblocks

parent b497d61f
......@@ -18,7 +18,7 @@
*
* @param \Drupal\file\FileInterface $file
* The file entity being validated.
* @return
* @return array
* An array of error messages. If there are no problems with the file return
* an empty array.
*
......
This diff is collapsed.
......@@ -256,10 +256,10 @@ public static function validateMaxFilesize($element, FormStateInterface $form_st
/**
* Determines the URI for a file field.
*
* @param $data
* @param array $data
* An array of token objects to pass to token_replace().
*
* @return
* @return string
* A file directory URI with tokens replaced.
*
* @see token_replace()
......@@ -277,7 +277,7 @@ public function getUploadLocation($data = array()) {
/**
* Retrieves the upload validators for a file field.
*
* @return
* @return array
* An array suitable for passing to file_save_upload() or the file field
* element's '#upload_validators' property.
*/
......
......@@ -48,7 +48,7 @@ class Fid extends NumericArgument implements ContainerFactoryPluginInterface {
* The plugin implementation definition.
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
* The entity manager.
* @param \Drupal\Core\Entity\Query\QueryFactory
* @param \Drupal\Core\Entity\Query\QueryFactory $entity_query
* The entity query factory.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityManagerInterface $entity_manager, QueryFactory $entity_query) {
......
......@@ -130,14 +130,14 @@ function testFileCreateUrl() {
* the URL generated by file_create_url() for the specified file equals the
* specified URL; fetch the URL and then compare the contents to the file.
*
* @param $scheme
* A scheme, e.g. "public"
* @param $directory
* A directory, possibly ""
* @param $filename
* A filename
* @param $expected_url
* The expected URL
* @param string $scheme
* A scheme, e.g. "public".
* @param string $directory
* A directory, possibly "".
* @param string $filename
* A filename.
* @param string $expected_url
* The expected URL.
*/
private function checkUrl($scheme, $directory, $filename, $expected_url) {
// Convert $filename to a valid filename, i.e. strip characters not
......
......@@ -65,12 +65,12 @@ function testUploadPath() {
/**
* Asserts that a file is uploaded to the right location.
*
* @param $expected_path
* @param string $expected_path
* The location where the file is expected to be uploaded. Duplicate file
* names to not need to be taken into account.
* @param $actual_path
* @param string $actual_path
* Where the file was actually uploaded.
* @param $message
* @param string $message
* The message to display with this assertion.
*/
function assertPathMatch($expected_path, $actual_path, $message) {
......
......@@ -61,17 +61,17 @@ function getLastFileId() {
/**
* Creates a new file field.
*
* @param $name
* @param string $name
* The name of the new field (all lowercase), exclude the "field_" prefix.
* @param $entity_type
* @param string $entity_type
* The entity type.
* @param $bundle
* @param string $bundle
* The bundle that this field will be added to.
* @param $storage_settings
* @param array $storage_settings
* A list of field storage settings that will be added to the defaults.
* @param $field_settings
* @param array $field_settings
* A list of instance settings that will be added to the instance defaults.
* @param $widget_settings
* @param array $widget_settings
* A list of widget settings that will be added to the widget defaults.
*/
function createFileField($name, $entity_type, $bundle, $storage_settings = array(), $field_settings = array(), $widget_settings = array()) {
......@@ -91,15 +91,15 @@ function createFileField($name, $entity_type, $bundle, $storage_settings = array
/**
* Attaches a file field to an entity.
*
* @param $name
* @param string $name
* The name of the new field (all lowercase), exclude the "field_" prefix.
* @param $entity_type
* @param string $entity_type
* The entity type this field will be added to.
* @param $bundle
* @param string $bundle
* The bundle this field will be added to.
* @param $field_settings
* @param array $field_settings
* A list of field settings that will be added to the defaults.
* @param $widget_settings
* @param array $widget_settings
* A list of widget settings that will be added to the widget defaults.
*/
function attachFileField($name, $entity_type, $bundle, $field_settings = array(), $widget_settings = array()) {
......
......@@ -33,7 +33,7 @@ protected function setUp() {
* Assert that all of the specified hook_file_* hooks were called once, other
* values result in failure.
*
* @param $expected
* @param array $expected
* Array with string containing with the hook name, e.g. 'load', 'save',
* 'insert', etc.
*/
......@@ -65,11 +65,11 @@ function assertFileHooksCalled($expected) {
/**
* Assert that a hook_file_* hook was called a certain number of times.
*
* @param $hook
* @param string $hook
* String with the hook name, e.g. 'load', 'save', 'insert', etc.
* @param $expected_count
* @param int $expected_count
* Optional integer count.
* @param $message
* @param string|NULL $message
* Optional translated string message.
*/
function assertFileHookCalled($hook, $expected_count = 1, $message = NULL) {
......@@ -137,13 +137,13 @@ function assertSameFile(FileInterface $file1, FileInterface $file2) {
* Create a file and save it to the files table and assert that it occurs
* correctly.
*
* @param $filepath
* @param string $filepath
* Optional string specifying the file path. If none is provided then a
* randomly named file will be created in the site's files directory.
* @param $contents
* @param string $contents
* Optional contents to save into the file. If a NULL value is provided an
* arbitrary string will be used.
* @param $scheme
* @param string $scheme
* Optional string indicating the stream scheme to use. Drupal core includes
* public, private, and temporary. The public wrapper is the default.
* @return \Drupal\file\FileInterface
......
......@@ -45,7 +45,7 @@ protected function setUp() {
* Assert that all of the specified hook_file_* hooks were called once, other
* values result in failure.
*
* @param $expected
* @param array $expected
* Array with string containing with the hook name, e.g. 'load', 'save',
* 'insert', etc.
*/
......@@ -77,11 +77,11 @@ function assertFileHooksCalled($expected) {
/**
* Assert that a hook_file_* hook was called a certain number of times.
*
* @param $hook
* @param string $hook
* String with the hook name, e.g. 'load', 'save', 'insert', etc.
* @param $expected_count
* @param int $expected_count
* Optional integer count.
* @param $message
* @param string $message
* Optional translated string message.
*/
function assertFileHookCalled($hook, $expected_count = 1, $message = NULL) {
......@@ -149,13 +149,13 @@ function assertSameFile(FileInterface $file1, FileInterface $file2) {
* Create a file and save it to the files table and assert that it occurs
* correctly.
*
* @param $filepath
* @param string $filepath
* Optional string specifying the file path. If none is provided then a
* randomly named file will be created in the site's files directory.
* @param $contents
* @param string $contents
* Optional contents to save into the file. If a NULL value is provided an
* arbitrary string will be used.
* @param $scheme
* @param string $scheme
* Optional string indicating the stream scheme to use. Drupal core includes
* public, private, and temporary. The public wrapper is the default.
* @return \Drupal\file\FileInterface
......
......@@ -45,11 +45,11 @@ function file_test_reset() {
* Get the arguments passed to invocation of a given hook since
* file_test_reset() was last called.
*
* @param $op
* @param string $op
* One of the hook_file_* operations: 'load', 'validate', 'download',
* 'insert', 'update', 'copy', 'move', 'delete'.
*
* @return
* @return array
* Array of the parameters passed to each call.
*
* @see _file_test_log_call()
......@@ -75,10 +75,10 @@ function file_test_get_all_calls() {
/**
* Store the values passed to a hook invocation.
*
* @param $op
* @param string $op
* One of the hook_file_* operations: 'load', 'validate', 'download',
* 'insert', 'update', 'copy', 'move', 'delete'.
* @param $args
* @param array $args
* Values passed to hook.
*
* @see file_test_get_calls()
......@@ -95,10 +95,10 @@ function _file_test_log_call($op, $args) {
/**
* Load the appropriate return value.
*
* @param $op
* @param string $op
* One of the hook_file_[validate,download] operations.
*
* @return
* @return mixed
* Value set by file_test_set_return().
*
* @see file_test_set_return()
......@@ -112,9 +112,9 @@ function _file_test_get_return($op) {
/**
* Assign a return value for a given operation.
*
* @param $op
* @param string $op
* One of the hook_file_[validate,download] operations.
* @param $value
* @param mixed $value
* Value for the hook to return.
*
* @see _file_test_get_return()
......@@ -317,9 +317,9 @@ function file_test_validator(File $file, $errors) {
* When the function is called with no $filepath parameter, the results are
* returned.
*
* @param $filepath
* @param string|NULL $filepath
* File path
* @return
* @return array
* If $filepath is NULL, an array of all previous $filepath parameters
*/
function file_test_file_scan_callback($filepath = NULL) {
......
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