Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tables
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
grifart libs
tables
Commits
d1041867
Commit
d1041867
authored
3 years ago
by
Daniel Kurowski
Browse files
Options
Downloads
Patches
Plain Diff
Transformed Builders into Traversable
parent
f24a965d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!11
Allow customizations on scaffolded objects
Pipeline
#33948
passed
3 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Scaffolding/Builders.php
+8
-10
8 additions, 10 deletions
src/Scaffolding/Builders.php
src/Scaffolding/Scaffolding.php
+3
-4
3 additions, 4 deletions
src/Scaffolding/Scaffolding.php
with
11 additions
and
14 deletions
src/Scaffolding/Builders.php
+
8
−
10
View file @
d1041867
...
...
@@ -6,7 +6,10 @@ use Grifart\ClassScaffolder\Definition\ClassDefinition;
use
Grifart\ClassScaffolder\Definition\ClassDefinitionBuilder
;
final
class
Builders
/**
* @implements \IteratorAggregate<ClassDefinition>
*/
final
class
Builders
implements
\IteratorAggregate
{
private
function
__construct
(
private
ClassDefinitionBuilder
$rowClass
,
...
...
@@ -43,16 +46,11 @@ final class Builders
}
/**
* @return ClassDefinition[]
*/
public
function
buildAll
():
array
public
function
getIterator
():
\Traversable
{
return
[
$this
->
rowClass
->
build
(),
$this
->
modificationsClass
->
build
(),
$this
->
tableClass
->
build
(),
];
yield
$this
->
rowClass
->
build
();
yield
$this
->
modificationsClass
->
build
();
yield
$this
->
tableClass
->
build
();
}
}
This diff is collapsed.
Click to expand it.
src/Scaffolding/Scaffolding.php
+
3
−
4
View file @
d1041867
...
...
@@ -27,7 +27,6 @@ final class Scaffolding
* ```php
* return Scaffolding::definitionsForPgTable(...);
* ```
* @return ClassDefinition[]
*/
public
static
function
definitionsForPgTable
(
PostgresReflector
$pgReflector
,
...
...
@@ -38,7 +37,7 @@ final class Scaffolding
string
$modificationsClassName
,
string
$tableClassName
,
string
$primaryKeyClass
):
array
):
Builders
{
return
self
::
buildersForPgTable
(
$pgReflector
,
...
...
@@ -49,7 +48,7 @@ final class Scaffolding
$modificationsClassName
,
$tableClassName
,
$primaryKeyClass
,
)
->
buildAll
(
);
);
}
...
...
@@ -58,7 +57,7 @@ final class Scaffolding
* ```php
* $builders = Scaffolding::buildersForPgTable(...);
* $builders->getRowClass()->decorate(...);
* return $builders
->buildAll()
;
* return $builders;
* ```
*/
public
static
function
buildersForPgTable
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment