-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from codders/feat/upgrade-mediawiki-codesniffe…
…r-20241206 Upgrade mediawiki-codesniffer to latest version (45.0.0)
- Loading branch information
Showing
16 changed files
with
35 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,8 +13,6 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
php: | ||
- '7.2' | ||
- '7.3' | ||
- '7.4' | ||
- '8.0' | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
use RuntimeException; | ||
|
||
/** | ||
* @license GPL-2.0+ | ||
* @license GPL-2.0-or-later | ||
* @author Jeroen De Dauw < [email protected] > | ||
*/ | ||
final class FormatterOptions { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
use RuntimeException; | ||
|
||
/** | ||
* @license GPL-2.0+ | ||
* @license GPL-2.0-or-later | ||
* @author Jeroen De Dauw < [email protected] > | ||
*/ | ||
class FormattingException extends RuntimeException { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
* Interface for value formatters, typically (but not limited to) expecting a DataValue object and | ||
* returning a string. | ||
* | ||
* @license GPL-2.0+ | ||
* @license GPL-2.0-or-later | ||
* @author Jeroen De Dauw < [email protected] > | ||
*/ | ||
interface ValueFormatter { | ||
|
@@ -17,7 +17,7 @@ interface ValueFormatter { | |
* Identifier for the option that holds the code of the language in which the formatter should | ||
* operate. | ||
*/ | ||
const OPT_LANG = 'lang'; | ||
public const OPT_LANG = 'lang'; | ||
|
||
/** | ||
* @param mixed $value | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
use RuntimeException; | ||
|
||
/** | ||
* @license GPL-2.0+ | ||
* @license GPL-2.0-or-later | ||
* @author Jeroen De Dauw < [email protected] > | ||
*/ | ||
class ParseException extends RuntimeException { | ||
|
@@ -23,11 +23,11 @@ class ParseException extends RuntimeException { | |
private $rawValue; | ||
|
||
/** | ||
* @param string $message A plain english message describing the error | ||
* @param string $message A plain english message describing the error | ||
* @param string|null $rawValue The raw value that failed to be parsed. | ||
* @param string|null $expectedFormat An identifier for the format the raw value did not match | ||
*/ | ||
public function __construct( string $message, string $rawValue = null, string $expectedFormat = null ) { | ||
public function __construct( string $message, ?string $rawValue = null, ?string $expectedFormat = null ) { | ||
parent::__construct( $message ); | ||
$this->expectedFormat = $expectedFormat; | ||
$this->rawValue = $rawValue; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
use RuntimeException; | ||
|
||
/** | ||
* @license GPL-2.0+ | ||
* @license GPL-2.0-or-later | ||
* @author Jeroen De Dauw < [email protected] > | ||
*/ | ||
final class ParserOptions { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
* Interface for value parsers, typically (but not limited to) expecting a string and returning a | ||
* DataValue object. | ||
* | ||
* @license GPL-2.0+ | ||
* @license GPL-2.0-or-later | ||
* @author Jeroen De Dauw < [email protected] > | ||
*/ | ||
interface ValueParser { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,22 +5,21 @@ | |
namespace ValueValidators; | ||
|
||
/** | ||
* @license GPL-2.0+ | ||
* @license GPL-2.0-or-later | ||
* @author Jeroen De Dauw < [email protected] > | ||
*/ | ||
class Error { | ||
|
||
public const SEVERITY_ERROR = 9; | ||
public const SEVERITY_WARNING = 4; | ||
|
||
private $text; | ||
private $severity; | ||
private $property; | ||
private string $text; | ||
private int $severity; | ||
private ?string $property; | ||
private string $code; | ||
private array $params; | ||
|
||
private $code; | ||
private $params; | ||
|
||
public static function newError( string $text = '', string $property = null, string $code = 'invalid', array $params = [] ): self { | ||
public static function newError( string $text = '', ?string $property = null, string $code = 'invalid', array $params = [] ): self { | ||
return new self( $text, self::SEVERITY_ERROR, $property, $code, $params ); | ||
} | ||
|
||
|
@@ -37,7 +36,7 @@ public function getText(): string { | |
} | ||
|
||
/** | ||
* @return integer, element of the ValueValidatorError::SEVERITY_ enum | ||
* @return int element of the ValueValidatorError::SEVERITY_ enum | ||
*/ | ||
public function getSeverity(): int { | ||
return $this->severity; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,13 +5,13 @@ | |
namespace ValueValidators; | ||
|
||
/** | ||
* @license GPL-2.0+ | ||
* @license GPL-2.0-or-later | ||
* @author Jeroen De Dauw < [email protected] > | ||
*/ | ||
final class Result { | ||
|
||
private $isValid; | ||
private $errors; | ||
private bool $isValid; | ||
private array $errors; | ||
|
||
/** | ||
* @return self | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
namespace ValueValidators; | ||
|
||
/** | ||
* @license GPL-2.0+ | ||
* @license GPL-2.0-or-later | ||
* @author Jeroen De Dauw < [email protected] > | ||
*/ | ||
interface ValueValidator { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
* @group ValueFormatters | ||
* @group DataValueExtensions | ||
* | ||
* @license GPL-2.0+ | ||
* @license GPL-2.0-or-later | ||
* @author Jeroen De Dauw < [email protected] > | ||
*/ | ||
class FormatterOptionsTest extends TestCase { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
* @group ValueParsers | ||
* @group DataValueExtensions | ||
* | ||
* @license GPL-2.0+ | ||
* @license GPL-2.0-or-later | ||
* @author Jeroen De Dauw < [email protected] > | ||
*/ | ||
class ParserOptionsTest extends TestCase { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
* @group ValueValidators | ||
* @group DataValueExtensions | ||
* | ||
* @license GPL-2.0+ | ||
* @license GPL-2.0-or-later | ||
* @author Jeroen De Dauw < [email protected] > | ||
*/ | ||
class ErrorTest extends TestCase { | ||
|
@@ -49,7 +49,7 @@ public function testNewError() { | |
*/ | ||
$this->assertInstanceOf( 'ValueValidators\Error', $error ); | ||
|
||
$this->assertTrue( is_string( $error->getProperty() ) || is_null( $error->getProperty() ) ); | ||
$this->assertTrue( is_string( $error->getProperty() ) || $error->getProperty() === null ); | ||
|
||
if ( count( $args ) > 0 ) { | ||
$this->assertSame( $args[0], $error->getText() ); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters