Skip to content

Commit

Permalink
Merge pull request #139 from Roave/renovate/vimeo-psalm-5.x
Browse files Browse the repository at this point in the history
Update dependency vimeo/psalm to v5
  • Loading branch information
Ocramius committed Nov 30, 2022
2 parents 73646a8 + e2ec720 commit 78eaaeb
Show file tree
Hide file tree
Showing 8 changed files with 144 additions and 188 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -14,7 +14,7 @@
"ext-json": "*",
"composer-plugin-api": "^2.1.0",
"ocramius/package-versions": "^2.7.0",
"vimeo/psalm": "^4.30.0"
"vimeo/psalm": "^5.0.0"
},
"require-dev": {
"composer/composer": "^2.4.4",
Expand Down
239 changes: 92 additions & 147 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions src/Composer/PackagesRequiringStrictChecks.php
Expand Up @@ -18,10 +18,11 @@ final class PackagesRequiringStrictChecks
{
private const THIS_PACKAGE_NAME = 'roave/you-are-using-it-wrong';

/** @var array<int, Package> */
/** @var list<Package> */
private array $packages;

private function __construct(Package ...$packages)
/** @param array<int, Package> $packages */
private function __construct(array $packages)
{
$this->packages = array_values($packages);
}
Expand Down Expand Up @@ -50,7 +51,7 @@ public static function fromComposerLocker(Locker $locker, string $projectInstall
*/
$lockData = $locker->getLockData();

return new self(...array_filter(
return new self(array_filter(
array_map(
static function (array $packageDefinition) use ($projectInstallationPath): Package {
return Package::fromPackageDefinition(
Expand All @@ -66,7 +67,7 @@ static function (Package $package): bool {
));
}

/** @return array<int, string> */
/** @return list<string> */
public function packagesForWhichUsagesAreToBeTypeChecked(): array
{
return array_map(static function (Package $package): string {
Expand Down
7 changes: 3 additions & 4 deletions src/Psalm/Configuration.php
Expand Up @@ -26,10 +26,9 @@ private function __construct(ProjectFileFilter $files, string ...$checkedNamespa
{
parent::__construct();

$this->project_files = $files;
$this->allow_phpstorm_generics = true;
$this->use_docblock_types = true;
$this->checkedNamespaces = $checkedNamespaces;
$this->project_files = $files;
$this->use_docblock_types = true;
$this->checkedNamespaces = $checkedNamespaces;

$this->setIncludeCollector(new IncludeCollector());
}
Expand Down
12 changes: 3 additions & 9 deletions src/Psalm/ProjectFilesToBeTypeChecked.php
Expand Up @@ -8,17 +8,11 @@
use Roave\YouAreUsingItWrong\Composer\PackageAutoload;

/** @internal this class is only for configuring psalm according to the defaults of this repository */
final class ProjectFilesToBeTypeChecked extends ProjectFileFilter
final class ProjectFilesToBeTypeChecked
{
/** {@inheritDoc} */
public function __construct(bool $inclusive)
public static function fromAutoloadDefinitions(PackageAutoload $autoload): ProjectFileFilter
{
parent::__construct($inclusive);
}

public static function fromAutoloadDefinitions(PackageAutoload $autoload): self
{
$instance = new self(true);
$instance = ProjectFileFilter::loadFromArray([], __DIR__, true);

foreach ($autoload->directories() as $directory) {
$instance->addDirectory($directory);
Expand Down

0 comments on commit 78eaaeb

Please sign in to comment.