BackofficeBundle/Command/OrchestraDeleteSiteCommand.php
Method execute
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$io = new SymfonyStyle($input, $output);
$siteRepository = $this->getContainer()->get('open_orchestra_model.repository.site');
- Create a ticketCreate a ticket
Missing class import via use statement (line '102', column '23'). Open
Open
throw new \RuntimeException('You should remove usage of contents before remove site '.$siteId);
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '93', column '23'). Open
Open
throw new \RuntimeException('You should remove usage of nodes before remove site '.$siteId);
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Parameter $output
has undeclared type \Symfony\Component\Console\Output\OutputInterface
Open
Open
protected function execute(InputInterface $input, OutputInterface $output)
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\BackofficeBundle\Command\OrchestraDeleteSiteCommand::getContainer
Open
Open
$contentRepository = $this->getContainer()->get('open_orchestra_model.repository.content');
- Create a ticketCreate a ticket
- Exclude checks
Call to method error
from undeclared class \Symfony\Component\Console\Style\SymfonyStyle
Open
Open
$io->error('Site '.$siteId.' not found');
- Create a ticketCreate a ticket
- Exclude checks
Call to method comment
from undeclared class \Symfony\Component\Console\Style\SymfonyStyle
Open
Open
$io->comment('Remove use references of nodes');
- Create a ticketCreate a ticket
- Exclude checks
Call to method comment
from undeclared class \Symfony\Component\Console\Style\SymfonyStyle
Open
Open
$io->comment('Check usage in other sites');
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\BackofficeBundle\Command\OrchestraDeleteSiteCommand::getContainer
Open
Open
$nodeClass = $this->getContainer()->getParameter('open_orchestra_model.document.node.class');
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\BackofficeBundle\Command\OrchestraDeleteSiteCommand::getContainer
Open
Open
$deleteSiteTools = $this->getContainer()->get('open_orchestra_backoffice.command.orchestra_delete_site_tools');
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\BackofficeBundle\Command\OrchestraDeleteSiteCommand::getContainer
Open
Open
$nodeRepository = $this->getContainer()->get('open_orchestra_model.repository.node');
- Create a ticketCreate a ticket
- Exclude checks
Parameter $io
has undeclared type \Symfony\Component\Console\Style\SymfonyStyle
Open
Open
protected function deleteEntities($siteId, $io)
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\BackofficeBundle\Command\OrchestraDeleteSiteCommand::getContainer
Open
Open
$contentRepository = $this->getContainer()->get('open_orchestra_model.repository.content');
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\BackofficeBundle\Command\OrchestraDeleteSiteCommand::getContainer
Open
Open
$siteRepository = $this->getContainer()->get('open_orchestra_model.repository.site');
- Create a ticketCreate a ticket
- Exclude checks
Call to method section
from undeclared class \Symfony\Component\Console\Style\SymfonyStyle
Open
Open
$io->section('Usage of contents in other sites');
- Create a ticketCreate a ticket
- Exclude checks
Call to method comment
from undeclared class \Symfony\Component\Console\Style\SymfonyStyle
Open
Open
$io->comment('Remove use references of blocks');
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\BackofficeBundle\Command\OrchestraDeleteSiteCommand::getContainer
Open
Open
$nodeRepository = $this->getContainer()->get('open_orchestra_model.repository.node');
- Create a ticketCreate a ticket
- Exclude checks
Call to method comment
from undeclared class \Symfony\Component\Console\Style\SymfonyStyle
Open
Open
$io->comment('Remove use references of contents');
- Create a ticketCreate a ticket
- Exclude checks
Call to method isDeleted
from undeclared class \OpenOrchestra\ModelInterface\Model\SiteInterface
Open
Open
if (false === $site->isDeleted()) {
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\BackofficeBundle\Command\OrchestraDeleteSiteCommand::getContainer
Open
Open
$deleteSiteTools = $this->getContainer()->get('open_orchestra_backoffice.command.orchestra_delete_site_tools');
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\BackofficeBundle\Command\OrchestraDeleteSiteCommand::getContainer
Open
Open
$routeDocumentRepository = $this->getContainer()->get('open_orchestra_model.repository.route_document');
- Create a ticketCreate a ticket
- Exclude checks
Call to method comment
from undeclared class \Symfony\Component\Console\Style\SymfonyStyle
Open
Open
$io->comment('Remove blocks');
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\BackofficeBundle\Command\OrchestraDeleteSiteCommand::getContainer
Open
Open
$blockRepository = $this->getContainer()->get('open_orchestra_model.repository.block');
- Create a ticketCreate a ticket
- Exclude checks
Class extends undeclared class \Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand
Open
Open
class OrchestraDeleteSiteCommand extends ContainerAwareCommand
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\BackofficeBundle\Command\OrchestraDeleteSiteCommand::getContainer
Open
Open
$objectManager = $this->getContainer()->get('object_manager');
- Create a ticketCreate a ticket
- Exclude checks
Call to method comment
from undeclared class \Symfony\Component\Console\Style\SymfonyStyle
Open
Open
$io->comment('Remove nodes');
- Create a ticketCreate a ticket
- Exclude checks
Call to method section
from undeclared class \Symfony\Component\Console\Style\SymfonyStyle
Open
Open
$io->section('Usage of nodes in other sites');
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant REQUIRED
from undeclared class \Symfony\Component\Console\Input\InputArgument
Open
Open
->addArgument('siteId', InputArgument::REQUIRED);
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\BackofficeBundle\Command\OrchestraDeleteSiteCommand::getContainer
Open
Open
$dispatcher = $this->getContainer()->get('event_dispatcher');
- Create a ticketCreate a ticket
- Exclude checks
Call to method comment
from undeclared class \Symfony\Component\Console\Style\SymfonyStyle
Open
Open
$io->comment('Remove route document');
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\BackofficeBundle\Command\OrchestraDeleteSiteCommand::getContainer
Open
Open
$contentClass = $this->getContainer()->getParameter('open_orchestra_model.document.content.class');
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\BackofficeBundle\Command\OrchestraDeleteSiteCommand::setName
Open
Open
$this
- Create a ticketCreate a ticket
- Exclude checks
Call to method comment
from undeclared class \Symfony\Component\Console\Style\SymfonyStyle
Open
Open
$io->comment('Check site');
- Create a ticketCreate a ticket
- Exclude checks
Checking instanceof against undeclared class \OpenOrchestra\ModelInterface\Model\SiteInterface
Open
Open
if (!$site instanceof SiteInterface) {
- Create a ticketCreate a ticket
- Exclude checks
Call to method error
from undeclared class \Symfony\Component\Console\Style\SymfonyStyle
Open
Open
$io->error('Site '.$siteId.' should be soft deleted');
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\BackofficeBundle\Command\OrchestraDeleteSiteCommand::getContainer
Open
Open
$blockClass = $this->getContainer()->getParameter('open_orchestra_model.document.block.class');
- Create a ticketCreate a ticket
- Exclude checks
Call to method comment
from undeclared class \Symfony\Component\Console\Style\SymfonyStyle
Open
Open
$io->comment('Remove site');
- Create a ticketCreate a ticket
- Exclude checks
Parameter $input
has undeclared type \Symfony\Component\Console\Input\InputInterface
Open
Open
protected function execute(InputInterface $input, OutputInterface $output)
- Create a ticketCreate a ticket
- Exclude checks
Call to method __construct
from undeclared class \Symfony\Component\Console\Style\SymfonyStyle
Open
Open
$io = new SymfonyStyle($input, $output);
- Create a ticketCreate a ticket
- Exclude checks
Call to method comment
from undeclared class \Symfony\Component\Console\Style\SymfonyStyle
Open
Open
$io->comment('Remove contents');
- Create a ticketCreate a ticket
- Exclude checks
Call to method getArgument
from undeclared class \Symfony\Component\Console\Input\InputInterface
Open
Open
$siteId = $input->getArgument('siteId');
- Create a ticketCreate a ticket
- Exclude checks
Parameter $io
has undeclared type \Symfony\Component\Console\Style\SymfonyStyle
Open
Open
protected function checkUsage($siteId, SymfonyStyle $io)
- Create a ticketCreate a ticket
- Exclude checks
Avoid excessively long variable names like $routeDocumentRepository. Keep variable name length under 20. Open
Open
$routeDocumentRepository = $this->getContainer()->get('open_orchestra_model.repository.route_document');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid variables with short names like $io. Configured minimum length is 3. Open
Open
protected function deleteEntities($siteId, $io)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $io. Configured minimum length is 3. Open
Open
protected function checkUsage($siteId, SymfonyStyle $io)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $io. Configured minimum length is 3. Open
Open
$io = new SymfonyStyle($input, $output);
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Line exceeds 120 characters; contains 122 characters Open
Open
$routeDocumentRepository->createQueryBuilder()->field('siteId')->equals($siteId)->remove()->getQuery()->execute();
- Create a ticketCreate a ticket
- Exclude checks