'subscription' => $this->subscription,
'data' => $data
]);
- $returnValues = $action->executeAction();
- $userSubscription = $returnValues['returnValues'];
+ $action->executeAction();
}
else {
// extend existing subscription
File: (?P<file>.*?) \((?P<line>\d+)\)\s*
Extra Information: (?P<information>(?:-|[a-zA-Z0-9+/]+={0,2}))\s*
Stack Trace: (?P<stack>[a-zA-Z0-9+/]+={0,2})', Regex::DOT_ALL);
- $stackTraceFormatter = new Regex('^\s+(#\d+)', Regex::MULTILINE);
foreach ($this->exceptions as $key => $val) {
$i++;
if ($i < $this->startIndex || $i > $this->endIndex) {
$processor = null;
try {
// post back to paypal to validate
+ /** @noinspection PhpUnusedLocalVariableInspection */
$content = '';
try {
$url = 'https://www.paypal.com/cgi-bin/webscr';
<ul class="exceptionStacktrace">
<?php
$trace = sanitizeStacktrace($e);
- $pathLength = array_reduce($trace, function ($carry, $item) {
- return max($carry, mb_strlen($item['file'].$item['line']));
- }, 0) + 3;
for ($i = 0, $max = count($trace); $i < $max; $i++) {
?>
<li class="exceptionStacktraceFile"><?php echo '#'.$i.' '.StringUtil::encodeHTML($trace[$i]['file']).' ('.$trace[$i]['line'].')'.':'; ?></li>
* @param integer $showOrder
*/
public function setShowOrder($showOrder = 0) {
- $newShowOrder = 1;
-
$sql = "SELECT MAX(showOrder)
FROM wcf".WCF_N."_ad";
$statement = WCF::getDB()->prepareStatement($sql);
* @return array
*/
public function prepareEdit() {
- $message = '';
if ($this->comment !== null) {
$message = $this->comment->message;
}
public function sendNotification(Like $like) {
$objectType = CommentHandler::getInstance()->getObjectType($this->object->objectTypeID);
if (UserNotificationHandler::getInstance()->getObjectTypeID($objectType->objectType.'.like.notification')) {
- $notificationObjectType = UserNotificationHandler::getInstance()->getObjectTypeProcessor($objectType->objectType.'.like.notification');
if ($this->userID != WCF::getUser()->userID) {
$notificationObject = new LikeUserNotificationObject($like);
UserNotificationHandler::getInstance()->fireEvent('like', $objectType->objectType.'.like.notification', $notificationObject, [$this->userID], [
$comment = new Comment($this->object->commentID);
$objectType = CommentHandler::getInstance()->getObjectType($comment->objectTypeID);
if (UserNotificationHandler::getInstance()->getObjectTypeID($objectType->objectType.'.response.like.notification')) {
- $notificationObjectType = UserNotificationHandler::getInstance()->getObjectTypeProcessor($objectType->objectType.'.response.like.notification');
if ($this->userID != WCF::getUser()->userID) {
$notificationObject = new LikeUserNotificationObject($like);
UserNotificationHandler::getInstance()->fireEvent('like', $objectType->objectType.'.response.like.notification', $notificationObject, [$this->userID], [
* @param integer $showOrder
*/
public function setShowOrder($showOrder = 0) {
- $newShowOrder = 1;
-
$sql = "SELECT MAX(showOrder)
FROM wcf".WCF_N."_notice";
$statement = WCF::getDB()->prepareStatement($sql);
* @param integer $showOrder
*/
public function setShowOrder($showOrder = 0) {
- $newShowOrder = 1;
-
$sql = "SELECT MAX(showOrder)
FROM wcf".WCF_N."_paid_subscription";
$statement = WCF::getDB()->prepareStatement($sql);
// open variables.xml
$xml = new XML();
$xml->loadXML($filename, $content);
- $xpath = $xml->xpath();
$variables = $xml->xpath()->query('/ns:variables/ns:variable');
$data = [];
}
}
- $result = '';
if ($width > 0) {
$class = '';
if ($alignment == 'left' || $alignment == 'right') {
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute(['%-' . ($parameters['month'] < 10 ? '0' : '') . $parameters['month'] . '-%']);
while ($row = $statement->fetchArray()) {
- list($year, $month, $day) = explode('-', $row[$birthday]);
+ list(, $month, $day) = explode('-', $row[$birthday]);
if (!isset($data[$month . '-' . $day])) $data[$month . '-' . $day] = [];
$data[$month . '-' . $day][] = $row['userID'];
}
* @throws IllegalLinkException
*/
public static function getCommand($line) {
- list($command, $parameters) = explode(' ', $line.' ', 2);
+ list($command, ) = explode(' ', $line.' ', 2);
if (!isset(self::$commands[strtolower($command)])) throw new IllegalLinkException();
* @throws IllegalLinkException
*/
public static function getCommandName($line) {
- list($command, $parameters) = explode(' ', $line.' ', 2);
+ list($command, ) = explode(' ', $line.' ', 2);
if (!isset(self::$commands[strtolower($command)])) throw new IllegalLinkException();
* @return string[]
*/
public static function getParameters($line) {
- list ($command, $parameters) = explode(' ', $line.' ', 2);
+ list (, $parameters) = explode(' ', $line.' ', 2);
$chars = str_split(StringUtil::trim($parameters));
$tmp = '';
$processNo = PackageInstallationQueue::getNewProcessNo();
// insert queue
- $queue = PackageInstallationQueueEditor::create([
+ PackageInstallationQueueEditor::create([
'processNo' => $processNo,
'userID' => CLIWCF::getUser()->userID,
'package' => $archive->getPackageInfo('name'),
// InstallPackageAction::stepInstall()
$step_ = $installation->install($node);
$queueID = $installation->nodeBuilder->getQueueByNode($installation->queue->processNo, $step_->getNode());
-
+
if ($step_->hasDocument()) {
- $innerTemplate = $step_->getTemplate();
$progress = $installation->nodeBuilder->calculateProgress($node);
$node = $step_->getNode();
$currentAction = $installation->nodeBuilder->getPackageNameByQueue($queueID);
*/
protected function getErrorMessageElement() {
if ($this->errorMessage) {
- $errorMessage = '';
switch ($this->errorMessage) {
case 'wcf.condition.greaterThan.error.maxValue':
$errorMessage = WCF::getLanguage()->getDynamicVariable($this->errorMessage, [
parent::execute($cronjob);
WCF::getDB()->beginTransaction();
+ /** @noinspection PhpUnusedLocalVariableInspection */
$commited = false;
try {
$sql = "SELECT jobID, job
* @inheritDoc
*/
public function createThumbnail($maxWidth, $maxHeight, $obtainDimensions = true) {
- $width = $height = $x = $y = 0;
+ $x = $y = 0;
$sourceWidth = $this->width;
$sourceHeight = $this->height;
*/
private static function resolveDuplicate($username) {
$i = 0;
- $newUsername = '';
do {
$i++;
$newUsername = 'Duplicate'.($i > 1 ? $i : '').' '.$username;
WCF::getDB()->beginTransaction();
// like data
+ /** @noinspection PhpUnusedLocalVariableInspection */
$cumulativeLikes = 0;
+ /** @noinspection PhpUnusedLocalVariableInspection */
$newValue = $oldValue = null;
$users = [];
}
// find the quote and simulate a regular call to render quotes
- $quoteData = [];
foreach ($this->quotes as $objectType => $objectIDs) {
foreach ($objectIDs as $objectID => $quoteIDs) {
if (isset($quoteIDs[$quoteID])) {
* @inheritDoc
*/
public function getFormElement(Option $option, $value) {
- $allowedBBCodes = [];
if ($option->allowedbbcodepermission) {
$allowedBBCodes = explode(',', WCF::getSession()->getPermission($option->allowedbbcodepermission));
}
$this->loadBBCodeSelection();
}
- $selectedBBCodes = [];
if ($value == 'all') {
$selectedBBCodes = $this->bbCodes;
}
$buildSchema = ltrim($buildSchema, '/');
$components = preg_split('~({(?:[a-z]+)})~', $buildSchema, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
- $delimiters = ['/', '-', '.', '_'];
foreach ($components as $component) {
$type = 'component';
/**
* @deprecated 2.2 - no longer required
*/
+ /** @noinspection PhpUnusedLocalVariableInspection */
$appendSession = false;
// enforce a certain level of sanitation and protection for links embedded in emails
$shiftEndBy += $shiftStartBy;
$shiftStartBy = 0;
}
-
+
// shift abstract start
if ($start - $shiftStartBy < 0) {
$shiftEndBy += $shiftStartBy - $start;
// shift abstract end
if ($end + $shiftEndBy > mb_strlen($text) - 1) {
$shiftStartBy = $end + $shiftEndBy - mb_strlen($text) - 1;
- $shiftEndBy = 0;
if ($shiftStartBy > $start) {
$start = 0;
}
* @throws SystemException
*/
public function getSourceContent($sourceFilename) {
+ /** @noinspection PhpUnusedLocalVariableInspection */
$sourceContent = '';
if (!file_exists($sourceFilename) || (($sourceContent = @file_get_contents($sourceFilename)) === false)) {
throw new SystemException("Could not open template '$sourceFilename' for reading");
}
// pass remaining tag args as variables
- $variables = [];
if (!empty($args)) {
foreach ($args as $variable => $value) {
if (substr($value, 0, 1) == "'") {
if (!empty($phpCode)) $phpCode = "<?php\n".$phpCode."\n?>";
$sourceFilename = $this->template->getSourceFilename($templateName, $application);
- $metaDataFilename = $this->template->getMetaDataFilename($templateName);
$data = $this->compileString($templateName, file_get_contents($sourceFilename), [
'application' => $application,
* @return string $tag
*/
public function popTag($tag) {
- list($openTag, $lineNo) = array_pop($this->tagStack);
+ list($openTag, ) = array_pop($this->tagStack);
if ($tag == $openTag) {
return $openTag;
}
// calculation starts with month, thus start with
// month of $time (if within values)
$currentMonth = gmdate('n', self::$timeBase);
- $currentYear = gmdate('Y', self::$timeBase);
- $index = self::findKey($currentMonth, $values['month']);
+ self::findKey($currentMonth, $values['month']);
self::calculateDay($values);
}
$result[] = "--- a";
$result[] = "+++ b";
- $inContext = 0;
$leftStart = 1;
$rightStart = 1;
for ($i = 0, $max = count($d); $i < $max; $i++) {
- list($type, $line) = $d[$i];
+ list($type, ) = $d[$i];
if ($type == self::REMOVED || $type == self::ADDED) {
// calculate start of context
// search the end of the current window
$plus = $minus = 0;
for ($j = $start; $j < $max; $j++) {
- list($type, $line) = $d[$j];
+ list($type, ) = $d[$j];
switch ($type) {
case self::REMOVED: