public function load($basePath)
    {
        $this->assertThatFactoriesDirectoryExists($basePath);

        $designer = new Designer;
        $faker = new FakerAdapter;

        $factory = function ($name, $shortName, $attributes = []) use ($designer, $faker) {
            return $designer->define($name, $shortName, $attributes);
        };

        foreach ((new FactoriesFinder($basePath))->find() as $file) {
            include($file);
        }

        return $designer->definitions();
    }
public function load($basePath)
    {
        $this->assertThatFactoriesDirectoryExists($basePath);

        $designer = new Designer;
        $faker = new FakerAdapter;

        $factory = function ($name, $shortName, $attributes = []) use ($designer, $faker) {
            return $designer->define($name, $shortName, $attributes);
        };

        foreach ((new FactoriesFinder($basePath))->find() as $file) {
            include($file);
        }

        return $designer->definitions();
    }
public function load ( $ basePath ) { $ this -> assertThatFactoriesDirectoryExists ( $ basePath ) ; $ designer = new Designer ; $ faker = new FakerAdapter ; $ factory = function ( $ name , $ shortName , $ attributes = [ ] ) use ( $ designer , $ faker ) { return $ designer -> define ( $ name , $ shortName , $ attributes ) ; } ; foreach ( ( new FactoriesFinder ( $ basePath ) ) -> find ( ) as $ file ) { include ( $ file ) ; } return $ designer -> definitions ( ) ; }
Load the factories.

@param  string $basePath
@return array
Load the factories .