Skip to content

StaticInstance class is probably defect #1

@schlessera

Description

@schlessera

The class StaticInstance does not do anything meaningful (and thus is misleading).

It has a static property $instance that is probably meant to store the instance so that it can be retrieved later on and that one instance is shared across all requests.

However, in the getInstance() method, that property is always overwritten by a new instance of the extending class, rendering it useless. So, each call to getInstance() will create a new instance instead of sharing the previous one.

The getInstance() is probably missing a check to only create a new instance when the $instance property has not been set yet.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions