Trying to install a plugin developed for Mautic V4 in Mautic V3

I am trying to port McCsCustomObjectsBundle in Mautic version 3.

I am getting this below error, any pointers would be appreciated greatly

Fatal error: Cannot declare class MauticPlugin\McCsCustomObjectsBundle\CustomObjectsBundle, because the name is already in use in /var/www/html/plugins/McCsPluginCustomObjects/CustomObjectsBundle.php on line 21

Call Stack:
0.0213 406336 1. {main}() /var/www/html/bin/console:0
0.2942 3896872 2. Symfony\Component\Console\Application->run($input = class Symfony\Component\Console\Input\ArgvInput { private $tokens = [0 => ‘cache:clear’]; private $parsed = ; protected $definition = class Symfony\Component\Console\Input\InputDefinition { private $arguments = […]; private $requiredCount = 1; private $hasAnArrayArgument = FALSE; private $hasOptional = FALSE; private $options = […]; private $shortcuts = […] }; protected $stream = NULL; protected $options = ; protected $arguments = [‘command’ => ‘cache:clear’]; protected $interactive = TRUE }, $output = NULL) /var/www/html/bin/console:43
0.3977 4254760 3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun($input = class Symfony\Component\Console\Input\ArgvInput { private $tokens = [0 => ‘cache:clear’]; private $parsed = ; protected $definition = class Symfony\Component\Console\Input\InputDefinition { private $arguments = […]; private $requiredCount = 1; private $hasAnArrayArgument = FALSE; private $hasOptional = FALSE; private $options = […]; private $shortcuts = […] }; protected $stream = NULL; protected $options = ; protected $arguments = [‘command’ => ‘cache:clear’]; protected $interactive = TRUE }, $output = class Symfony\Component\Console\Output\ConsoleOutput { private $stderr = class Symfony\Component\Console\Output\StreamOutput { private $stream = resource(124) of type (stream); private ${Symfony\Component\Console\Output\Output}verbosity = 32; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { … } }; private ${Symfony\Component\Console\Output\StreamOutput}stream = resource(118) of type (stream); private ${Symfony\Component\Console\Output\Output}verbosity = 32; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { private $decorated = TRUE; private $styles = […]; private $styleStack = class Symfony\Component\Console\Formatter\OutputFormatterStyleStack { … } } }) /var/www/html/vendor/symfony/console/Application.php:148
3.1492 40269752 4. Symfony\Component\Console\Application->doRun($input = class Symfony\Component\Console\Input\ArgvInput { private $tokens = [0 => ‘cache:clear’]; private $parsed = ; protected $definition = class Symfony\Component\Console\Input\InputDefinition { private $arguments = […]; private $requiredCount = 1; private $hasAnArrayArgument = FALSE; private $hasOptional = FALSE; private $options = […]; private $shortcuts = […] }; protected $stream = NULL; protected $options = ; protected $arguments = [‘command’ => ‘cache:clear’]; protected $interactive = TRUE }, $output = class Symfony\Component\Console\Output\ConsoleOutput { private $stderr = class Symfony\Component\Console\Output\StreamOutput { private $stream = resource(124) of type (stream); private ${Symfony\Component\Console\Output\Output}verbosity = 32; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { … } }; private ${Symfony\Component\Console\Output\StreamOutput}stream = resource(118) of type (stream); private ${Symfony\Component\Console\Output\Output}verbosity = 32; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { private $decorated = TRUE; private $styles = […]; private $styleStack = class Symfony\Component\Console\Formatter\OutputFormatterStyleStack { … } } }) /var/www/html/vendor/symfony/framework-bundle/Console/Application.php:74
3.1592 40336992 5. Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand($command = class Symfony\Bundle\FrameworkBundle\Command\CacheClearCommand { private $cacheClearer = class Symfony\Component\HttpKernel\CacheClearer\ChainCacheClearer { protected $clearers = class Symfony\Component\DependencyInjection\Argument\RewindableGenerator { … } }; private $filesystem = class Symfony\Component\Filesystem\Filesystem { }; private $warning = NULL; private ${Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand}container = class ContainerX3taiqw\appProdProjectContainer { private $buildParameters = […]; private $containerDir = ‘/var/www/html/var/cache/prod/ContainerX3taiqw’; private $parameters = […]; private $targetDirs = […]; private $loadedDynamicParameters = […]; private $dynamicParameters = […]; private $normalizedParameterNames = […]; protected $parameterBag = NULL; protected $services = […]; protected $fileMap = […]; protected $methodMap = […]; protected $aliases = […]; protected $loading = […]; protected $resolving = […]; protected $syntheticIds = […]; protected $privates = […]; protected $normalizedIds = […]; private ${Symfony\Component\DependencyInjection\Container}underscoreMap = […]; private ${Symfony\Component\DependencyInjection\Container}envCache = […]; private ${Symfony\Component\DependencyInjection\Container}compiled = FALSE; private ${Symfony\Component\DependencyInjection\Container}getEnv = class Closure { virtual $closure = “$this->getEnv”, … } }; private ${Symfony\Component\Console\Command\Command}application = class Symfony\Bundle\FrameworkBundle\Console\Application { private $kernel = class AppKernel { … }; private $commandsRegistered = TRUE; private $registrationErrors = […]; private ${Symfony\Component\Console\Application}commands = […]; private ${Symfony\Component\Console\Application}wantHelps = FALSE; private ${Symfony\Component\Console\Application}runningCommand = …; private ${Symfony\Component\Console\Application}name = ‘Mautic’; private ${Symfony\Component\Console\Application}version = ‘3.3.3 - app/prod’; private ${Symfony\Component\Console\Application}commandLoader = class Symfony\Component\Console\CommandLoader\ContainerCommandLoader { … }; private ${Symfony\Component\Console\Application}catchExceptions = TRUE; private ${Symfony\Component\Console\Application}autoExit = TRUE; private ${Symfony\Component\Console\Application}definition = class Symfony\Component\Console\Input\InputDefinition { … }; private ${Symfony\Component\Console\Application}helperSet = class Symfony\Component\Console\Helper\HelperSet { … }; private ${Symfony\Component\Console\Application}dispatcher = class Symfony\Component\EventDispatcher\EventDispatcher { … }; private ${Symfony\Component\Console\Application}terminal = class Symfony\Component\Console\Terminal { … }; private ${Symfony\Component\Console\Application}defaultCommand = ‘list’; private ${Symfony\Component\Console\Application}singleCommand = FALSE; private ${Symfony\Component\Console\Application}initialized = TRUE }; private ${Symfony\Component\Console\Command\Command}name = ‘cache:clear’; private ${Symfony\Component\Console\Command\Command}processTitle = NULL; private ${Symfony\Component\Console\Command\Command}aliases = ; private ${Symfony\Component\Console\Command\Command}definition = class Symfony\Component\Console\Input\InputDefinition { private $arguments = […]; private $requiredCount = 1; private $hasAnArrayArgument = FALSE; private $hasOptional = FALSE; private $options = […]; private $shortcuts = […] }; private ${Symfony\Component\Console\Command\Command}hidden = FALSE; private ${Symfony\Component\Console\Command\Command}help = ‘The %command.name% command clears the application cache for a given environment\nand debug mode:\n\n php %command.full_name% --env=dev\n php %command.full_name% --env=prod --no-debug’; private ${Symfony\Component\Console\Command\Command}description = ‘Clears the cache’; private ${Symfony\Component\Console\Command\Command}ignoreValidationErrors = FALSE; private ${Symfony\Component\Console\Command\Command}applicationDefinitionMerged = TRUE; private ${Symfony\Component\Console\Command\Command}applicationDefinitionMergedWithArgs = TRUE; private ${Symfony\Component\Console\Command\Command}code = NULL; private ${Symfony\Component\Console\Command\Command}synopsis = [‘short’ => ‘cache:clear [options] [–] ’, ‘long’ => ‘cache:clear [–no-warmup] [–no-optional-warmers] [-h|–help] [-q|–quiet] [-v|vv|vvv|–verbose] [-V|–version] [–ansi] [–no-ansi] [-n|–no-interaction] [-e|–env ENV] [–no-debug] [–] ’]; private ${Symfony\Component\Console\Command\Command}usages = ; private ${Symfony\Component\Console\Command\Command}helperSet = class Symfony\Component\Console\Helper\HelperSet { private $helpers = […]; private $command = NULL } }, $input = class Symfony\Component\Console\Input\ArgvInput { private $tokens = [0 => ‘cache:clear’]; private $parsed = ; protected $definition = class Symfony\Component\Console\Input\InputDefinition { private $arguments = […]; private $requiredCount = 1; private $hasAnArrayArgument = FALSE; private $hasOptional = FALSE; private $options = […]; private $shortcuts = […] }; protected $stream = NULL; protected $options = ; protected $arguments = [‘command’ => ‘cache:clear’]; protected $interactive = TRUE }, $output = class Symfony\Component\Console\Output\ConsoleOutput { private $stderr = class Symfony\Component\Console\Output\StreamOutput { private $stream = resource(124) of type (stream); private ${Symfony\Component\Console\Output\Output}verbosity = 32; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { … } }; private ${Symfony\Component\Console\Output\StreamOutput}stream = resource(118) of type (stream); private ${Symfony\Component\Console\Output\Output}verbosity = 32; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { private $decorated = TRUE; private $styles = […]; private $styleStack = class Symfony\Component\Console\Formatter\OutputFormatterStyleStack { … } } }) /var/www/html/vendor/symfony/console/Application.php:255
3.1592 40336992 6. Symfony\Component\Console\Application->doRunCommand($command = class Symfony\Bundle\FrameworkBundle\Command\CacheClearCommand { private $cacheClearer = class Symfony\Component\HttpKernel\CacheClearer\ChainCacheClearer { protected $clearers = class Symfony\Component\DependencyInjection\Argument\RewindableGenerator { … } }; private $filesystem = class Symfony\Component\Filesystem\Filesystem { }; private $warning = NULL; private ${Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand}container = class ContainerX3taiqw\appProdProjectContainer { private $buildParameters = […]; private $containerDir = ‘/var/www/html/var/cache/prod/ContainerX3taiqw’; private $parameters = […]; private $targetDirs = […]; private $loadedDynamicParameters = […]; private $dynamicParameters = […]; private $normalizedParameterNames = […]; protected $parameterBag = NULL; protected $services = […]; protected $fileMap = […]; protected $methodMap = […]; protected $aliases = […]; protected $loading = […]; protected $resolving = […]; protected $syntheticIds = […]; protected $privates = […]; protected $normalizedIds = […]; private ${Symfony\Component\DependencyInjection\Container}underscoreMap = […]; private ${Symfony\Component\DependencyInjection\Container}envCache = […]; private ${Symfony\Component\DependencyInjection\Container}compiled = FALSE; private ${Symfony\Component\DependencyInjection\Container}getEnv = class Closure { virtual $closure = “$this->getEnv”, … } }; private ${Symfony\Component\Console\Command\Command}application = class Symfony\Bundle\FrameworkBundle\Console\Application { private $kernel = class AppKernel { … }; private $commandsRegistered = TRUE; private $registrationErrors = […]; private ${Symfony\Component\Console\Application}commands = […]; private ${Symfony\Component\Console\Application}wantHelps = FALSE; private ${Symfony\Component\Console\Application}runningCommand = …; private ${Symfony\Component\Console\Application}name = ‘Mautic’; private ${Symfony\Component\Console\Application}version = ‘3.3.3 - app/prod’; private ${Symfony\Component\Console\Application}commandLoader = class Symfony\Component\Console\CommandLoader\ContainerCommandLoader { … }; private ${Symfony\Component\Console\Application}catchExceptions = TRUE; private ${Symfony\Component\Console\Application}autoExit = TRUE; private ${Symfony\Component\Console\Application}definition = class Symfony\Component\Console\Input\InputDefinition { … }; private ${Symfony\Component\Console\Application}helperSet = class Symfony\Component\Console\Helper\HelperSet { … }; private ${Symfony\Component\Console\Application}dispatcher = class Symfony\Component\EventDispatcher\EventDispatcher { … }; private ${Symfony\Component\Console\Application}terminal = class Symfony\Component\Console\Terminal { … }; private ${Symfony\Component\Console\Application}defaultCommand = ‘list’; private ${Symfony\Component\Console\Application}singleCommand = FALSE; private ${Symfony\Component\Console\Application}initialized = TRUE }; private ${Symfony\Component\Console\Command\Command}name = ‘cache:clear’; private ${Symfony\Component\Console\Command\Command}processTitle = NULL; private ${Symfony\Component\Console\Command\Command}aliases = ; private ${Symfony\Component\Console\Command\Command}definition = class Symfony\Component\Console\Input\InputDefinition { private $arguments = […]; private $requiredCount = 1; private $hasAnArrayArgument = FALSE; private $hasOptional = FALSE; private $options = […]; private $shortcuts = […] }; private ${Symfony\Component\Console\Command\Command}hidden = FALSE; private ${Symfony\Component\Console\Command\Command}help = ‘The %command.name% command clears the application cache for a given environment\nand debug mode:\n\n php %command.full_name% --env=dev\n php %command.full_name% --env=prod --no-debug’; private ${Symfony\Component\Console\Command\Command}description = ‘Clears the cache’; private ${Symfony\Component\Console\Command\Command}ignoreValidationErrors = FALSE; private ${Symfony\Component\Console\Command\Command}applicationDefinitionMerged = TRUE; private ${Symfony\Component\Console\Command\Command}applicationDefinitionMergedWithArgs = TRUE; private ${Symfony\Component\Console\Command\Command}code = NULL; private ${Symfony\Component\Console\Command\Command}synopsis = [‘short’ => ‘cache:clear [options] [–] ’, ‘long’ => ‘cache:clear [–no-warmup] [–no-optional-warmers] [-h|–help] [-q|–quiet] [-v|vv|vvv|–verbose] [-V|–version] [–ansi] [–no-ansi] [-n|–no-interaction] [-e|–env ENV] [–no-debug] [–] ’]; private ${Symfony\Component\Console\Command\Command}usages = ; private ${Symfony\Component\Console\Command\Command}helperSet = class Symfony\Component\Console\Helper\HelperSet { private $helpers = […]; private $command = NULL } }, $input = class Symfony\Component\Console\Input\ArgvInput { private $tokens = [0 => ‘cache:clear’]; private $parsed = ; protected $definition = class Symfony\Component\Console\Input\InputDefinition { private $arguments = […]; private $requiredCount = 1; private $hasAnArrayArgument = FALSE; private $hasOptional = FALSE; private $options = […]; private $shortcuts = […] }; protected $stream = NULL; protected $options = ; protected $arguments = [‘command’ => ‘cache:clear’]; protected $interactive = TRUE }, $output = class Symfony\Component\Console\Output\ConsoleOutput { private $stderr = class Symfony\Component\Console\Output\StreamOutput { private $stream = resource(124) of type (stream); private ${Symfony\Component\Console\Output\Output}verbosity = 32; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { … } }; private ${Symfony\Component\Console\Output\StreamOutput}stream = resource(118) of type (stream); private ${Symfony\Component\Console\Output\Output}verbosity = 32; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { private $decorated = TRUE; private $styles = […]; private $styleStack = class Symfony\Component\Console\Formatter\OutputFormatterStyleStack { … } } }) /var/www/html/vendor/symfony/framework-bundle/Console/Application.php:86
3.1836 40431208 7. Symfony\Component\Console\Command\Command->run($input = class Symfony\Component\Console\Input\ArgvInput { private $tokens = [0 => ‘cache:clear’]; private $parsed = ; protected $definition = class Symfony\Component\Console\Input\InputDefinition { private $arguments = […]; private $requiredCount = 1; private $hasAnArrayArgument = FALSE; private $hasOptional = FALSE; private $options = […]; private $shortcuts = […] }; protected $stream = NULL; protected $options = ; protected $arguments = [‘command’ => ‘cache:clear’]; protected $interactive = TRUE }, $output = class Symfony\Component\Console\Output\ConsoleOutput { private $stderr = class Symfony\Component\Console\Output\StreamOutput { private $stream = resource(124) of type (stream); private ${Symfony\Component\Console\Output\Output}verbosity = 32; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { … } }; private ${Symfony\Component\Console\Output\StreamOutput}stream = resource(118) of type (stream); private ${Symfony\Component\Console\Output\Output}verbosity = 32; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { private $decorated = TRUE; private $styles = […]; private $styleStack = class Symfony\Component\Console\Formatter\OutputFormatterStyleStack { … } } }) /var/www/html/vendor/symfony/console/Application.php:1010
3.1846 40432224 8. Symfony\Bundle\FrameworkBundle\Command\CacheClearCommand->execute($input = class Symfony\Component\Console\Input\ArgvInput { private $tokens = [0 => ‘cache:clear’]; private $parsed = ; protected $definition = class Symfony\Component\Console\Input\InputDefinition { private $arguments = […]; private $requiredCount = 1; private $hasAnArrayArgument = FALSE; private $hasOptional = FALSE; private $options = […]; private $shortcuts = […] }; protected $stream = NULL; protected $options = ; protected $arguments = [‘command’ => ‘cache:clear’]; protected $interactive = TRUE }, $output = class Symfony\Component\Console\Output\ConsoleOutput { private $stderr = class Symfony\Component\Console\Output\StreamOutput { private $stream = resource(124) of type (stream); private ${Symfony\Component\Console\Output\Output}verbosity = 32; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { … } }; private ${Symfony\Component\Console\Output\StreamOutput}stream = resource(118) of type (stream); private ${Symfony\Component\Console\Output\Output}verbosity = 32; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { private $decorated = TRUE; private $styles = […]; private $styleStack = class Symfony\Component\Console\Formatter\OutputFormatterStyleStack { … } } }) /var/www/html/vendor/symfony/console/Command/Command.php:255
3.2432 40842984 9. Symfony\Bundle\FrameworkBundle\Command\CacheClearCommand->warmup($warmupDir = ‘/var/www/html/var/cache/pro_’, $realCacheDir = ‘/var/www/html/var/cache/prod’, $enableOptionalWarmers = TRUE) /var/www/html/vendor/symfony/framework-bundle/Command/CacheClearCommand.php:133
3.2432 40842984 10. Symfony\Component\HttpKernel\Kernel->reboot($warmupDir = ‘/var/www/html/var/cache/pro_’) /var/www/html/vendor/symfony/framework-bundle/Command/CacheClearCommand.php:199
3.2438 40842192 11. AppKernel->boot() /var/www/html/vendor/symfony/http-kernel/Kernel.php:152
3.2637 40859224 12. Symfony\Component\HttpKernel\Kernel->initializeBundles() /var/www/html/app/AppKernel.php:244
3.2637 40850976 13. AppKernel->registerBundles() /var/www/html/vendor/symfony/http-kernel/Kernel.php:493
3.3072 40901912 14. class_exists($classname = ‘\MauticPlugin\McCsPluginCustomObjects\CustomObjectsBundle’) /var/www/html/app/AppKernel.php:187
3.3072 40902144 15. spl_autoload_call($class_name = ‘MauticPlugin\McCsPluginCustomObjects\CustomObjectsBundle’) /var/www/html/app/AppKernel.php:187
3.3073 40902280 16. Composer\Autoload\ClassLoader->loadClass($class = ‘MauticPlugin\McCsPluginCustomObjects\CustomObjectsBundle’) /var/www/html/app/AppKernel.php:187
3.3074 40902408 17. Composer\Autoload\includeFile($file = ‘/var/www/html/vendor/composer/…/…/plugins/McCsPluginCustomObjects/CustomObjectsBundle.php’) /var/www/html/vendor/composer/ClassLoader.php:322
3.3083 40903224 18. include(‘/var/www/html/plugins/McCsPluginCustomObjects/CustomObjectsBundle.php’) /var/www/html/vendor/composer/ClassLoader.php:444

In CustomObjectsBundle.php line 21:

Compile Error: Cannot declare class MauticPlugin\McCsCustomObjectsBundle\CustomObjectsBundle, because the name is already in use

Custom Objects will not work in Mautic 3.

There were a huge number of PRs we had to merge to support this plugin which are in Mautic 4+.

Please update to Mautic 4 if you want to use it.