Page MenuHomeDevCentral

No OneTemporary

diff --git a/src/Reflection/File.php b/src/IO/File.php
similarity index 96%
rename from src/Reflection/File.php
rename to src/IO/File.php
index fc98027..13bb148 100644
--- a/src/Reflection/File.php
+++ b/src/IO/File.php
@@ -1,67 +1,67 @@
<?php
-namespace Keruald\OmniTools\Reflection;
+namespace Keruald\OmniTools\IO;
class File {
/**
* @var string
*/
private $filename;
///
/// Constructors
///
public static function from (string $filename) : self {
$instance = new self;
$instance->filename = $filename;
return $instance;
}
///
/// Getters and setters
///
public function getFilename () : string {
return $this->filename;
}
public function setFilename (string $filename) : self {
$this->filename = $filename;
return $this;
}
///
/// File properties methods
///
public function exists () : bool {
return file_exists($this->filename);
}
public function isReadable () : bool {
return is_readable($this->filename);
}
///
/// Include methods
///
public function tryInclude () : bool {
if (!$this->canBeIncluded()) {
return false;
}
include($this->filename);
return true;
}
public function canBeIncluded () : bool {
return $this->exists() &&$this->isReadable();
}
}
diff --git a/src/Reflection/CodeFile.php b/src/Reflection/CodeFile.php
index 56731e0..f4e20e8 100644
--- a/src/Reflection/CodeFile.php
+++ b/src/Reflection/CodeFile.php
@@ -1,25 +1,27 @@
<?php
namespace Keruald\OmniTools\Reflection;
+use Keruald\OmniTools\IO\File;
+
class CodeFile extends File {
///
/// Include methods
///
public function tryInclude () : bool {
if (!$this->canBeIncluded()) {
return false;
}
include($this->getFilename());
return true;
}
public function canBeIncluded () : bool {
return $this->exists() &&$this->isReadable();
}
}

File Metadata

Mime Type
text/x-diff
Expires
Mon, Sep 15, 05:09 (2 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2983729
Default Alt Text
(2 KB)

Event Timeline