Method postInstall
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function postInstall(\Composer\Script\Event $event)
{
if (!$this->bootstrap) {
$this->lockSanitizer->sanitize();
Missing class import via use statement (line '103', column '29'). Open
$runtimeUtils = new \Vaimo\ComposerPatches\Utils\RuntimeUtils();
- Read upRead up
- 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 '50', column '31'). Open
$contextFactory = new \Vaimo\ComposerPatches\Factories\ComposerContextFactory($composer);
- Read upRead up
- 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 '53', column '30'). Open
$configFactory = new \Vaimo\ComposerPatches\Factories\ConfigFactory($composerContext);
- Read upRead up
- 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 '55', column '40'). Open
$this->operationAnalyser = new \Vaimo\ComposerPatches\Package\OperationAnalyser();
- Read upRead up
- 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 '58', column '40'). Open
$this->bootstrapStrategy = new \Vaimo\ComposerPatches\Strategies\BootstrapStrategy($composerContext);
- Read upRead up
- 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 '104', column '29'). Open
$compExecutor = new \Vaimo\ComposerPatches\Compatibility\Executor();
- Read upRead up
- 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 '57', column '36'). Open
$this->lockSanitizer = new \Vaimo\ComposerPatches\Repository\Lock\Sanitizer($appIO);
- Read upRead up
- 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 '56', column '39'). Open
$this->bootstrapFactory = new \Vaimo\ComposerPatches\Factories\BootstrapFactory($composerContext, $appIO);
- Read upRead up
- 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 '62', column '32'). Open
$pluginBootstrap = new \Vaimo\ComposerPatches\Composer\Plugin\Bootstrap($composer, $composerContext);
- Read upRead up
- 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
Rename "$bootstrap" which has the same name as the field declared at line 36. Open
$bootstrap = $this->bootstrap;
- Read upRead up
- Exclude checks
Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.
Noncompliant Code Example
class Foo { public $myField; public function doSomething() { $myField = 0; ... } }
See
- CERT, DCL51-J. - Do not shadow or obscure identifiers in subscopes
Rename "$lockSanitizer" which has the same name as the field declared at line 41. Open
$lockSanitizer = $this->lockSanitizer;
- Read upRead up
- Exclude checks
Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.
Noncompliant Code Example
class Foo { public $myField; public function doSomething() { $myField = 0; ... } }
See
- CERT, DCL51-J. - Do not shadow or obscure identifiers in subscopes
Class implements undeclared interface \Composer\EventDispatcher\EventSubscriberInterface
Open
class Plugin implements
- Exclude checks
Call to method isDevMode
from undeclared class \Composer\Script\Event
(Did you mean class \Vaimo\ComposerPatches\Patch\Event) Open
return $bootstrap->applyPatches($event->isDevMode());
- Exclude checks
Parameter $appIO
has undeclared type \Composer\IO\IOInterface
Open
public function deactivate(\Composer\Composer $composer, \Composer\IO\IOInterface $appIO)
- Exclude checks
Call to method __construct
from undeclared class \Composer\EventDispatcher\ScriptExecutionException
Open
throw new ScriptExecutionException('Execution halted due to composer-patch failure', 1);
- Exclude checks
Reference to constant PRE_AUTOLOAD_DUMP
from undeclared class \Composer\Script\ScriptEvents
Open
\Composer\Script\ScriptEvents::PRE_AUTOLOAD_DUMP => 'postInstall',
- Exclude checks
Class implements undeclared interface \Composer\Plugin\Capable
Open
class Plugin implements
- Exclude checks
Call to method isDevMode
from undeclared class \Composer\Script\Event
(Did you mean class \Vaimo\ComposerPatches\Patch\Event) Open
$compExecutor->repositoryWrite($repository, $installationManager, $event->isDevMode());
- Exclude checks
Parameter $composer
has undeclared type \Composer\Composer
Open
public function deactivate(\Composer\Composer $composer, \Composer\IO\IOInterface $appIO)
- Exclude checks
Class implements undeclared interface \Composer\Plugin\PluginInterface
Open
class Plugin implements
- Exclude checks
Parameter $appIO
has undeclared type \Composer\IO\IOInterface
Open
public function uninstall(\Composer\Composer $composer, \Composer\IO\IOInterface $appIO)
- Exclude checks
Parameter $composer
has undeclared type \Composer\Composer
Open
public function uninstall(\Composer\Composer $composer, \Composer\IO\IOInterface $appIO)
- Exclude checks
Reference to constant PRE_PACKAGE_UNINSTALL
from undeclared class \Composer\Installer\PackageEvents
Open
\Composer\Installer\PackageEvents::PRE_PACKAGE_UNINSTALL => 'resetPackages'
- Exclude checks
Parameter $event
has undeclared type \Composer\Script\Event
(Did you mean class \Vaimo\ComposerPatches\Patch\Event) Open
public function postInstall(\Composer\Script\Event $event)
- Exclude checks
Parameter $composer
has undeclared type \Composer\Composer
Open
public function activate(\Composer\Composer $composer, \Composer\IO\IOInterface $appIO)
- Exclude checks
Call to method getComposer
from undeclared class \Composer\Script\Event
(Did you mean class \Vaimo\ComposerPatches\Patch\Event) Open
$installationManager = $event->getComposer()->getInstallationManager();
- Exclude checks
Parameter $event
has undeclared type \Composer\Installer\PackageEvent
Open
public function resetPackages(\Composer\Installer\PackageEvent $event)
- Exclude checks
Parameter $appIO
has undeclared type \Composer\IO\IOInterface
Open
public function activate(\Composer\Composer $composer, \Composer\IO\IOInterface $appIO)
- Exclude checks
Call to method getComposer
from undeclared class \Composer\Script\Event
(Did you mean class \Vaimo\ComposerPatches\Patch\Event) Open
$repository = $event->getComposer()->getRepositoryManager()->getLocalRepository();
- Exclude checks
Assigning null
to property but \Vaimo\ComposerPatches\Plugin->bootstrap
is \Vaimo\ComposerPatches\Bootstrap
Open
$this->bootstrap = null;
- Exclude checks
Call to method getOperation
from undeclared class \Composer\Installer\PackageEvent
Open
if (!$this->operationAnalyser->isPatcherUninstallOperation($event->getOperation())) {
- Exclude checks