@param string $message
@param null $location

@throws BuildException
422742
protected function logError($message, $location = null)
    {
        if ($this->haltonerror) {
            throw new BuildException($message, $location);
        } else {
            $this->log($message, Project::MSG_ERR);
        }
    }
407449
public function main()
    {
        $message = $this->getMessage();
        if ($message === '') {
            throw new BuildException('"message" is a required parameter');
        }

        $user = $this->getUser();

        $clone = $this->getFactoryInstance('commit');
        $msg = sprintf("Commit: '%s'", $message);
        $this->log($msg, Project::MSG_INFO);
        $clone->setQuiet($this->getQuiet());
        $clone->setMessage($message);

        if (trim($user) === "") {
            throw new BuildException('"user" parameter can not be set to ""');
        }
        if ($user !== null) {
            $clone->setUser($user);
            $this->log("Commit: user = '$user'", Project::MSG_VERBOSE);
        }

        if ($this->repository === '') {
            $project = $this->getProject();
            $dir = $project->getProperty('application.startdir');
        } else {
            $dir = $this->repository;
        }
        $this->log('DIR:' . $dir, Project::MSG_INFO);
        $this->log('REPO: ' . $this->repository, Project::MSG_INFO);
        $cwd = getcwd();
        chdir($dir);

        try {
            $this->log("Executing: " . $clone->asString(), Project::MSG_INFO);
            $output = $clone->execute();
            if ($output !== '') {
                $this->log($output);
            }
        } catch (Exception $ex) {
            $msg = $ex->getMessage();
            $this->log("Exception: $msg", Project::MSG_INFO);
            $p = strpos($msg, 'hg returned:');
            if ($p !== false) {
                $msg = substr($msg, $p + 13);
            }
            chdir($cwd);
            throw new BuildException($msg);
        }
        chdir($cwd);
    }
641245
public function chat($message, $userID, $location){
        $params = [
            'key' => $this->apiKey,
            'info' => $message,
            'userid' => $userID,
            'loc' => $location
        ];
        $client = new Client();
        $response = $client->post($this->server, [
            'body' => json_encode($params)
        ]);
        return json_decode($response->getBody()->getContents(), true);
    }
1047572
public function assertIsNull($value, $message='Unexpected null value: %s', $exception='Asserts')
    {
        if (is_null($value)) {
            $value = 'NULL';
            $this->throwException($exception, $message, $value);
        }
    }
726054
public function setLocation(\BlackForest\PiwikBundle\Entity\PiwikLocation $location = null)
    {
        $this->location = $location;

        return $this;
    }
989655
public static function addConfigurationLog($message, Tree $tree = null): void
    {
        self::addLog($message, self::TYPE_CONFIGURATION, $tree);
    }
1189150
private function createRestLocation(Location $location): RestLocation
    {
        return new RestLocation(
            $location,
            $this->locationService->getLocationChildCount($location)
        );
    }
1265092
public function update(UpdateStruct $location, $locationId)
    {
        $query = $this->handler->createUpdateQuery();

        $query
            ->update($this->handler->quoteTable('ezcontentobject_tree'))
            ->set(
                $this->handler->quoteColumn('priority'),
                $query->bindValue($location->priority)
            )
            ->set(
                $this->handler->quoteColumn('remote_id'),
                $query->bindValue($location->remoteId)
            )
            ->set(
                $this->handler->quoteColumn('sort_order'),
                $query->bindValue($location->sortOrder)
            )
            ->set(
                $this->handler->quoteColumn('sort_field'),
                $query->bindValue($location->sortField)
            )
            ->where(
                $query->expr->eq(
                    $this->handler->quoteColumn('node_id'),
                    $locationId
                )
            );
        $statement = $query->prepare();
        $statement->execute();

        // Commented due to EZP-23302: Update Location fails if no change is performed with the update
        // Should be fixed with PDO::MYSQL_ATTR_FOUND_ROWS instead
        /*if ( $statement->rowCount() < 1 )
        {
            throw new NotFound( 'location', $locationId );
        }*/
    }
823674
public function createLocation(string $location, string $match = null) : Location
    {
        return new Location(new Param($location), is_null($match) ? null : new Param($match));
    }
139174
private function withExtra(PusherMessage $message)
    {
        if ($message->getPlatform() == $this->platform) {
            throw CouldNotCreateMessage::platformConflict($this->platform);
        }

        $this->extraMessage = $message;
    }
442079
public function validate($location, Constraint $constraint)
    {
        if (null === $location) {
            $this->context->addViolation($constraint->message);

            return;
        }

        $isContainer = new IsContainer();
        if (!$isContainer->isSatisfiedBy($location)) {
            $this->context->addViolation($constraint->message);
        }
    }
5726
public void setLocation(Location location) {
        if (location != null) {
            this.location = location;
        } else {
            this.location = Location.Unspecified;
        }
    }
173111
public function addLocation(\google\protobuf\SourceCodeInfo\Location $value)
    {
        if ($this->location === null) {
            $this->location = new \Protobuf\MessageCollection();
        }

        $this->location->add($value);
    }
660792
public function generate($location)
    {
        if (!empty($location)) {
            @mkdir($location);

            if (substr($location, -1) != '/') {
                $location .= '/';
            }

            file_put_contents($location . 'composer.json', $this->generateJSON());
        } else {
            throw new \Exception('A location must be provided when generating a composer.json file');
        }
    }
978249
public function refreshSystemUrlAliasesForLocation(Location $location): void
    {
        $this->service->refreshSystemUrlAliasesForLocation($location);

        $this->signalDispatcher->emit(
            new UpdateLocationSignal(
                [
                    'contentId' => $location->contentId,
                    'locationId' => $location->id,
                    'parentLocationId' => $location->parentLocationId,
                ]
            )
        );
    }
1314623
public function setLocation( Location $location )
    {
        foreach ( $this->handlers as $handler )
        {
            if ( $handler instanceof LocationAwareHandlerInterface )
            {
                $handler->setLocation( $location );
            }
        }
    }
1303001
@Override
    public void execute() throws BuildException {
        if (ifCondition != null) {
            final String msg = MessageUtils.getMessage("DOTA014W", "if", "if:set")
                    .setLocation(this.getLocation())
                    .toString();
            getProject().log(msg, Project.MSG_WARN);
        }
        if (unlessCondition != null) {
            final String msg = MessageUtils.getMessage("DOTA014W", "unless", "unless:set")
                    .setLocation(this.getLocation())
                    .toString();
            getProject().log(msg, Project.MSG_WARN);
        }
        final boolean fail = nestedConditionPresent()
                       ? testNestedCondition()
                       : (testIfCondition() && testUnlessCondition());
        if (!fail) {
            return;
        }

        if (id == null) {
            throw new BuildException("id attribute must be specified");
        }

        final MessageBean msgBean = MessageUtils.getMessage(id, readParamValues());
        final DITAOTLogger logger = new DITAOTAntLogger(getProject());
        if (msgBean != null) {
            final String type = msgBean.getType();
            if (FATAL.equals(type)) {
                setMessage(msgBean.toString());
                try {
                    super.execute();
                } catch (final BuildException ex) {
                    throw new BuildException(msgBean.toString(),new DITAOTException(msgBean, ex, msgBean.toString()));
                }
            } else if (ERROR.equals(type)) {
                logger.error(msgBean.toString());
            } else if (WARN.equals(type)) {
                logger.warn(msgBean.toString());
            } else if (INFO.equals(type)) {
                logger.info(msgBean.toString());
            } else if (DEBUG.equals(type)) {
                logger.debug(msgBean.toString());
            }
        }

        
    }