@param bool $interactive

@return mixed|void
@throws \Exception
165577
public function setup($interactive = true)
    {
        /** @noinspection PhpUnhandledExceptionInspection */
        $this->checkInstalled($this->workDir);

        $input = $this->input;

        $this->quiet = $this->input->getOption('quiet');
        $this->noInteraction = $this->input->getOption('no-interaction');

        if ($this->noInteraction || $this->quiet) {
            $interactive = false;
        }

        if ($input->getOption('namespace')) {
            $this->namespace = trim($input->getOption('namespace'), '\\') . '\\';
        }

        if ($input->hasOption('actor') && $input->getOption('actor')) {
            $this->actorSuffix = $input->getOption('actor');
        }

        if ($interactive) {
            $this->askForAcknowledgment();
        }

        $this->say("<fg=white;bg=magenta> Bootstrapping Codeception for WordPress </fg=white;bg=magenta>\n");

        $this->createGlobalConfig();

        $this->say("File codeception.yml created       <- global configuration");

        $this->createDirs();

        if ($input->hasOption('empty') && $input->getOption('empty')) {
            return;
        }

        if ($interactive === null) {
            $this->say();
            $interactive = $this->ask('Would you like to set up the suites interactively now?', 'yes');
            $this->say(' --- ');
            $this->say();
            $interactive = preg_match('/^(n|N)/', $interactive) ? false : true;
        }

        $installationData = $this->getInstallationData($interactive);

        try {
            $this->creatEnvFile($installationData);
            $this->loadEnvFile();
            $this->createUnitSuite();
            $this->say("tests/unit created                 <- unit tests");
            $this->say("tests/unit.suite.yml written       <- unit tests suite configuration");
            $this->createWpUnitSuite(ucwords($installationData['wpunitSuite']), $installationData);
            $this->say("tests/{$installationData['wpunitSuiteSlug']} created               "
                       . '<- WordPress unit and integration tests');
            $this->say("tests/{$installationData['wpunitSuiteSlug']}.suite.yml written     "
                       . '<- WordPress unit and integration tests suite configuration');
            $this->createFunctionalSuite(ucwords($installationData['functionalSuite']), $installationData);
            $this->say("tests/{$installationData['functionalSuiteSlug']} created           "
                       . "<- {$installationData['functionalSuiteSlug']} tests");
            $this->say("tests/{$installationData['functionalSuiteSlug']}.suite.yml written "
                       . "<- {$installationData['functionalSuiteSlug']} tests suite configuration");
            $this->createAcceptanceSuite(ucwords($installationData['acceptanceSuite']), $installationData);
            $this->say("tests/{$installationData['acceptanceSuiteSlug']} created           "
                       . "<- {$installationData['acceptanceSuiteSlug']} tests");
            $this->say("tests/{$installationData['acceptanceSuiteSlug']}.suite.yml written "
                       . "<- {$installationData['acceptanceSuiteSlug']} tests suite configuration");
        } catch (ModuleConfigException $e) {
            $this->removeCreatedFiles();
            $this->say('<error>Something is not ok in the modules configurations: '
                       .'check your answers and try again.</error>');
            $this->say('<error>' . $e->getMessage() . '</error>');
            $this->sayInfo('All files and folders created by the initialization attempt have been removed.');

            return;
        }

        $this->say(" --- ");
        $this->say();
        if ($interactive) {
            $this->saySuccess("Codeception is installed for {$installationData['acceptanceSuiteSlug']}, "
                              . "{$installationData['functionalSuiteSlug']}, and WordPress unit testing");
        } else {
            $this->saySuccess("Codeception has created the files for the {$installationData['acceptanceSuiteSlug']}, "
                              . "{$installationData['functionalSuiteSlug']}, WordPress unit and unit suites "
                              . 'but the modules are not activated');
        }
        $this->say('Some commands have been added in the Codeception configuration file: '
                   .'check them out using <comment>codecept --help</comment>');
        $this->say(" --- ");
        $this->say();

        $this->say("<bold>Next steps:</bold>");
        $this->say('0. <bold>Create the databases used by the modules</bold>; wp-browser will not do it for you!');
        $this->say('1. <bold>Install and configure WordPress</bold> activating the theme and plugins you need to create'
                   . ' a database dump in <comment>tests/_data/dump.sql</comment>');
        $this->say("2. Edit <bold>tests/{$installationData['acceptanceSuiteSlug']}.suite.yml</bold> to make sure WPDb "
                   . 'and WPBrowser configurations match your local setup; change WPBrowser to WPWebDriver to '
                   . 'enable browser testing');
        $this->say("3. Edit <bold>tests/{$installationData['functionalSuiteSlug']}.suite.yml</bold> to make sure "
                   . 'WordPress and WPDb configurations match your local setup');
        $this->say("4. Edit <bold>tests/{$installationData['wpunitSuiteSlug']}.suite.yml</bold> to make sure WPLoader "
                   . 'configuration matches your local setup');
        $this->say("5. Create your first {$installationData['acceptanceSuiteSlug']} tests using <comment>codecept "
                   . "g:cest {$installationData['acceptanceSuiteSlug']} WPFirst</comment>");
        $this->say("6. Write a test in <bold>tests/{$installationData['acceptanceSuiteSlug']}/WPFirstCest.php</bold>");
        $this->say("7. Run tests using: <comment>codecept run {$installationData['acceptanceSuiteSlug']}</comment>");
        $this->say(" --- ");
        $this->say();
        $this->sayWarning('Please note: due to WordPress extended use of globals and constants you should avoid running'
                          . ' all the suites at the same time.');
        $this->say('Run each suite separately, like this: <comment>codecept run unit && codecept run '
                   . "{$installationData['wpunitSuiteSlug']}</comment>, to avoid problems.");
    }
257314
public function getPid(bool $required = true) {
		if (null !== ($id = $this->getId($required))) {
			return $this->getEiType()->idToPid($id);
		}
		
		return null;
	}
1118848
public function passive($passive = true)
    {
        $this->passive = $passive;

        if ($this->connection) {
            $result = ftp_pasv($this->connection, $passive);
            if ($result === false) {
                throw new Exception('Unable to change passive mode');
            }
        }

        return $this;
    }
183872
protected function executeHandler()/*# : bool */
    {
        try {
            $handler = $this->result->getHandler();
            $callable = $this->getResolver()->resolve($handler);

            if ($this->result->getRoute()) {
                return $this->callableWithRoute($callable);
            } else {
                call_user_func($callable, $this->result);
                return true;
            }
        } catch (\Exception $e) {
            $this->result->setHandler(null);
            return false;
        }
    }
441914
public function interactInstallDrupal(
    InputInterface $input,
    OutputInterface $output,
    AnnotationData $annotationData
  ) {
    /** @var \Acquia\Blt\Robo\Wizards\SetupWizard $setup_wizard */
    $setup_wizard = $this->getContainer()->get(SetupWizard::class);
    $setup_wizard->wizardInstallDrupal();
  }
542376
public void setInteractive(final boolean INTERACTIVE) {
        if (null == interactive) {
            _interactive = INTERACTIVE;
            redraw();
        } else {
            interactive.set(INTERACTIVE);
        }
    }
691554
public function execute()
    {
        if (!defined('ENABLE_SHELL_PLUGIN') || !ENABLE_SHELL_PLUGIN) {
            throw new \Exception(Lang::get('shell_not_enabled'));
        }

        $success = true;

        foreach ($this->commands as $command) {
            $command = $this->phpci->interpolate($command);

            if (!$this->phpci->executeCommand($command)) {
                $success = false;
            }
        }

        return $success;
    }
843567
public static function event($value): void
    {
        if (false === self::message($value)) {
            throw new Exception\InvalidEvent($value);
        }
    }
9461
private function loadView(bool $try = false) : void
  {
    // configure view component
    Accessor::$viewsExtension = config('view.extension');
    Accessor::$viewsEngine    = config('view.engine');
    Accessor::$viewsCache     = config('app.dir') . config('view.compiled');
    Accessor::$viewsDirectory = config('app.dir') . config('view.views');

    // load component
    Accessor::requireView();
  }
168954
protected function interact(Input $input, Output $output) {
        return $this->cmd->interact($input,$output);
    }
1261681
public static function invoke(
        bool $valid,
        array $options = [],
        string $defaultInvalidCode = self::DEFAULT_INVALID_CODE,
        string $validCode = self::DEFAULT_VALID_CODE
    ): string {
        if ($valid) {
            return $validCode;
        };

        return Property::getString(
            $options,
            static::OPTION_INVALID_CODE,
            $defaultInvalidCode
        );
    }
1277291
public function onInteraction($consumer, $interaction, $hash)
	{
		if (!isset($interaction['interaction']['content'])) {
			$interaction['interaction']['content'] = 'No interaction.content for this interaction';
		}
		echo $hash.': '.$interaction['interaction']['content'].PHP_EOL.'--'.PHP_EOL;
	}
856010
public function execute()
    {
        try {
            $adminUser = $this->_auth->getUser();

            if ($adminUser->getRefreshToken()) {
                $adminUser->setRefreshToken('')
                    ->save();
            }
            $this->messageManager->addSuccessMessage('Successfully disconnected');
        } catch (\Exception $e) {
            $this->messageManager->addErrorMessage($e->getMessage());
        }

        $this->_redirect('adminhtml/system_config/edit', ['section' => 'connector_developer_settings']);
    }
534808
public function add($interactorName, $className)
    {
        if (! $this->definitionExists($interactorName, $className)) {
            $this->validate($interactorName, $className);
            $this->set($interactorName, $className);
        }
    }
1000980
private function byOption()
    {
        $option = new OptionForCli($this->interactor);
        $option->setOption($this->option);
        $option->execute();
    }
689433
public function Connect ($dsn = FALSE, $user = FALSE, $pass = FALSE, $options = FALSE)
	{
		
		if (!$this->connected)
		{
			
			$this->_dsn		= $dsn?: $this->_dsn;
			$this->_user	= $user?: $this->_user;
			$this->_pass	= $pass?: $this->_pass;
			$this->_options	= $options?: $this->_options;
			
			parent::__construct ($this->_dsn, $this->_user, $this->_pass, $this->_options);
			
			$this->connected	= TRUE;
			
		}
		
	}
355208
public function run()
    {
        if (PHP_SAPI === 'cli' && is_subclass_of($this, ConsoleAppInterface::class))
        {
            $this->execConsoleApp();
        }
        else if (is_subclass_of($this, WebAppInterface::class))
        {
            $this->execWebApp();
        }
        else
        {
            throw new \Exception("No interface was implemented");
        }
    }