aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Enderlin <ivan.enderlin@hoa-project.net>2015-12-09 17:18:59 +0100
committerIvan Enderlin <ivan.enderlin@hoa-project.net>2015-12-11 08:59:02 +0100
commit96268fc58438e33be80f594479e8c8724c4d3a6a (patch)
tree941068509de70759887862b2191c49631658d610
parent3c92894fb24a3689143ef00a48f4f3934f27d48a (diff)
downloadPraspel-96268fc58438e33be80f594479e8c8724c4d3a6a.zip
Praspel-96268fc58438e33be80f594479e8c8724c4d3a6a.tar.gz
Praspel-96268fc58438e33be80f594479e8c8724c4d3a6a.tar.bz2
Consistency: Remove `from` calls.
-rw-r--r--Bin/Shell.php17
-rw-r--r--Model/Specification.php9
-rw-r--r--Model/Variable/Implicit.php10
-rw-r--r--Visitor/Interpreter.php10
4 files changed, 22 insertions, 24 deletions
diff --git a/Bin/Shell.php b/Bin/Shell.php
index c3ee788..7706f3d 100644
--- a/Bin/Shell.php
+++ b/Bin/Shell.php
@@ -93,18 +93,21 @@ class Shell extends Console\Dispatcher\Kit
$interpreter = new Praspel\Visitor\Interpreter();
$dump = new Praspel\Visitor\Compiler();
$interpreter->visit($compiler->parse('@requires;'));
- $words = [];
- from('Hoathis or Hoa')
- -> foreachImport('Realdom.*', function ($classname) use (&$words) {
- $class = new \ReflectionClass($classname);
+ $iterator = new \RegexIterator(
+ new \DirectoryIterator('hoa://Library/Realdom'),
+ '/\.php$/'
+ );
+ $words = [];
+
+ foreach ($iterator as $file) {
+ $classname = 'Hoa\Realdom\\' . substr($file->getFilename(), 0, -4);
+ $class = new \ReflectionClass($classname);
if ($class->isSubclassOf('\Hoa\Realdom')) {
$words[] = $classname::NAME;
}
-
- return;
- });
+ }
$readline = new Console\Readline();
$readline->setAutocompleter(
diff --git a/Model/Specification.php b/Model/Specification.php
index a352c8a..11334cd 100644
--- a/Model/Specification.php
+++ b/Model/Specification.php
@@ -36,12 +36,11 @@
namespace Hoa\Praspel\Model;
-from('Hoa')
+use Hoa\Consistency;
-/**
- * \Hoa\Realdom\Disjunction
- */
--> import('Realdom.Disjunction', true);
+if (false === Consistency::entityExists('Hoa\Realdom\Disjunction')) {
+ Consistency\Autoloader::load('Hoa\Realdom\Disjunction');
+}
/**
* Class \Hoa\Praspel\Model\Specification.
diff --git a/Model/Variable/Implicit.php b/Model/Variable/Implicit.php
index 3877480..5da50c8 100644
--- a/Model/Variable/Implicit.php
+++ b/Model/Variable/Implicit.php
@@ -36,15 +36,13 @@
namespace Hoa\Praspel\Model\Variable;
+use Hoa\Consistency;
use Hoa\Praspel;
use Hoa\Realdom;
-from('Hoa')
-
-/**
- * \Hoa\Realdom\Disjunction
- */
--> import('Realdom.Disjunction', true);
+if (false === Consistency::entityExists('Hoa\Realdom\Disjunction')) {
+ Consistency\Autoloader::load('Hoa\Realdom\Disjunction');
+}
/**
* Class \Hoa\Praspel\Model\Variable\Implicit.
diff --git a/Visitor/Interpreter.php b/Visitor/Interpreter.php
index bc3940f..407ffc7 100644
--- a/Visitor/Interpreter.php
+++ b/Visitor/Interpreter.php
@@ -36,17 +36,15 @@
namespace Hoa\Praspel\Visitor;
+use Hoa\Consistency;
use Hoa\Praspel;
use Hoa\Realdom;
use Hoa\Ustring;
use Hoa\Visitor;
-from('Hoa')
-
-/**
- * \Hoa\Realdom\Disjunction
- */
--> import('Realdom.Disjunction', true);
+if (false === Consistency::entityExists('Hoa\Realdom\Disjunction')) {
+ Consistency\Autoloader::load('Hoa\Realdom\Disjunction');
+}
/**
* Class \Hoa\Praspel\Visitor\Interpreter.