FileObject::getLinkTarget()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 4
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
/*******************************************************************
3
 * Created by:  Marko Kungla @ OkramLabs on Aug 6, 2012 - 10:02:48
4
 * Contact:     [email protected] - https://okramlabs.com
5
 * @copyright   2015 OkramLabs - https://okramlabs.com
6
 * @license     MIT
7
 *
8
 * Package name:libhowi-filesystem
9
 * @category	HOWI3
10
 * @package		libhowi
11
 * @subpackage	filesystem
12
 * 
13
 * Lang:      PHP
14
 * Encoding:  UTF-8
15
 * File:      fileObject.inc
16
 * @link      https://
17
 ********************************************************************
18
 * Contributors:
19
 * @author Marko Kungla <[email protected]>
20
 *           Github: https://github.com/mkungla
21
 ********************************************************************
22
 * Comments:
23
 */
24
namespace HOWI3\libhowi\Filesystem\php5\Objects;
25
26
use \SplFileObject;
27
use \HOWI3\libhowi\Filesystem\Commons\ObjectInterfaces\FileInterface;
28
use \HOWI3\libhowi\Filesystem\php5\TraitForSharedMethods;
29
30 View Code Duplication
class FileObject extends SplFileObject implements FileInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
Bug introduced by
There is one abstract method fread in this class; you could implement it, or declare this class as abstract.
Loading history...
31
{
32
    use TraitForSharedMethods;
33
34
    /**
35
     *
36
     * {@inheritDoc}
37
     *
38
     */
39 2
    public function getLinkTarget()
40
    {
41 2
        return false;
42
    }
43
44
    /**
45
     *
46
     * {@inheritDoc}
47
     *
48
     */
49 2
    public function flock($operation, &$wouldblock = NULL)
50
    {
51 2
        return ! $wouldblock ? parent::flock($operation) : parent::flock($operation, $wouldblock);
52
    }
53
54
    /**
55
     *
56
     * {@inheritDoc}
57
     *
58
     */
59 2
    public function hasChildren()
60
    {
61 2
        return false;
62
    }
63
64
    /**
65
     *
66
     * {@inheritDoc}
67
     *
68
     */
69 2
    public function getChildren()
70
    {
71 2
        return false;
72
    }
73
74
    /**
75
     *
76
     * {@inheritDoc}
77
     *
78
     */
79 4
    public function isDot()
80
    {
81 4
        return false;
82
    }
83
    
84
    /**
85
     * Dummy file scale up to x bytes
86
     * @param int $size
87
     */
88 2
    public function dummyScale($size)
89
    {
90 2
        if(!is_int($size) || $this->getSize() > $size) return false;
91
        
92 2
        $this->fseek($size ,SEEK_SET);
93 2
        $this->fwrite(' ');
94 2
        return true;
95
    }
96
}
97