Completed
Push — master ( 4fd434...e1a522 )
by Bohuslav
03:35
created

UploadFile   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 27
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A is() 0 4 1
A move() 0 4 1
1
<?php
2
namespace Kambo\Http\Message\Utils;
3
4
/**
5
 * Simple wrapper for methods connected with upload.
6
 *
7
 * @package Kambo\Http\Message\Utils
8
 * @author  Bohuslav Simek <[email protected]>
9
 * @license MIT
10
 *
11
 * @codeCoverageIgnore
12
 */
13
class UploadFile
14
{
15
    /**
16
     * Wrapper for method is_uploaded_file - tells whether the file was uploaded via HTTP POST.
17
     *
18
     * @param string $filename 
19
     *
20
     * @return bool Returns TRUE on success or FALSE on failure.
21
     */
22
    public function is($filename)
23
    {
24
        return is_uploaded_file($filename);
25
    }
26
27
    /**
28
     * Wrapper for method move_uploaded_file - moves an uploaded file to a new location.
29
     *
30
     * @param string $filename    The filename of the uploaded file.
31
     * @param string $destination The destination of the moved file.
32
     *
33
     * @return bool Returns TRUE on success or FALSE on failure.
34
     */
35
    public function move($filename, $destination)
36
    {
37
        return move_uploaded_file($filename, $destination);
38
    }
39
}
40