Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"description": "Command line toolkit to make managing a MODX site in git a lot easier",
"license": "MIT",
"require": {
"php": ">=7.2.5",
"symfony/console": "5.4.*",
"symfony/yaml": "5.4.*",
"symfony/process": "5.3.*"
"php": ">=8.2",
"symfony/console": "7.4.*",
"symfony/yaml": "7.4.*",
"symfony/process": "7.4.*"
},
"autoload": {
"psr-4": {
Expand Down
476 changes: 177 additions & 299 deletions composer.lock

Large diffs are not rendered by default.

18 changes: 10 additions & 8 deletions src/BaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,16 @@ public function initialize(InputInterface $input, OutputInterface $output)

// If we're on MODX 3, set up some class aliases.
if ($this->isMODX3) {
class_alias(modTransportProvider::class, 'modTransportProvider');
class_alias(modTransportPackage::class, 'modTransportPackage');
class_alias(modContext::class, 'modContext');
class_alias(modElement::class, 'modElement');
class_alias(modStaticResource::class, 'modStaticResource');
class_alias(modDashboardWidget::class, 'modDashboardWidget');
class_alias(modTemplateVar::class, 'modTemplateVar');
class_alias(modCategory::class, 'modCategory');
if (!class_exists('modTransportProvider', false)) {
class_alias(modTransportProvider::class, 'modTransportProvider');
class_alias(modTransportPackage::class, 'modTransportPackage');
class_alias(modContext::class, 'modContext');
class_alias(modElement::class, 'modElement');
class_alias(modStaticResource::class, 'modStaticResource');
class_alias(modDashboardWidget::class, 'modDashboardWidget');
class_alias(modTemplateVar::class, 'modTemplateVar');
class_alias(modCategory::class, 'modCategory');
}

// Avoid warnings in xPDO 3.x if $_SESSION isn't available.
if (!isset($_SESSION)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Command/BackupCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ protected function configure()
* @param OutputInterface $output
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
/**
* @var $database_type
Expand Down
10 changes: 9 additions & 1 deletion src/Command/BuildCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,18 @@ protected function configure()
* @param OutputInterface $output
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->isForce = $input->getOption('force');
if ($this->isForce && !$input->getOption('no-backup')) {
// Ensure Gitify's ArrayInput class is loaded first to avoid autoloader conflicts
if (!class_exists('Symfony\Component\Console\Input\ArrayInput', false)) {
$arrayInputPath = __DIR__ . '/../../vendor/symfony/console/Input/ArrayInput.php';
if (file_exists($arrayInputPath)) {
require_once $arrayInputPath;
}
}

$backup = $this->getApplication()->find('backup');
$arguments = array(
'command' => 'backup'
Expand Down
2 changes: 1 addition & 1 deletion src/Command/ClearCacheCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ protected function configure()
->setDescription('Clears the internal Gitify cache.');
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
if (file_exists(GITIFY_CACHE_DIR)) {
exec("rm -rf " . GITIFY_CACHE_DIR);
Expand Down
2 changes: 1 addition & 1 deletion src/Command/DownloadModxCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ protected function configure()
* @param OutputInterface $output
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$version = $this->input->getArgument('version');
$forced = $this->input->getOption('download');
Expand Down
2 changes: 1 addition & 1 deletion src/Command/ExtractCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ protected function configure()
* @param OutputInterface $output
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
// load modResource dependency
$this->modx->loadClass('modResource');
Expand Down
2 changes: 1 addition & 1 deletion src/Command/InitCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected function configure()
* @param OutputInterface $output
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
// Make sure we're not overwriting existing configuration by checking for existing .gitify files
if (file_exists(GITIFY_WORKING_DIR . '.gitify'))
Expand Down
2 changes: 1 addition & 1 deletion src/Command/InstallPackageCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ protected function configure()
* @param OutputInterface $output
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->modx->setLogTarget('ECHO');
$this->modx->setLogLevel(\modX::LOG_LEVEL_INFO);
Expand Down
2 changes: 1 addition & 1 deletion src/Command/RestoreCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protected function configure()
* @param OutputInterface $output
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
/**
* @var $database_type
Expand Down
2 changes: 1 addition & 1 deletion src/Command/UpgradeModxCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected function configure()
);
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$version = $this->input->getArgument('version');
$forced = $this->input->getOption('download');
Expand Down
2 changes: 1 addition & 1 deletion src/Gitify.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public function getEnvironment ()
*
* @return InputDefinition An InputDefinition instance
*/
protected function getDefaultInputDefinition()
protected function getDefaultInputDefinition(): InputDefinition
{
return new InputDefinition(array(
new InputArgument('command', InputArgument::REQUIRED, 'The command to execute'),
Expand Down