Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wip] start implement #64 #78

Open
wants to merge 4 commits into
base: 4.2.x
Choose a base branch
from
Open

[wip] start implement #64 #78

wants to merge 4 commits into from

Conversation

VolCh
Copy link
Contributor

@VolCh VolCh commented Jun 13, 2018

Fixes #64

Comment on lines +38 to +54
public function __invoke(string $className) : callable
{
if (isset(self::$hydratorsCache[$className])) {
return self::$hydratorsCache[$className];
}

// @todo Use modern PSR folder structure?
$filename = $this->targetDir . str_replace('\\', '_', $className) . '.php';
if (! file_exists($filename)) {
$this->generateFile($className, $filename);
}
$generateHydrator = $this;

$hydrate = require $filename;

return self::$hydratorsCache[$className] = $hydrate;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I need feedback about this piece of code and generated code

@VolCh
Copy link
Contributor Author

VolCh commented Dec 10, 2019

I've been back.

This PR is definitely not ready for merge now but I need feedback about GeneratedHydrator\ClosureGenerator\FileCache\GenerateFileCacheHydrator:__invoke() method and the generated code principles.

@Ocramius Ocramius changed the base branch from master to 4.2.x January 17, 2021 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generated hydrator and extractor should be a closure, not a class
2 participants