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

Static Class and Helper Functions #15

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Static Class and Helper Functions #15

wants to merge 10 commits into from

Conversation

stephen-hill
Copy link
Owner

This pull request adds the following classes:

  • StephenHill\StaticBase58
  • \Base58

and adds the following functions:

  • base58_encode
  • base58_decode

This pull request is directly related to issue #14.

The master branch will be tagged with v1.2 when this branch is merged.

Still todo is document the changes in readme.md.

@@ -0,0 +1,33 @@
<?php

if (false === function_exists('base58_encode'))

Choose a reason for hiding this comment

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

No need in false ===, it looks weird. I think

if (!function_exists('base58_encode'))

Is 100% enough and much more readable :)

@barbushin
Copy link

Also I think there should be some usage example in README.md.

In common, looks great! 👍

@stephen-hill stephen-hill modified the milestones: v1.2, v1.1 Dec 21, 2015
@jasny
Copy link

jasny commented May 29, 2018

You shouldn't really define these functions in the global namespace. Put them in the StephenHill namespace instead and put the following on top of your source file.

use function StephenHill\base58_encode;
use function StephenHill\base58_decode;

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.

3 participants