Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e9a9557

Browse filesBrowse files
Cleanup after bump to Symfony v4.4
1 parent 3d10a6c commit e9a9557
Copy full SHA for e9a9557

File tree

4 files changed

+5
-30
lines changed
Filter options

4 files changed

+5
-30
lines changed

‎.gitignore

Copy file name to clipboardExpand all lines: .gitignore
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ vendor/
22
composer.lock
33
phpunit.xml
44
.php_cs.cache
5+
.phpunit.result.cache

‎Factory/HttpFoundationFactory.php

Copy file name to clipboardExpand all lines: Factory/HttpFoundationFactory.php
-12Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -112,22 +112,10 @@ private function createUploadedFile(UploadedFileInterface $psrUploadedFile)
112112
$clientFileName = $psrUploadedFile->getClientFilename();
113113
}
114114

115-
if (class_exists('Symfony\Component\HttpFoundation\HeaderUtils')) {
116-
// Symfony 4.1+
117-
return new UploadedFile(
118-
$temporaryPath,
119-
null === $clientFileName ? '' : $clientFileName,
120-
$psrUploadedFile->getClientMediaType(),
121-
$psrUploadedFile->getError(),
122-
true
123-
);
124-
}
125-
126115
return new UploadedFile(
127116
$temporaryPath,
128117
null === $clientFileName ? '' : $clientFileName,
129118
$psrUploadedFile->getClientMediaType(),
130-
$psrUploadedFile->getSize(),
131119
$psrUploadedFile->getError(),
132120
true
133121
);

‎Tests/Factory/AbstractHttpMessageFactoryTest.php

Copy file name to clipboardExpand all lines: Tests/Factory/AbstractHttpMessageFactoryTest.php
+3-12Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,7 @@ private function createUploadedFile($content, $originalName, $mimeType, $error)
132132
$path = tempnam($this->tmpDir, uniqid());
133133
file_put_contents($path, $content);
134134

135-
if (class_exists('Symfony\Component\HttpFoundation\HeaderUtils')) {
136-
// Symfony 4.1+
137-
return new UploadedFile($path, $originalName, $mimeType, $error, true);
138-
}
139-
140-
return new UploadedFile($path, $originalName, $mimeType, filesize($path), $error, true);
135+
return new UploadedFile($path, $originalName, $mimeType, $error, true);
141136
}
142137

143138
public function testCreateResponse()
@@ -189,12 +184,8 @@ public function testCreateResponseFromBinaryFile()
189184

190185
public function testUploadErrNoFile()
191186
{
192-
if (class_exists('Symfony\Component\HttpFoundation\HeaderUtils')) {
193-
// Symfony 4.1+
194-
$file = new UploadedFile('', '', null, UPLOAD_ERR_NO_FILE, true);
195-
} else {
196-
$file = new UploadedFile('', '', null, 0, UPLOAD_ERR_NO_FILE, true);
197-
}
187+
$file = new UploadedFile('', '', null, UPLOAD_ERR_NO_FILE, true);
188+
198189
$this->assertEquals(0, $file->getSize());
199190
$this->assertEquals(UPLOAD_ERR_NO_FILE, $file->getError());
200191
$this->assertFalse($file->getSize(), 'SplFile::getSize() returns false on error');

‎Tests/Functional/CovertTest.php

Copy file name to clipboardExpand all lines: Tests/Functional/CovertTest.php
+1-6Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,6 @@ private function createUploadedFile($content, $originalName, $mimeType, $error)
229229
$path = tempnam($this->tmpDir, uniqid());
230230
file_put_contents($path, $content);
231231

232-
if (class_exists('Symfony\Component\HttpFoundation\HeaderUtils')) {
233-
// Symfony 4.1+
234-
return new UploadedFile($path, $originalName, $mimeType, $error, true);
235-
}
236-
237-
return new UploadedFile($path, $originalName, $mimeType, filesize($path), $error, true);
232+
return new UploadedFile($path, $originalName, $mimeType, $error, true);
238233
}
239234
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.