Skip to content

Commit

Permalink
Improved autoloader
Browse files Browse the repository at this point in the history
  • Loading branch information
crodas committed Nov 24, 2015
1 parent 2228589 commit aa0f579
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
5 changes: 1 addition & 4 deletions lib/ActiveMongo2/Generate/Collections.php
Expand Up @@ -83,10 +83,7 @@ public function autoload()
{
$classes = array();
foreach ($this as $key => $value) {
$name = $value->GetName();
if ($name) {
$classes[strtolower($value->getClass())] = $value->getPath();
}
$classes[strtolower($value->getClass())] = $value->getPath();
}
return $classes;
}
Expand Down
8 changes: 0 additions & 8 deletions tests/docs/Post.php
Expand Up @@ -2,14 +2,6 @@

namespace ActiveMongo2\Tests\Document;

trait foobartrait
{
/** @postsave */
public function dosomethignelse() {
$GLOBALS['traited'] = true;
}
}

class Middle extends BaseDocument
{
/**
Expand Down
12 changes: 12 additions & 0 deletions tests/docs/trait.php
@@ -0,0 +1,12 @@
<?php

namespace ActiveMongo2\Tests\Document;

trait foobartrait
{
/** @postsave */
public function dosomethignelse() {
$GLOBALS['traited'] = true;
}
}

0 comments on commit aa0f579

Please sign in to comment.