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

Deploy latest PHP-CS-Fixer rules (adapted some to match our setup with PHP 7+8) #602

Merged
merged 8 commits into from
Jun 5, 2023

Conversation

Seb35
Copy link
Contributor

@Seb35 Seb35 commented May 30, 2023

Observed changes:

  • in properties declarations, removed = null (no_null_property_initialization)
  • in methods definitions, replaced ?Type $variable = null by Type $variable = null (nullable_type_declaration_for_default_null_value)
  • replaced false !== strpos(…) by `str_contains(…) (modernize_strpos)
  • whitespaces changes (operator_linebreak, no_spaces_inside_parenthesis)
  • replaced 0 !== strpos(…) by !str_starts_with(…) (modernize_strpos)

Also adapted PHP-CS-Fixer configuration in a way that coding style fixes don't lead to failures when running in PHP 7.x.

Observed changes:
* in properties declarations, removed `= null`
  (no_null_property_initialization)
* in methods definitions, replaced
   `?Type $variable = null`
  by
   `Type $variable = null`
  (nullable_type_declaration_for_default_null_value)
* replaced `false !== strpos(…)` by `str_contains(…)
  (modernize_strpos)
* whitespaces changes
  (operator_linebreak, no_spaces_inside_parenthesis)
* replaced `0 !== strpos(…)` by `!str_starts_with(…)`
  (modernize_strpos)
@k00ni
Copy link
Collaborator

k00ni commented May 30, 2023

Thank you for taking the time.

@k00ni k00ni changed the title Run cs-fixer Deploy latest PHP-CS-Fixer rules (adapted some for our setup) Jun 1, 2023
@k00ni
Copy link
Collaborator

k00ni commented Jun 1, 2023

I took the liberty and changed some files. PHP-CS-Fixer was causing problems by enforcing code which is incompatible with PHP 7.x (see changed rules here: https://github.com/smalot/pdfparser/pull/602/files#diff-ef867390e21235c28e24595707bf636e1cc9cad29cf8ee4ac405c564a9facdf6)

@Seb35 Any objections or wanna add something? I would like to merge it soon to finish the other PR(s).

@k00ni k00ni changed the title Deploy latest PHP-CS-Fixer rules (adapted some for our setup) Deploy latest PHP-CS-Fixer rules (adapted some to match our setup with PHP 7+8) Jun 1, 2023
@k00ni k00ni merged commit fff98fd into smalot:master Jun 5, 2023
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.

2 participants