{@inheritdoc}

@throws \LogicException
343393
public function addHeaderIfNotExist(string $name, string $value) : parent
    {
        if ($this->headerSent($file, $line)) {
            throw new \LogicException(sprintf("Headers is already sent in '%s:%s'", $file, $line));
        }

        return parent::addHeaderIfNotExist($name, $value);
    }
57924
public function defineMethods()
    {
        if ($this->failover && !is_object($this->failover)) {
            throw new LogicException("ViewableData::\$failover set to a non-object");
        }
        if ($this->failover) {
            $this->addMethodsFrom('failover');

            if (isset($_REQUEST['debugfailover'])) {
                $class = static::class;
                $failoverClass = get_class($this->failover);
                Debug::message("$class created with a failover class of {$failoverClass}");
            }
        }
        $this->extensibleDefineMethods();
    }
930005
public function addArgument(Argument $argument) {
        if (isset($this->arguments[$argument->getName()])) {
            throw new \LogicException(sprintf('An argument with name "%s" already exists.', $argument->getName()));
        }

        if ($this->hasAnArrayArgument) {
            throw new \LogicException('Cannot add an argument after an array argument.');
        }

        if ($argument->isRequired() && $this->hasOptional) {
            throw new \LogicException('Cannot add a required argument after an optional one.');
        }

        if ($argument->isArray()) {
            $this->hasAnArrayArgument = true;
        }

        if ($argument->isRequired()) {
            ++$this->requiredCount;
        }
        else {
            $this->hasOptional = true;
        }

        $this->arguments[$argument->getName()] = $argument;
    }
1318898
public function createData()
    {
        if (!$this->isInstantiable()) {
            throw new \LogicException("Family {$this->getCode()} is not instantiable");
        }
        if ($this->isSingleton()) {
            throw new \LogicException(
                "Family {$this->getCode()} is a singleton, use the repository to retrieve the instance"
            );
        }
        $dataClass = $this->getDataClass();

        return new $dataClass($this);
    }
419906
public function listen(ServerSocketContract $serverSocket)
    {
        if ($this->isRunning()) {
            throw new LogicException('Cannot add listening while the server is serving.');
        }

        if ($serverSocket->isBound()) {
            throw new LogicException('The server socket can be bound to server only once.');
        }

        $address = "{$serverSocket->getHost()}:{$serverSocket->getPort()}";

        if (isset($this->serverSockets[$address])) {
            throw new LogicException('The same address has been listened before.');
        }

        $swoolePort = $this->swooleServer->listen(
            $serverSocket->getHost(),
            $serverSocket->getPort(),
            $serverSocket->getSocketType()
        );

        if ($swoolePort == false) {
            $errorCode = $this->swooleServer->getLastError();

            throw new RuntimeException(sprintf(
                'Listen %s%s fail, error code %d', $serverSocket->getHost(),
                $serverSocket->getPort() ? ':'.$serverSocket->getPort() : '', $errorCode
            ), $errorCode);
        }

        $this->serverSockets[$address] = $serverSocket;

        $serverSocket->listen($this, $swoolePort);
    }
168501
public function boot()
    {
        if ($this->booted) {
            return;
        }

        if (!$this->name) {
            throw new \LogicException('Package: ' . get_class($this) . ' name property should not be empty.');
        }

        $this->getConfig();

        $this->registerProviders($this->getContainer());

        $this->registerListeners($this->getDispatcher());

        $this->registerMiddlewares();

        $this->booted = true;
    }
494687
public function create()
    {
        $pdo = null;
        try {
            $pdo = $this->connect();
        } catch (\Exception $e) {
            $pdo = null;
            if ($this->isLostConnection($e)) {
                $pdo = $this->reconnect();
            }

            throw new \LogicException('Connection lost and no reconnector available.');
        }

        return $pdo;
    }
155719
public function process(
        ObjectInterface $object,
        ResolvedFixtureSet $fixtureSet,
        GenerationContext $context,
        MethodCallInterface $methodCall
    ): ResolvedFixtureSet {
        if (false === ($methodCall instanceof OptionalMethodCall)) {
            throw new \LogicException('TODO');
        }

        if (null === $this->processor) {
            throw new \LogicException('TODO');
        }

        if (mt_rand(0, 99) >= $methodCall->getPercentage()) {
            return $fixtureSet;
        }

        return $this->processor->process(
            $object,
            $fixtureSet,
            $context,
            $methodCall->getOriginalMethodCall()
        );
    }
1205350
public function unserialize($value) : void
    {
        if (isset($this->value)) {
            throw new \LogicException('unserialize() is an internal function, it must not be called directly.');
        }

        [$value, $scale] = \explode(':', $value);

        $this->value = $value;
        $this->scale = (int) $scale;
    }
901839
public function getField($field)
    {
        $fields = $this->getFields();
        if (!isset($fields[$field])) {
            throw new \LogicException(sprintf('Undefined field %s.', $field));
        }

        return $fields[$field];
    }
264571
public function extension($extension)
    {
        if (is_string($extension)) {
            $extension = new $extension;
        } elseif (!$extension instanceof AbstractExtension) {
            throw new \LogicException('Not an extension object or an extension class name.');
        }

        $this->addExtension($extension);
    }
327672
public function resolve($class)
    {
        if ($this->getContainer()->has($class)) {
            $seeder = $this->getContainer()->get($class);
        } else {
            $seeder = new $class;
        }

        if (!$seeder instanceof self) {
            throw new \LogicException(sprintf('The seeder "%s" does not extend WouterJ\EloquentBundle\Seeder', get_class($seeder)));
        }
        $seeder->setSfContainer($this->getContainer());

        $this->addSeededClass($seeder);

        return $seeder;
    }
534008
public function setOptions(array $options = [])
    {
        if ($this->isRunning()) {
            throw new LogicException('Options cannot be set while the server is running.');
        }

        $this->options = array_diff_key($this->options, $options) + $options;

        $this->swooleServer->set($this->options);
    }
165199
public function export()
    {
        if ($this->config == null) {
            throw new LogicException('Context must be set before export the service.');
        }

        if ($this->dispatcher == null) {
            throw new LogicException('Dispatcher must be set before export the service.');
        }

        $this->dispatcher->exportInvoker(
            $this->getInvoker()
        );
    }
1095223
public function make($contract)
    {
        if (empty($this->bindings[$contract])) {
            throw new \LogicException('Not found contract:' . $contract);
        }

        $class = $this->bindings[$contract];
        if ($class['type'] == 'closure') {
            return call_user_func($class['closure'], $class['class'], $class['args']);
        } else if ($class['type'] == 'singleton') {
            return $class['instance'];
        }

        throw new \LogicException('Not found contract:' . $contract);
    }
542888
public function setDefault($default = null)
    {
        if (self::REQUIRED === $this->mode && null !== $default) {
            throw new LogicException('Cannot set a default value except for InputArgument::OPTIONAL mode.');
        }

        if ($this->isArray()) {
            if (null === $default) {
                $default = [];
            } elseif (!\is_array($default)) {
                throw new LogicException('A default value for an array argument must be an array.');
            }
        }

        $this->default = $default;
    }
742796
public function select()
    {
        if( !$this->tableName ) {
            throw new LogicException('No table name specified');
        }
        $q = $this->database->select();
        $q->table($this->tableName);
        if( $this->resultClass ) {
            $q->setResultClass($this->resultClass);
            $q->setResultParams($this->resultParams);
        }
        return $q;
    }