Skip to content

Commit

Permalink
add cloak plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
holyshared committed Jan 4, 2015
1 parent 38aaf79 commit 9b30415
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"peridot-php/peridot": "~1.8",
"beberlei/assert": "~2.3",
"phpspec/prophecy": "~1.3",
"cloak/cloak": "~1.4",
"cloak/peridot-cloak": "~1.0",
"cloak/robo-coveralls-kit": "~1.0",
"robo-peridot/robo-peridot": "~1.0",
"halleck45/php-metrics": "~1.1",
Expand Down
17 changes: 2 additions & 15 deletions peridot.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<?php

use Evenement\EventEmitterInterface;
use cloak\Analyzer;
use cloak\configuration\ConfigurationLoader;
use Doctrine\Common\Annotations\AnnotationRegistry;
use cloak\peridot\CloakPlugin;

AnnotationRegistry::registerLoader(function($class) {
$matchStrings = [ "expectation\\", '\\' ];
Expand All @@ -20,17 +19,5 @@
});

return function(EventEmitterInterface $emitter) {

$configLoader = new ConfigurationLoader();
$config = $configLoader->loadConfiguration('cloak.toml');
$analyzer = new Analyzer($config);

$emitter->on('peridot.start', function() use ($analyzer) {
$analyzer->start();
});

$emitter->on('peridot.end', function() use ($analyzer) {
$analyzer->stop();
});

CloakPlugin::create('cloak.toml')->registerTo($emitter);
};

0 comments on commit 9b30415

Please sign in to comment.