Page MenuHomeDevCentral

No OneTemporary

diff --git a/src/Reflection/CodeFile.php b/src/Reflection/CodeFile.php
index 0634bdb..56731e0 100644
--- a/src/Reflection/CodeFile.php
+++ b/src/Reflection/CodeFile.php
@@ -1,67 +1,25 @@
<?php
namespace Keruald\OmniTools\Reflection;
-class CodeFile {
-
- /**
- * @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);
- }
+class CodeFile extends File {
///
/// Include methods
///
public function tryInclude () : bool {
if (!$this->canBeIncluded()) {
return false;
}
- include($this->filename);
+ include($this->getFilename());
return true;
}
public function canBeIncluded () : bool {
return $this->exists() &&$this->isReadable();
}
}
diff --git a/src/Reflection/CodeFile.php b/src/Reflection/File.php
similarity index 98%
copy from src/Reflection/CodeFile.php
copy to src/Reflection/File.php
index 0634bdb..fc98027 100644
--- a/src/Reflection/CodeFile.php
+++ b/src/Reflection/File.php
@@ -1,67 +1,67 @@
<?php
namespace Keruald\OmniTools\Reflection;
-class CodeFile {
+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();
}
}

File Metadata

Mime Type
text/x-diff
Expires
Thu, Sep 18, 20:21 (3 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2986708
Default Alt Text
(2 KB)

Event Timeline