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

phpstan: added lib/Mage and lib/Magento #2780

Merged
merged 7 commits into from
Dec 6, 2022
Merged

phpstan: added lib/Mage and lib/Magento #2780

merged 7 commits into from
Dec 6, 2022

Conversation

sreichel
Copy link
Contributor

@sreichel sreichel commented Dec 4, 2022

Description (*)

.. tried to fix as much as possible.

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All automated tests passed successfully (all builds are green)
  • Add yourself to contributors list

@github-actions github-actions bot added Component: lib/Mage Relates to lib/Mage Component: lib/* Relates to lib/* Component: lib/Magento Relates to lib/Magento phpstan labels Dec 4, 2022
@fballiano fballiano merged commit 0b373c9 into OpenMage:1.9.4.x Dec 6, 2022
@sreichel sreichel deleted the clean-phpstan branch December 6, 2022 10:47
@sreichel sreichel mentioned this pull request Dec 6, 2022
4 tasks
@@ -261,7 +261,7 @@ protected function _packToTar($skipRoot = false)
if (!$skipRoot) {
$header = $this->_composeHeader();
$data = $this->_readFile($file);
$data = str_pad($data, floor(((is_dir($file) ? 0 : filesize($file)) + 512 - 1) / 512) * 512, "\0");
$data = str_pad($data, intval(((is_dir($file) ? 0 : filesize($file)) + 512 - 1) / 512) * 512, "\0");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this changing behaviour?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with ...

$sizes =[
	511,
	512,
	513,
	45464654,
	724966
];

foreach ($sizes as $file) {
	var_dump((floor(($file + 512 - 1) / 512) * 512) == (intval(($file + 512 - 1) / 512) * 512));
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: lib/Mage Relates to lib/Mage Component: lib/Magento Relates to lib/Magento Component: lib/* Relates to lib/* phpstan
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants