code-lts / doctum

A php API documentation generator, fork of Sami
https://doctum.long-term.support/
MIT License
300 stars 32 forks source link

BC issue when upgrading to 5.2.0 #16

Closed JamesFreeman closed 3 years ago

JamesFreeman commented 3 years ago

Hi,

PHP Version: 7.4.5 Doctum version: 5.2.0

I upgraded to 5.2.0 from 5.1.0 this morning. Since this update I'm getting the following error:

Notice: Undefined index: template_dirs in .../vendor/code-lts/doctum/src/Doctum.php line 424

Our build file is as follows:

require __DIR__.'/vendor/autoload.php';

use Doctum\Doctum;
use Symfony\Component\Finder\Finder;
use Doctum\Version\GitVersionCollection;
use Doctum\RemoteRepository\GitHubRemoteRepository;

$iterator = Finder::create()
        ->files()
        ->name('*.php')
        ->exclude('stubs')
        ->exclude('database')
        ->exclude('bootstrap')
        ->exclude('storage')
        ->in($dir = __DIR__.'/src');

$versions = GitVersionCollection::create($dir)
        ->add('master', 'Main Branch');

return new Doctum($iterator, array(
        'title' => 'API',
        'versions' => $versions,
        'build_dir' => __DIR__.'/build/%version%',
        'cache_dir' => __DIR__.'/cache/%version%',
        'default_opened_level' => 2,
        'remote_repository' => new GitHubRemoteRepository('RepoName', dirname($dir)),
));
njh commented 3 years ago

I am experiencing the same problem with easyrdf 😢

<?php

use Doctum\Doctum;
use Symfony\Component\Finder\Finder;

$root = realpath(__DIR__ . "/..");
$iterator = Finder::create()
    ->files()
    ->name('*.php')
    ->exclude('arc')
    ->in($root . '/lib')
;

return new Doctum($iterator, [
    'title'               => 'EasyRdf API Documentation',
    'build_dir'           => "$root/docs/api",
    'cache_dir'           => "$root/doctumcache",
    'include_parent_data' => true,
    'default_opened_level' => 1,
]);
williamdes commented 3 years ago

Thank you, sorry for that I will have a look soon

williamdes commented 3 years ago

I will release a version shortly, currently adding more unit tests

williamdes commented 3 years ago

5.2.1 is released :tada:

njh commented 3 years ago

Thank you for the speedy fix 😀