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

[2021-12-06] drop support of php7.3 #6

Closed
6 tasks done
jkowalleck opened this issue Oct 7, 2021 · 1 comment · Fixed by #125
Closed
6 tasks done

[2021-12-06] drop support of php7.3 #6

jkowalleck opened this issue Oct 7, 2021 · 1 comment · Fixed by #125

Comments

@jkowalleck
Copy link
Member

jkowalleck commented Oct 7, 2021

on 2021-12-06 the support for php7.3 ended. see https://www.php.net/supported-versions.php

lets take this for a change to switch the min-version of this lib to 7.4 .
see https://www.php.net/manual/en/migration74.new-features.php

so to use the new language features, a breaking change will happen:


PROPOSAL: remove getters and setters, if a property can be made type safe and converted to public.

PRO

  • less methods to maintain

CON

  • no setters = cannot use chained setters ala $instance->setA(1)->setB(2);

code changes

from

class C {
  /** @var bool */
  private $prop = true;

  /** @return $this */
  public function setProp(bool $prop): self
  {
     $this->prop = $prop;
     return $this;
  }
}

to

class C {
  public bool $prop = true;
}

@jkowalleck jkowalleck added this to the v2 milestone Oct 7, 2021
@jkowalleck jkowalleck pinned this issue Dec 1, 2021
@jkowalleck jkowalleck unpinned this issue Dec 4, 2021
jkowalleck added a commit that referenced this issue Jan 4, 2022
related to #6

Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
jkowalleck added a commit that referenced this issue Jan 4, 2022
related to #6

Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
jkowalleck added a commit that referenced this issue Jan 4, 2022
related to #6

Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
jkowalleck added a commit that referenced this issue Jan 4, 2022
related to #6

Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
@jkowalleck
Copy link
Member Author

jkowalleck commented Sep 17, 2022

proposed change to remove getters/setters was dropped, for now.
removing setters wouod remove the feature to of chaining, which comes in handy in downstream implementations.
removing the getter might be appealing, but can be re-thought later.

see also: #128

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant