luyadev/luya

View on GitHub
core/console/interfaces/ImportControllerInterface.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%
<?php

namespace luya\console\interfaces;

/**
 * Command ImportController Interface.
 *
 * @author Basil Suter <basil@nadar.io>
 * @since 1.0.0
 */
interface ImportControllerInterface
{
    /**
     * Get all files from a directory.
     *
     * The directory must be in _scanFolders map of the {{luya\console\commands\ImporterController}}. An array will be returned with the keys:
     *
     * + file: The name of the file inside the provided folder (e.g. MyBlock.php)
     * + module: The name of the module where the file belongs to.
     * + ns: The namespace for the file including the filename itself.
     *
     * Usage example:
     *
     * ```php
     * $this->getDirectoryFiles('blocks');
     * ```
     *
     * If there are no files found getDirectoryFiles will return an empty array.
     *
     * @param string $folderName The folder name to find all files from.
     * @return array If no files found for the given folder an empty array will be returned, otherwise a list of all files inside the given folder.
     */
    public function getDirectoryFiles($folderName);

    /**
     * Add something to the log output.
     *
     * ```php
     * $this->addLog(get_called_class(), 'new block <ID> have been found and added to database');
     * ```
     *
     * @param string $section The section of where the log is executed.
     * @param string $value The message to log.
     */
    public function addLog($section, $value);
}