Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/Manifests/ContainerMixinManifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ public function build(array $extensionMethods, array $extensions)

$tags[] = new Method(
$methodName,
returnType: $reflectionMethod->hasReturnType() ? (new TypeResolver())->resolve($reflectionMethod->getReturnType()) : new Mixed_(),
parameters: $parameters,
returnType: $reflectionMethod->hasReturnType() ? (new TypeResolver())->resolve($reflectionMethod->getReturnType()) : new Mixed_(),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the point of this change please ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a sort of the parameters by the signature order. Not a requirement, but a "CS" fix.

);
}

Expand All @@ -142,8 +142,9 @@ public function build(array $extensionMethods, array $extensions)
public function shouldRecompile(): bool
{
return !is_file($this->containerMixinPath) ||
// We check here if the manifest has been generated before changing the installed.json composer file
filemtime($this->containerMixinPath) <= filemtime($this->vendorPath.'/composer/installed.json');
// We check here if the manifest has been generated before changing the installed.json composer file or the project composer.json
filemtime($this->containerMixinPath) <= filemtime($this->vendorPath.'/composer/installed.json') ||
filemtime($this->containerMixinPath) <= filemtime($this->basePath.'/composer.json');
}

/**
Expand Down
13 changes: 11 additions & 2 deletions src/Manifests/PackageManifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,14 @@ public function build()
}
}

if (is_file($path = $this->basePath.'/composer.json')) {
$package = json_decode(file_get_contents($path), true);

if (isset($package['extra']['faker'])) {
$packagesToProvide[$package['name'] ?? 'root'] = $package['extra']['faker'];
}
}

$this->write(
$packagesToProvide
);
Expand All @@ -133,8 +141,9 @@ public function build()
public function shouldRecompile(): bool
{
return !is_file($this->manifestPath) ||
// We check here if the manifest has been generated before changing the installed.json composer file
filemtime($this->manifestPath) <= filemtime($this->vendorPath.'/composer/installed.json');
// We check here if the manifest has been generated before changing the installed.json composer file or the project composer.json
filemtime($this->manifestPath) <= filemtime($this->vendorPath.'/composer/installed.json') ||
filemtime($this->manifestPath) <= filemtime($this->basePath.'/composer.json');
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.

/**
Expand Down
3 changes: 3 additions & 0 deletions tests/Support/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name": "xefi/faker-php-tests-support"
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add some unit tests for your feature

Loading