SharedMethodsInterface::isLink()
last analyzed

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 1
1
<?php
2
/********************************************************************
3
 * Created by:	Marko Kungla @ OkramLabs on Aug 6, 2012 - 9:58:05
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
 ********************************************************************
16
 * Contributors:
17
 * @author Marko Kungla <[email protected]>
18
 *           Github: https://github.com/mkungla
19
 ********************************************************************
20
 * Comments:
21
 */
22
namespace HOWI3\libhowi\Filesystem\Commons;
23
24
interface SharedMethodsInterface
25
{
26
27
    /**
28
     * Gets the current working directory
29
     *
30
     * @return string;
0 ignored issues
show
Documentation introduced by
The doc-type string; could not be parsed: Expected "|" or "end of type", but got ";" at position 6. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
31
     */
32
    public function getCwd();
33
34
    /**
35
     * Gets file or directory size
36
     *
37
     * For directory it will return directory total size
38
     *
39
     * @param string $filename            
0 ignored issues
show
Documentation introduced by
Should the type for parameter $filename not be false|string?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
40
     * @param string $convert            
0 ignored issues
show
Documentation introduced by
Should the type for parameter $convert not be false|string?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
41
     * @return in file / directory size or formated array
42
     */
43
    public function getSize($convert = false, $filename = false);
44
45
    /**
46
     * Gets last access time of file
47
     *
48
     * @param string $timeformat            
0 ignored issues
show
Documentation introduced by
Should the type for parameter $timeformat not be false|string?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
49
     * @param string $filename            
0 ignored issues
show
Bug introduced by
There is no parameter named $filename. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
50
     * @return int or formated output
51
     */
52
    public function getATime($timeformat = false, $pathname = false);
53
54
    /**
55
     * Gets inode change time of file
56
     *
57
     * @param string $timeformat            
0 ignored issues
show
Documentation introduced by
Should the type for parameter $timeformat not be false|string?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
58
     * @param string $filename            
0 ignored issues
show
Bug introduced by
There is no parameter named $filename. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
59
     * @return int or formated output
60
     */
61
    public function getCTime($timeformat = false, $pathname = false);
62
63
    /**
64
     * Gets file modification time
65
     *
66
     * @param string $timeformat            
0 ignored issues
show
Documentation introduced by
Should the type for parameter $timeformat not be false|string?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
67
     * @param string $filename            
0 ignored issues
show
Bug introduced by
There is no parameter named $filename. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
68
     * @return int or formated output
69
     */
70
    public function getMTime($timeformat = false, $pathname = false);
71
72
    /**
73
     * Conver to ago
74
     *
75
     * @param time $timestamp            
76
     * @param string $date_format
77
     *            a | y,m,d,h,i,s
78
     * @param bool $sfx
79
     *            short or long representation
80
     * @param string $ommit_zero
0 ignored issues
show
Documentation introduced by
Should the type for parameter $ommit_zero not be boolean|string?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
81
     *            ommit emty values?
82
     * @param string $ago_single            
0 ignored issues
show
Documentation introduced by
Should the type for parameter $ago_single not be boolean|string?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
83
     * @param array $clocale            
84
     */
85
    public function ct_ago($timestamp, $date_format = 'y,m,d,h,i,s', $sfx = true, $ommit_zero = true, $ago_single = true, $clocale = []);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
86
87
    /**
88
     * Creates an FileObject object of the file.
89
     *
90
     * This is useful because FileObject contains additional methods
91
     * for manipulating the file whereas FileInfo is only useful
92
     * for gaining information, like whether the file is writable.
93
     *
94
     * @param string $open_mode            
95
     * @param string $use_include_path            
0 ignored issues
show
Documentation introduced by
Should the type for parameter $use_include_path not be false|string?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
96
     * @param unknown $context            
0 ignored issues
show
Documentation introduced by
Should the type for parameter $context not be unknown|null?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
97
     */
98
    public function openFile($open_mode = "r", $use_include_path = false, $context = null);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
99
100
    /**
101
     * Sets the class used with InfoObject::openFile()
102
     *
103
     * @param string $class_name            
104
     */
105
    public function setFileClass($class_name = "\HOWI3\libhowi\Filesystem\php5\Objects\FileObject");
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
106
107
    /**
108
     * Sets the class used with InfoObject::getFileInfo() and SplFileInfo::getPathInfo()
109
     *
110
     * @param string $class_name            
111
     */
112
    public function setInfoClass($class_name = "\HOWI3\libhowi\Filesystem\php5\Objects\InfoObject");
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
113
114
    /**
115
     * Gets file owner username
116
     *
117
     * @param string $filename            
0 ignored issues
show
Documentation introduced by
Should the type for parameter $filename not be false|string?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
118
     * @return string owners username
119
     */
120
    public function getOwnerName($filename = false);
121
122
    /**
123
     * Gets file group name
124
     *
125
     * @param string $filename            
0 ignored issues
show
Documentation introduced by
Should the type for parameter $filename not be false|string?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
126
     * @return string group name
127
     */
128
    public function getGroupName($filename = false);
129
130
    /**
131
     * Returns canonicalized absolute pathname
132
     *
133
     * @param string $filename            
0 ignored issues
show
Documentation introduced by
Should the type for parameter $filename not be false|string?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
134
     * @return string
135
     */
136
    public function getRealpath($filename = false);
137
138
    /**
139
     * Returns information about a file path
140
     *
141
     * If you supply $filename so you are not calling it on FileObject, InfoObject
142
     * or DirectoryTreeObject you can specify following flags
143
     * PATHINFO_DIRNAME, PATHINFO_BASENAME, PATHINFO_EXTENSION or PATHINFO_FILENAME.
144
     *
145
     * otherwise it will return FileInfo object fo this items path
146
     *
147
     * @param string $filename            
0 ignored issues
show
Documentation introduced by
Should the type for parameter $filename not be false|string?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
148
     * @param int $flags            
0 ignored issues
show
Documentation introduced by
Should the type for parameter $flags not be false|integer?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
149
     * @return mixed
150
     */
151
    public function getPathInfo($filename = false, $flags = false, 
152
        $class_name = '\HOWI3\libhowi\Filesystem\php5\Objects\InfoObject');
153
154
    /**
155
     * Get path of current Iterator item without filename or
156
     * Gets the path without filename
157
     *
158
     * @return string $path
159
     */
160
    public function getPath();
161
162
    /**
163
     * Gets the path to the file
164
     *
165
     * @return string $path
166
     */
167
    public function getPathname();
168
169
    /**
170
     * Gets file group
171
     *
172
     * @param string $filename            
0 ignored issues
show
Documentation introduced by
Should the type for parameter $filename not be false|string?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
173
     * @return int group id
174
     */
175
    public function getGroup($filename = false);
176
177
    /**
178
     * Gets file owner ID
179
     *
180
     * @param string $filename            
0 ignored issues
show
Documentation introduced by
Should the type for parameter $filename not be false|string?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
181
     * @return int owners user id
182
     */
183
    public function getOwner($filename = false);
184
185
    /**
186
     * Gets item inode
187
     *
188
     * @param string $filename            
0 ignored issues
show
Documentation introduced by
Should the type for parameter $filename not be false|string?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
189
     * @return int inode
190
     */
191
    public function getInode($filename = false);
192
193
    /**
194
     * Returns trailing name component of path
195
     *
196
     * Getting the path to a file or directory from current iterator (non dot) position,
197
     * this function will return the trailing name component. When getBasename is called
198
     * on Dot the current directory basename is returned instead!
199
     *
200
     * @param string $suffix            
0 ignored issues
show
Documentation introduced by
Should the type for parameter $suffix not be false|string?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
201
     * @param string $pathname            
0 ignored issues
show
Documentation introduced by
Should the type for parameter $pathname not be false|string?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
202
     * @return string Name of given path
203
     */
204
    public function getBasename($suffix = false, $pathname = false);
205
206
    /**
207
     * Gets file permissions (non octal)
208
     *
209
     * @param string $filename            
0 ignored issues
show
Documentation introduced by
Should the type for parameter $filename not be false|string?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
210
     * @return int like 755
211
     */
212
    public function getPerms($filename = false);
213
214
    /**
215
     * Gets file type
216
     *
217
     * @param string $filename            
0 ignored issues
show
Documentation introduced by
Should the type for parameter $filename not be false|string?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
218
     * @return string filetype
219
     */
220
    public function getType($filename = false);
221
222
    /**
223
     * Determine if current DirectoryIterator item is '.' or '..'
224
     * 
225
     * @return bool
226
     */
227
    public function isDot();
228
229
    /**
230
     * whether the file path is an absolute path.
231
     *
232
     * @param string $path            
0 ignored issues
show
Documentation introduced by
Should the type for parameter $path not be false|string?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
233
     * @return bool
234
     */
235
    public function isAbsolute($path = false);
236
237
    /**
238
     * whether the file path is an relative path.
239
     *
240
     * @param string $path            
0 ignored issues
show
Documentation introduced by
Should the type for parameter $path not be false|string?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
241
     * @return bool
242
     */
243
    public function isRelative($path = false);
244
245
    /**
246
     * Is path or directory writable
247
     *
248
     * @param string $path            
0 ignored issues
show
Documentation introduced by
Should the type for parameter $path not be false|string?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
249
     * @return bool
250
     */
251
    public function isWritable($path = false);
252
253
    /**
254
     * Tells whether a file exists and is readable
255
     *
256
     * @param string $filename            
0 ignored issues
show
Documentation introduced by
Should the type for parameter $filename not be false|string?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
257
     * @return bool
258
     */
259
    public function isReadable($filename = false);
260
261
    /**
262
     * Tells whether the filename is a directory
263
     *
264
     * @param string $filename            
0 ignored issues
show
Documentation introduced by
Should the type for parameter $filename not be false|string?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
265
     * @return bool
266
     */
267
    public function isDir($filename = false);
268
269
    /**
270
     * Tells whether the filename is executable
271
     *
272
     * @param string $filename            
0 ignored issues
show
Documentation introduced by
Should the type for parameter $filename not be false|string?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
273
     * @return bool
274
     */
275
    public function isExecutable($filename = false);
276
277
    /**
278
     * Tells whether the filename is a regular file
279
     *
280
     * @param string $filename            
0 ignored issues
show
Documentation introduced by
Should the type for parameter $filename not be false|string?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
281
     * @return bool
282
     */
283
    public function isFile($filename = false);
284
285
    /**
286
     * Tells whether the filename is a symbolic link
287
     *
288
     * @param string $filename            
0 ignored issues
show
Documentation introduced by
Should the type for parameter $filename not be false|string?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
289
     * @return bool
290
     */
291
    public function isLink($filename = false);
292
293
    /**
294
     * Convert any path to absolute
295
     *
296
     * @param string $path            
0 ignored issues
show
Documentation introduced by
Should the type for parameter $path not be false|string?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
297
     * @return string absolute path
298
     */
299
    public function makeAbsolute($path = false);
300
301
    /**
302
     * Does file or directory exist
303
     *
304
     * @param string $pathname            
0 ignored issues
show
Documentation introduced by
Should the type for parameter $pathname not be false|string?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
305
     * @return bool
306
     */
307
    public function exists($pathname = false);
308
309
    /**
310
     * Return file name from path or Gets the file name from object
311
     *
312
     * @return array
313
     */
314
    public function getFilename($filename = false);
315
316
    /**
317
     * Gets the file extension
318
     *
319
     * @return string
320
     */
321
    public function getExtension($filename = false);
322
}
323