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

Aded Data Helper and Session Helper #12

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

Conversation

ericuldall
Copy link

These are two objects I find myself using a lot. I feel like the Class Name "Data" might be a bit too generic and would advise an alternate name, nothing came to mind right away.

* @var PCRE
*
*/
private static $binary_regexp = '/^(?:[01]{8}){0,12}$/'; // UNTESTED
Copy link
Contributor

Choose a reason for hiding this comment

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

we should avoid static whenever possible in Ohanzee.

Copy link
Author

Choose a reason for hiding this comment

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

What do you prefer in that instance? const??

Context: I strayed away from 'const' originally because the data would be public, I guess it seems trivial for it not to be in this case.

Copy link
Author

Choose a reason for hiding this comment

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

I also, notice that you are calling local methods using static::method(), do you prefer that to self::method(). Not sure if there's a need for static::method() in a no dependency library since there should be no late static bindings. Unless you foresee users extending these classes in such a way.

Copy link
Author

Choose a reason for hiding this comment

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

replaced static props with constants where possible.

@shadowhand
Copy link
Contributor

It would be really helpful if these new classes came with phpspec tests.

@ericuldall
Copy link
Author

Sounds good to me. I'll get some setup.

@ericuldall
Copy link
Author

Also, just reviewed the psr-2 spec and realized I have some solid changes to make. Should be up to spec in a day or two.

*/
public static function isActive()
{
return self::status() === PHP_SESSION_ACTIVE ? true : false;
Copy link
Contributor

Choose a reason for hiding this comment

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

here, the expression already returns boolean, you don't need the ternary at all.

Copy link
Author

Choose a reason for hiding this comment

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

fixing.

@ericuldall
Copy link
Author

I think I've addressed all of your concerns from the last code review. I still need to get on some phpspec tests, though.

@rjd22
Copy link
Contributor

rjd22 commented Nov 18, 2015

@shadowhand it would be possible to merge this and make a ticket for tests.

@shadowhand
Copy link
Contributor

It should be composed of two commits, not 26. And it needs tests.

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

Successfully merging this pull request may close these issues.

3 participants