Permalink
Browse files

More cleanup, remove outdated samples for old API, update autoload ma…

…p, update some first tests
  • Loading branch information...
1 parent 1d5c545 commit 69f3fccb70226150441afdc127903a8af6b40273 @theseer committed Aug 5, 2014
View
@@ -1,8 +1,8 @@
<?php
- require __DIR__ . '/../src/classfinder.php';
+ require __DIR__ . '/../src/autoload.php';
- $finder = new \TheSeer\Autoload\ClassFinder;
+ $parser = new \TheSeer\Autoload\Parser;
- $rc = $finder->parseFile(__DIR__ . '/../src/classfinder.php');
- var_dump($rc, $finder->getClasses());
+ $result = $parser->parse(new \TheSeer\Autoload\SourceFile(__DIR__ . '/../src/Parser.php'));
+ var_dump($result->getUnits(), $result->getDependenciesForUnit(strtolower(\TheSeer\Autoload\ParserException::class)));
View
@@ -1,12 +0,0 @@
-<?php
-
- require __DIR__ . '/../autoload.php';
- require 'TheSeer/DirectoryScanner/autoload.php';
-
- $scanner = new \TheSeer\DirectoryScanner\DirectoryScanner;
- $scanner->addInclude('*.php');
-
- $finder = new \TheSeer\Autoload\ClassFinder;
-
- $rc = $finder->parseMulti($scanner('../src'));
- var_dump($rc, $finder->getClasses());
View
@@ -1,15 +0,0 @@
-<?php
-
- require __DIR__ . '/../autoload.php';
- require 'TheSeer/DirectoryScanner/autoload.php';
-
- $scanner = new \TheSeer\DirectoryScanner\DirectoryScanner;
- $scanner->addInclude('*.php');
-
- $finder = new \TheSeer\Autoload\ClassFinder;
-
- $found = $finder->parseMulti($scanner('../src'));
-
- $ab = new \TheSeer\Autoload\AutoloadRenderer($finder->getClasses());
-
- echo $ab->render();
View
@@ -1,16 +0,0 @@
-<?php
-
- require __DIR__ . '/../autoload.php';
- require 'TheSeer/DirectoryScanner/autoload.php';
-
- $scanner = new \TheSeer\DirectoryScanner\DirectoryScanner;
- $scanner->addInclude('*.php');
-
- $finder = new \TheSeer\Autoload\ClassFinder;
-
- $found = $finder->parseMulti($scanner('../src'));
-
- $ab = new \TheSeer\Autoload\AutoloadRenderer($finder->getClasses());
- $ab->setIndent("\t");
- $ab->setLineBreak("\r\n");
- echo $ab->render();
View
@@ -1,16 +0,0 @@
-<?php
-
- require __DIR__ . '/../autoload.php';
- require 'TheSeer/DirectoryScanner/autoload.php';
-
- $scanner = new \TheSeer\DirectoryScanner\DirectoryScanner;
- $scanner->addInclude('*.php');
-
- $finder = new \TheSeer\Autoload\ClassFinder;
-
- $found = $finder->parseMulti($scanner('../src'));
-
- $ab = new \TheSeer\Autoload\AutoloadRenderer($finder->getClasses());
- $ab->setBaseDir(realpath(__DIR__.'/..'));
-
- echo $ab->render();
View
@@ -1,15 +0,0 @@
-<?php
-
-require '../src/classfinder.php';
-require '../src/dependencysorter.php';
-
-$finder = new \TheSeer\Autoload\ClassFinder(true);
-$finder->parseFile('../tests/_data/dependency/file2.php');
-$finder->parseFile('../tests/_data/dependency/file1.php');
-
-$found = $finder->getClasses();
-
-
-$x = new \TheSeer\Autoload\classDependencySorter($found, $finder->getDependencies());
-$r = $x->process();
-var_dump($found, $finder->getDependencies(), $r);
@@ -23,6 +23,7 @@ public function addParseResult(\SplFileInfo $file, ParseResult $result) {
CollectorResultException::DuplicateUnitName
);
}
+ $unit = addslashes($unit);
$this->units[$unit] = $filename;
$this->dependencies[$unit] = $result->getDependenciesForUnit($unit);
}
View
@@ -7,20 +7,25 @@ function($class) {
static $classes = null;
if ($classes === null) {
$classes = array(
- 'foo' => '/test/test.php',
'theseer\\autoload\\application' => '/Application.php',
'theseer\\autoload\\applicationexception' => '/Application.php',
'theseer\\autoload\\autoloadbuilderexception' => '/AutoloadRenderer.php',
'theseer\\autoload\\autoloadrenderer' => '/AutoloadRenderer.php',
'theseer\\autoload\\classdependencysorter' => '/DependencySorter.php',
'theseer\\autoload\\classdependencysorterexception' => '/DependencySorter.php',
- 'theseer\\autoload\\classfinder' => '/ClassFinder.php',
- 'theseer\\autoload\\classfinderexception' => '/ClassFinder.php',
'theseer\\autoload\\cli' => '/CLI.php',
+ 'theseer\\autoload\\collector' => '/Collector.php',
+ 'theseer\\autoload\\collectorexception' => '/Collector.php',
+ 'theseer\\autoload\\collectorresult' => '/CollectorResult.php',
+ 'theseer\\autoload\\collectorresultexception' => '/CollectorResult.php',
'theseer\\autoload\\config' => '/Config.php',
'theseer\\autoload\\factory' => '/Factory.php',
'theseer\\autoload\\logger' => '/Logger.php',
+ 'theseer\\autoload\\parser' => '/Parser.php',
+ 'theseer\\autoload\\parseresult' => '/ParseResult.php',
+ 'theseer\\autoload\\parserexception' => '/Parser.php',
'theseer\\autoload\\pharbuilder' => '/PharBuilder.php',
+ 'theseer\\autoload\\sourcefile' => '/SourceFile.php',
'theseer\\autoload\\staticrenderer' => '/StaticRenderer.php',
'theseer\\autoload\\version' => '/Version.php'
);
@@ -31,4 +36,4 @@ function($class) {
}
}
);
-// @codeCoverageIgnoreEnd
+// @codeCoverageIgnoreEnd
@@ -37,7 +37,7 @@
namespace TheSeer\Autoload\Tests {
- use TheSeer\Autoload\ClassFinder;
+ use TheSeer\Autoload\Parser;
use TheSeer\Autoload\AutoloadRenderer;
/**
@@ -37,7 +37,7 @@
namespace TheSeer\Autoload\Tests {
- use TheSeer\Autoload\ClassFinder;
+ use TheSeer\Autoload\Parser;
use TheSeer\Autoload\AutoloadRenderer;
use TheSeer\Autoload\ClassDependencySorter;

0 comments on commit 69f3fcc

Please sign in to comment.