Skip to content

Commit

Permalink
Change and fix property visibility in lazy-objects example #3 (#4294)
Browse files Browse the repository at this point in the history
With private visibility on id property for class BlogPost, example 3 is not functional. Changing visibility to public resolves this error. All properties are set to public in this example for homogeneity.
  • Loading branch information
paz-ekino authored Dec 11, 2024
1 parent e93feee commit 49f60a8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions language/oop5/lazy-objects.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ int(1)
class BlogPost
{
public function __construct(
private int $id,
private string $title,
private string $content,
public int $id,
public string $title,
public string $content,
) { }
}
Expand Down

0 comments on commit 49f60a8

Please sign in to comment.