Viewing File: /home/omtekel/www/wp-content/upgrade/backup/Exception.tar

ConditionLimitException.php000066600000000457151335021150012067 0ustar00<?php

namespace MediaWiki\Extension\AbuseFilter\Parser\Exception;

/**
 * Exceptions thrown upon reaching the condition limit of the AbuseFilter parser.
 */
class ConditionLimitException extends ExceptionBase {
	public function __construct() {
		parent::__construct( 'Condition limit reached.' );
	}
}
ExceptionBase.php000066600000001050151335021150010002 0ustar00<?php

namespace MediaWiki\Extension\AbuseFilter\Parser\Exception;

use Exception;

abstract class ExceptionBase extends Exception {

	/**
	 * Serialize data for edit stash
	 * @return array
	 */
	public function toArray(): array {
		return [
			'class' => static::class,
			'message' => $this->getMessage(),
		];
	}

	/**
	 * Deserialize data from edit stash
	 * @param array $value
	 * @return static
	 */
	public static function fromArray( array $value ) {
		[ 'class' => $cls, 'message' => $message ] = $value;
		return new $cls( $message );
	}

}
UserVisibleWarning.php000066600000001003151335021150011031 0ustar00<?php

namespace MediaWiki\Extension\AbuseFilter\Parser\Exception;

use Message;

/**
 * A variant of user-visible exception that is not fatal.
 */
class UserVisibleWarning extends UserVisibleException {
	/**
	 * @return Message
	 */
	public function getMessageObj(): Message {
		// Give grep a chance to find the usages:
		// abusefilter-parser-warning-match-empty-regex
		return new Message(
			'abusefilter-parser-warning-' . $this->mExceptionID,
			array_merge( [ $this->mPosition ], $this->mParams )
		);
	}
}
UserVisibleException.php000066600000005310151335021150011367 0ustar00<?php

namespace MediaWiki\Extension\AbuseFilter\Parser\Exception;

use Message;

/**
 * Exceptions that we might conceivably want to report to ordinary users
 * (i.e. exceptions that don't represent bugs in the extension itself)
 */
class UserVisibleException extends ExceptionBase {
	/** @var string */
	public $mExceptionID;
	/** @var int */
	protected $mPosition;
	/** @var array */
	protected $mParams;

	/**
	 * @param string $exception_id
	 * @param int $position
	 * @param array $params
	 */
	public function __construct( $exception_id, $position, $params ) {
		$this->mExceptionID = $exception_id;
		$this->mPosition = $position;
		$this->mParams = $params;

		parent::__construct( $exception_id );
	}

	/**
	 * @return int
	 */
	public function getPosition(): int {
		return $this->mPosition;
	}

	/**
	 * Returns the error message for use in logs
	 *
	 * @return string
	 */
	public function getMessageForLogs(): string {
		return "ID: {$this->mExceptionID}; position: {$this->mPosition}; params: " . implode( ', ', $this->mParams );
	}

	/**
	 * @return Message
	 */
	public function getMessageObj(): Message {
		// Give grep a chance to find the usages:
		// abusefilter-exception-unexpectedatend, abusefilter-exception-expectednotfound
		// abusefilter-exception-unrecognisedkeyword, abusefilter-exception-unexpectedtoken
		// abusefilter-exception-unclosedstring, abusefilter-exception-invalidoperator
		// abusefilter-exception-unrecognisedtoken, abusefilter-exception-noparams
		// abusefilter-exception-dividebyzero, abusefilter-exception-unrecognisedvar
		// abusefilter-exception-notenoughargs, abusefilter-exception-regexfailure
		// abusefilter-exception-overridebuiltin, abusefilter-exception-outofbounds
		// abusefilter-exception-notarray, abusefilter-exception-unclosedcomment
		// abusefilter-exception-invalidiprange, abusefilter-exception-disabledvar
		// abusefilter-exception-variablevariable, abusefilter-exception-toomanyargs
		// abusefilter-exception-negativeoffset, abusefilter-exception-unusedvars
		// abusefilter-exception-unknownfunction, abusefilter-exception-usebuiltin
		return new Message(
			'abusefilter-exception-' . $this->mExceptionID,
			array_merge( [ $this->mPosition ], $this->mParams )
		);
	}

	/**
	 * Serialize data for edit stash
	 * @return array
	 */
	public function toArray(): array {
		return [
			'class' => static::class,
			'exceptionID' => $this->mExceptionID,
			'position' => $this->mPosition,
			'params' => $this->mParams,
		];
	}

	/**
	 * Deserialize data from edit stash
	 * @param array $value
	 * @return static
	 */
	public static function fromArray( array $value ) {
		$cls = $value['class'];
		return new $cls( $value['exceptionID'], $value['position'], $value['params'] );
	}

}
InternalException.php000066600000000427151335021150010713 0ustar00<?php

namespace MediaWiki\Extension\AbuseFilter\Parser\Exception;

/**
 * Exceptions from the AbuseFilter parser that should not be reported to the user, because they indicate
 * programming errors or unexpected situations.
 */
class InternalException extends ExceptionBase {
}
InvalidSchemaMediaTypeException.php000066600000000527151335067210013460 0ustar00<?php

/*
 * This file is part of the JsonSchema package.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace JsonSchema\Exception;

/**
 * Wrapper for the InvalidSchemaMediaType
 */
class InvalidSchemaMediaTypeException extends RuntimeException
{
}
TooManyRedirectsException.php000066600000000145151335102440012371 0ustar00<?php

namespace GuzzleHttp\Exception;

class TooManyRedirectsException extends RequestException
{
}
Back to Directory File Manager