Skip to content

Commit

Permalink
Merge pull request #71 from greg0ire/upgrade-cs
Browse files Browse the repository at this point in the history
Upgrade to doctrine/coding-standard 12
  • Loading branch information
SenseException authored Dec 3, 2024
2 parents c80c8ed + 409330d commit 02c4605
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"php": "^7.1 || ^8.0"
},
"require-dev": {
"doctrine/coding-standard": "^9",
"doctrine/coding-standard": "^9 || ^12",
"phpstan/phpstan": "1.4.10 || 2.0.3",
"phpstan/phpstan-phpunit": "^1.0 || ^2",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
Expand Down
8 changes: 2 additions & 6 deletions src/Deprecation.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,7 @@ public static function triggerIfCalledFromOutside(string $package, string $link,
self::delegateTriggerToBackend($message, $backtrace, $link, $package);
}

/**
* @param list<array{function: string, line?: int, file?: string, class?: class-string, type?: string, args?: mixed[], object?: object}> $backtrace
*/
/** @param list<array{function: string, line?: int, file?: string, class?: class-string, type?: string, args?: mixed[], object?: object}> $backtrace */
private static function delegateTriggerToBackend(string $message, array $backtrace, string $link, string $package): void
{
$type = self::$type ?? self::getTypeFromEnv();
Expand Down Expand Up @@ -289,9 +287,7 @@ public static function getTriggeredDeprecations(): array
return self::$triggeredDeprecations;
}

/**
* @return int-mask-of<self::TYPE_*>
*/
/** @return int-mask-of<self::TYPE_*> */
private static function getTypeFromEnv(): int
{
switch ($_SERVER['DOCTRINE_DEPRECATIONS'] ?? $_ENV['DOCTRINE_DEPRECATIONS'] ?? null) {
Expand Down
8 changes: 2 additions & 6 deletions src/PHPUnit/VerifyDeprecations.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,13 @@ public function expectNoDeprecationWithIdentifier(string $identifier): void
$this->doctrineNoDeprecationsExpectations[$identifier] = Deprecation::getTriggeredDeprecations()[$identifier] ?? 0;
}

/**
* @before
*/
/** @before */
public function enableDeprecationTracking(): void
{
Deprecation::enableTrackingDeprecations();
}

/**
* @after
*/
/** @after */
public function verifyDeprecationsAreTriggered(): void
{
foreach ($this->doctrineDeprecationsExpectations as $identifier => $expectation) {
Expand Down

0 comments on commit 02c4605

Please sign in to comment.