Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/dom-crawler/Field/FileFormField.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 7a779792577d |
children | af1871eacc83 |
comparison
equal
deleted
inserted
replaced
16:c2387f117808 | 17:129ea1e6d783 |
---|---|
25 * | 25 * |
26 * @throws \InvalidArgumentException When error code doesn't exist | 26 * @throws \InvalidArgumentException When error code doesn't exist |
27 */ | 27 */ |
28 public function setErrorCode($error) | 28 public function setErrorCode($error) |
29 { | 29 { |
30 $codes = array(UPLOAD_ERR_INI_SIZE, UPLOAD_ERR_FORM_SIZE, UPLOAD_ERR_PARTIAL, UPLOAD_ERR_NO_FILE, UPLOAD_ERR_NO_TMP_DIR, UPLOAD_ERR_CANT_WRITE, UPLOAD_ERR_EXTENSION); | 30 $codes = [UPLOAD_ERR_INI_SIZE, UPLOAD_ERR_FORM_SIZE, UPLOAD_ERR_PARTIAL, UPLOAD_ERR_NO_FILE, UPLOAD_ERR_NO_TMP_DIR, UPLOAD_ERR_CANT_WRITE, UPLOAD_ERR_EXTENSION]; |
31 if (!in_array($error, $codes)) { | 31 if (!\in_array($error, $codes)) { |
32 throw new \InvalidArgumentException(sprintf('The error code %s is not valid.', $error)); | 32 throw new \InvalidArgumentException(sprintf('The error code %s is not valid.', $error)); |
33 } | 33 } |
34 | 34 |
35 $this->value = array('name' => '', 'type' => '', 'tmp_name' => '', 'error' => $error, 'size' => 0); | 35 $this->value = ['name' => '', 'type' => '', 'tmp_name' => '', 'error' => $error, 'size' => 0]; |
36 } | 36 } |
37 | 37 |
38 /** | 38 /** |
39 * Sets the value of the field. | 39 * Sets the value of the field. |
40 * | 40 * |
73 $size = 0; | 73 $size = 0; |
74 $name = ''; | 74 $name = ''; |
75 $value = ''; | 75 $value = ''; |
76 } | 76 } |
77 | 77 |
78 $this->value = array('name' => $name, 'type' => '', 'tmp_name' => $value, 'error' => $error, 'size' => $size); | 78 $this->value = ['name' => $name, 'type' => '', 'tmp_name' => $value, 'error' => $error, 'size' => $size]; |
79 } | 79 } |
80 | 80 |
81 /** | 81 /** |
82 * Sets path to the file as string for simulating HTTP request. | 82 * Sets path to the file as string for simulating HTTP request. |
83 * | 83 * |