Skip to content

Commit

Permalink
Add type annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Oct 14, 2022
1 parent c54f09c commit ce5b6af
Show file tree
Hide file tree
Showing 26 changed files with 343 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/Framework/Attributes/CoversFunction.php
Expand Up @@ -19,13 +19,22 @@
#[Attribute(Attribute::TARGET_CLASS | Attribute::IS_REPEATABLE)]
final class CoversFunction
{
/**
* @psalm-var non-empty-string
*/
private readonly string $functionName;

/**
* @psalm-param non-empty-string $functionName
*/
public function __construct(string $functionName)
{
$this->functionName = $functionName;
}

/**
* @psalm-return non-empty-string
*/
public function functionName(): string
{
return $this->functionName;
Expand Down
9 changes: 9 additions & 0 deletions src/Framework/Attributes/DataProvider.php
Expand Up @@ -19,13 +19,22 @@
#[Attribute(Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
final class DataProvider
{
/**
* @psalm-var non-empty-string
*/
private readonly string $methodName;

/**
* @psalm-param non-empty-string $methodName
*/
public function __construct(string $methodName)
{
$this->methodName = $methodName;
}

/**
* @psalm-return non-empty-string
*/
public function methodName(): string
{
return $this->methodName;
Expand Down
8 changes: 8 additions & 0 deletions src/Framework/Attributes/DataProviderExternal.php
Expand Up @@ -23,10 +23,15 @@ final class DataProviderExternal
* @psalm-var class-string
*/
private readonly string $className;

/**
* @psalm-var non-empty-string
*/
private readonly string $methodName;

/**
* @psalm-param class-string $className
* @psalm-param non-empty-string $methodName
*/
public function __construct(string $className, string $methodName)
{
Expand All @@ -42,6 +47,9 @@ public function className(): string
return $this->className;
}

/**
* @psalm-return non-empty-string
*/
public function methodName(): string
{
return $this->methodName;
Expand Down
9 changes: 9 additions & 0 deletions src/Framework/Attributes/Depends.php
Expand Up @@ -19,13 +19,22 @@
#[Attribute(Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
final class Depends
{
/**
* @psalm-var non-empty-string
*/
private readonly string $methodName;

/**
* @psalm-param non-empty-string $methodName
*/
public function __construct(string $methodName)
{
$this->methodName = $methodName;
}

/**
* @psalm-return non-empty-string
*/
public function methodName(): string
{
return $this->methodName;
Expand Down
8 changes: 8 additions & 0 deletions src/Framework/Attributes/DependsExternal.php
Expand Up @@ -23,10 +23,15 @@ final class DependsExternal
* @psalm-var class-string
*/
private readonly string $className;

/**
* @psalm-var non-empty-string
*/
private readonly string $methodName;

/**
* @psalm-param class-string $className
* @psalm-param non-empty-string $methodName
*/
public function __construct(string $className, string $methodName)
{
Expand All @@ -42,6 +47,9 @@ public function className(): string
return $this->className;
}

/**
* @psalm-return non-empty-string
*/
public function methodName(): string
{
return $this->methodName;
Expand Down
8 changes: 8 additions & 0 deletions src/Framework/Attributes/DependsExternalUsingDeepClone.php
Expand Up @@ -23,10 +23,15 @@ final class DependsExternalUsingDeepClone
* @psalm-var class-string
*/
private readonly string $className;

/**
* @psalm-var non-empty-string
*/
private readonly string $methodName;

/**
* @psalm-param class-string $className
* @psalm-param non-empty-string $methodName
*/
public function __construct(string $className, string $methodName)
{
Expand All @@ -42,6 +47,9 @@ public function className(): string
return $this->className;
}

/**
* @psalm-return non-empty-string
*/
public function methodName(): string
{
return $this->methodName;
Expand Down
8 changes: 8 additions & 0 deletions src/Framework/Attributes/DependsExternalUsingShallowClone.php
Expand Up @@ -23,10 +23,15 @@ final class DependsExternalUsingShallowClone
* @psalm-var class-string
*/
private readonly string $className;

/**
* @psalm-var non-empty-string
*/
private readonly string $methodName;

/**
* @psalm-param class-string $className
* @psalm-param non-empty-string $methodName
*/
public function __construct(string $className, string $methodName)
{
Expand All @@ -42,6 +47,9 @@ public function className(): string
return $this->className;
}

/**
* @psalm-return non-empty-string
*/
public function methodName(): string
{
return $this->methodName;
Expand Down
9 changes: 9 additions & 0 deletions src/Framework/Attributes/DependsUsingDeepClone.php
Expand Up @@ -19,13 +19,22 @@
#[Attribute(Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
final class DependsUsingDeepClone
{
/**
* @psalm-var non-empty-string
*/
private readonly string $methodName;

/**
* @psalm-param non-empty-string $methodName
*/
public function __construct(string $methodName)
{
$this->methodName = $methodName;
}

/**
* @psalm-return non-empty-string
*/
public function methodName(): string
{
return $this->methodName;
Expand Down
9 changes: 9 additions & 0 deletions src/Framework/Attributes/DependsUsingShallowClone.php
Expand Up @@ -19,13 +19,22 @@
#[Attribute(Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
final class DependsUsingShallowClone
{
/**
* @psalm-var non-empty-string
*/
private readonly string $methodName;

/**
* @psalm-param non-empty-string $methodName
*/
public function __construct(string $methodName)
{
$this->methodName = $methodName;
}

/**
* @psalm-return non-empty-string
*/
public function methodName(): string
{
return $this->methodName;
Expand Down
9 changes: 9 additions & 0 deletions src/Framework/Attributes/ExcludeGlobalVariableFromBackup.php
Expand Up @@ -19,13 +19,22 @@
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
final class ExcludeGlobalVariableFromBackup
{
/**
* @psalm-var non-empty-string
*/
private readonly string $globalVariableName;

/**
* @psalm-param non-empty-string $globalVariableName
*/
public function __construct(string $globalVariableName)
{
$this->globalVariableName = $globalVariableName;
}

/**
* @psalm-return non-empty-string
*/
public function globalVariableName(): string
{
return $this->globalVariableName;
Expand Down
8 changes: 8 additions & 0 deletions src/Framework/Attributes/ExcludeStaticPropertyFromBackup.php
Expand Up @@ -23,10 +23,15 @@ final class ExcludeStaticPropertyFromBackup
* @psalm-var class-string
*/
private readonly string $className;

/**
* @psalm-var non-empty-string
*/
private readonly string $propertyName;

/**
* @psalm-param class-string $className
* @psalm-param non-empty-string $propertyName
*/
public function __construct(string $className, string $propertyName)
{
Expand All @@ -42,6 +47,9 @@ public function className(): string
return $this->className;
}

/**
* @psalm-return non-empty-string
*/
public function propertyName(): string
{
return $this->propertyName;
Expand Down
9 changes: 9 additions & 0 deletions src/Framework/Attributes/Group.php
Expand Up @@ -19,13 +19,22 @@
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
final class Group
{
/**
* @psalm-var non-empty-string
*/
private readonly string $name;

/**
* @psalm-param non-empty-string $name
*/
public function __construct(string $name)
{
$this->name = $name;
}

/**
* @psalm-return non-empty-string
*/
public function name(): string
{
return $this->name;
Expand Down
9 changes: 9 additions & 0 deletions src/Framework/Attributes/RequiresFunction.php
Expand Up @@ -19,13 +19,22 @@
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
final class RequiresFunction
{
/**
* @psalm-var non-empty-string
*/
private readonly string $functionName;

/**
* @psalm-param non-empty-string $functionName
*/
public function __construct(string $functionName)
{
$this->functionName = $functionName;
}

/**
* @psalm-return non-empty-string
*/
public function functionName(): string
{
return $this->functionName;
Expand Down
8 changes: 8 additions & 0 deletions src/Framework/Attributes/RequiresMethod.php
Expand Up @@ -23,10 +23,15 @@ final class RequiresMethod
* @psalm-var class-string
*/
private readonly string $className;

/**
* @psalm-var non-empty-string
*/
private readonly string $methodName;

/**
* @psalm-param class-string $className
* @psalm-param non-empty-string $methodName
*/
public function __construct(string $className, string $methodName)
{
Expand All @@ -42,6 +47,9 @@ public function className(): string
return $this->className;
}

/**
* @psalm-return non-empty-string
*/
public function methodName(): string
{
return $this->methodName;
Expand Down
9 changes: 9 additions & 0 deletions src/Framework/Attributes/RequiresOperatingSystem.php
Expand Up @@ -19,13 +19,22 @@
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD)]
final class RequiresOperatingSystem
{
/**
* @psalm-var non-empty-string
*/
private readonly string $regularExpression;

/**
* @psalm-param non-empty-string $regularExpression
*/
public function __construct(string $regularExpression)
{
$this->regularExpression = $regularExpression;
}

/**
* @psalm-return non-empty-string
*/
public function regularExpression(): string
{
return $this->regularExpression;
Expand Down
9 changes: 9 additions & 0 deletions src/Framework/Attributes/RequiresOperatingSystemFamily.php
Expand Up @@ -19,13 +19,22 @@
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD)]
final class RequiresOperatingSystemFamily
{
/**
* @psalm-var non-empty-string
*/
private readonly string $operatingSystemFamily;

/**
* @psalm-param non-empty-string $operatingSystemFamily
*/
public function __construct(string $operatingSystemFamily)
{
$this->operatingSystemFamily = $operatingSystemFamily;
}

/**
* @psalm-return non-empty-string
*/
public function operatingSystemFamily(): string
{
return $this->operatingSystemFamily;
Expand Down

0 comments on commit ce5b6af

Please sign in to comment.