mirror of
https://github.com/danog/psalm.git
synced 2024-12-15 19:07:00 +01:00
448534fd7c
* Move psalm entry-point to a Cli command class * Moved psalter to the CLI command class * Moved psalm-language-server to the CLI command class * Moved psalm-refactor to the CLI command class * Moved psalm_plugin to the CLI command class * Use CLI commands directly and deprecate trampolines * Require CLI commands directly and don't use trampolines * Announce isAbsolutePath() removal * Deprecate \Psalm\requireAutoloaders() function * Deprecate \Psalm\getVendorDir() function * Deprecate Psalm\getArguments() function * Deprecate \Psalm\getPathsToCheck() function * Deprecate \Psalm\getPsalmHelpText() function * Deprecate \Psalm\initialiseConfig() function * Deprecate Psalm\update_config_file() function * Deprecate \Psalm\get_path_to_config() function * Deprecate Psalm\getMemoryLimitInBytes() function * CS fix * Untangle Psalm entrypoint * Untangle Psalter entrypoint * Drop command_functions.php references * Adjust phar build
89 lines
2.0 KiB
PHP
89 lines
2.0 KiB
PHP
<?php
|
|
|
|
namespace Psalm;
|
|
|
|
use Composer\Autoload\ClassLoader;
|
|
use Psalm\Internal\CliUtils;
|
|
|
|
// phpcs:disable PSR1.Files.SideEffects
|
|
require_once __DIR__ . '/Psalm/Internal/CliUtils.php';
|
|
|
|
/** @deprecated going to be removed in Psalm 5 */
|
|
function requireAutoloaders(string $current_dir, bool $has_explicit_root, string $vendor_dir): ?ClassLoader
|
|
{
|
|
return CliUtils::requireAutoloaders($current_dir, $has_explicit_root, $vendor_dir);
|
|
}
|
|
|
|
/** @deprecated going to be removed in Psalm 5 */
|
|
function getVendorDir(string $current_dir): string
|
|
{
|
|
return CliUtils::getVendorDir($current_dir);
|
|
}
|
|
|
|
/**
|
|
* @return list<string>
|
|
* @deprecated going to be removed in Psalm 5
|
|
*/
|
|
function getArguments() : array
|
|
{
|
|
return CliUtils::getArguments();
|
|
}
|
|
|
|
/**
|
|
* @param string|array|null|false $f_paths
|
|
*
|
|
* @return list<string>|null
|
|
* @deprecated going to be removed in Psalm 5
|
|
*/
|
|
function getPathsToCheck($f_paths): ?array
|
|
{
|
|
return CliUtils::getPathsToCheck($f_paths);
|
|
}
|
|
|
|
/**
|
|
* @psalm-pure
|
|
* @deprecated going to be removed in Psalm 5
|
|
*/
|
|
function getPsalmHelpText(): string
|
|
{
|
|
return CliUtils::getPsalmHelpText();
|
|
}
|
|
|
|
/** @deprecated going to be removed in Psalm 5 */
|
|
function initialiseConfig(
|
|
?string $path_to_config,
|
|
string $current_dir,
|
|
string $output_format,
|
|
?ClassLoader $first_autoloader,
|
|
bool $create_if_non_existent = false
|
|
): Config {
|
|
return CliUtils::initializeConfig(
|
|
$path_to_config,
|
|
$current_dir,
|
|
$output_format,
|
|
$first_autoloader,
|
|
$create_if_non_existent
|
|
);
|
|
}
|
|
|
|
/** @deprecated going to be removed in Psalm 5 */
|
|
function update_config_file(Config $config, string $config_file_path, string $baseline_path) : void
|
|
{
|
|
CliUtils::updateConfigFile($config, $config_file_path, $baseline_path);
|
|
}
|
|
|
|
/** @deprecated going to be removed in Psalm 5 */
|
|
function get_path_to_config(array $options): ?string
|
|
{
|
|
return CliUtils::getPathToConfig($options);
|
|
}
|
|
|
|
/**
|
|
* @psalm-pure
|
|
* @deprecated going to be removed in Psalm 5
|
|
*/
|
|
function getMemoryLimitInBytes(): int
|
|
{
|
|
return CliUtils::getMemoryLimitInBytes();
|
|
}
|