public __construct(string $composerJsonPath = '')

Make a FileManager. Pass a composer JSON path to use Composer dependancies. This is the path to your composer.json and composer.lock files. If you don't pass anything, InstaDoc will not search and display classes loaded via Composer

public addGlobalNameSpaceClass(string $filename, bool $localGit = false) : void

The classes in the global namespace are handled slightly differently, as this should be the exception rather than the rule.

  • param string $filename Pass in the full file path
  • param bool $localGit the git flag is attached to the global namespace, not the individual file and will use the setting of the last file added.
public addNamespace(string $namespace, string $directory, bool $localGit = false) : PHPFUI\InstaDoc\FileManager

You can add a Namespace directly. Specify the namespace (no leading backslash) and the directory containing the class files. This is realitive to the current script directory.

You can also pass an option localGit flag indicating this directory is in the project git repo. This will allow you to see the git history on the file.

public delete(string $fileName = '') : int

Delete config files. This should be done when new classes have been added to the project.

  • return int number of files deleted
public excludeNamespace(string $namespace) : PHPFUI\InstaDoc\FileManager

Remove just one namespace from your docs.

public excludeNamespaces(array $namespaces) : PHPFUI\InstaDoc\FileManager

Sometimes you don't feel like a nut. Pass namespaces in an array to remove them from your documentation.

  • param string[] $namespaces
public getComposerPath() : string
public load(string $fileName = '') : bool

Load the namespace index.

  • return bool true if file exists, false if generated
public rescan() : PHPFUI\InstaDoc\FileManager

Rescan the namespaces for the latest changes.

public save(string $fileName = '') : bool

Save the current configuration

public setBaseFile(string $fileName) : self

Set base file name for saving index file

public setComposerPath(string $composerJsonPath) : PHPFUI\InstaDoc\FileManager
public setConfigName(string $dirOrFilename) : PHPFUI\InstaDoc\FileManager

The directory or directory/base file name to store settings.

If it is a directory, the file base name will be FileManager. Several file extentions may be used

public setExtension(string $extension = '.serial') : self

Set file extension for saving index file

private string $composerJsonPath = ''
private string $configFile = '..'
private array $excludedNamespaces = []
  • var string[]
private string $extension = '.serial'
private string $fileName = ''
private array $includedNamespaces = []
  • var string[][]
private getSerializedName(string $fileName = '', string $extension = '') : string
private loadVendorDirectories() : void

Read the composer files to get all namespaces for include libraries.

© 2024 Bruce Wells
Search Namespaces \ Classes