for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Copyright (c) 2014 Robin Appelman <[email protected]>
* This file is licensed under the Licensed under the MIT license:
* http://opensource.org/licenses/MIT
*/
namespace Icewind\SMB\Wrapped;
use Icewind\SMB\ACL;
use Icewind\SMB\IFileInfo;
class FileInfo implements IFileInfo {
* @var string
protected $path;
protected $name;
* @var int
protected $size;
protected $time;
protected $mode;
* @var callable
protected $aclCallback;
* @param string $path
* @param string $name
* @param int $size
* @param int $time
* @param int $mode
* @param callable $aclCallback
public function __construct($path, $name, $size, $time, $mode, callable $aclCallback) {
$this->path = $path;
$this->name = $name;
$this->size = $size;
$this->time = $time;
$this->mode = $mode;
$this->aclCallback = $aclCallback;
}
* @return string
public function getPath() {
return $this->path;
public function getName() {
return $this->name;
* @return int
public function getSize() {
return $this->size;
public function getMTime() {
return $this->time;
* @return bool
public function isDirectory() {
return (bool)($this->mode & IFileInfo::MODE_DIRECTORY);
public function isReadOnly() {
return (bool)($this->mode & IFileInfo::MODE_READONLY);
public function isHidden() {
return (bool)($this->mode & IFileInfo::MODE_HIDDEN);
public function isSystem() {
return (bool)($this->mode & IFileInfo::MODE_SYSTEM);
public function isArchived() {
return (bool)($this->mode & IFileInfo::MODE_ARCHIVE);
* @return ACL[]
public function getAcls(): array {
return ($this->aclCallback)();