Jump to content

Recommended Posts

I don't know where I should post this.  I wrote a PHP class that I want to make available to the PHPFreaks community.  I'd also like comments on it (critique) on how to make it better and/or improve things within it.  I was thinking PHP Applications, but that seems like a place to post official php stuff, not stuff that people here wrote.

 

So, anyone know where, if anywhere, I can post this?

Link to comment
https://forums.phpfreaks.com/topic/162132-where-would-i-post-this/
Share on other sites

Well, I was just saying that if someone posted a link to their online "pharmacy" where people can buy viagra, you know for the convenience of other people so they don't have to search themselves, he likely wouldn't hesitate to call it advertising (or spam). Switching out "viagra" with "PHP classes" doesn't mean it's no longer advertising, but it just changes the advertised product.

It's still advertisement. The fact that it's PHP related doesn't mean it's not advertising. It doesn't matter if it's viagra, penis enlargement pills or PHP classes.

 

 

That would be a really weird combination.

 

...or would it? 

Class blah extends ....

corbin, you need to learn proper OO design ;)

 

The decorator pattern is much better for this:

 

<?php
interface IPenisDecorator
{
public function getSize();
public function isErect();
public function getDecoratedObject();
}

class Penis implements IPenisDecorator
{
/**
 * Size of penis i cm
 *
 * @var float
 */
private $_size;

/**
 * @var boolean
 */
private $_erect = false;

public function __construct($size)
{
	$this->_size = (float) $size;
}

public function getSize()
{
	return $this->_size;
}

public function isErect()
{
	return $this->_erect;
}

public function getDecoratedObject()
{
	return $this;
}

// other methods
}

class PenisEnlarger implements IPenisDecorator
{
/**
 * @var IPenisDecorator;
 */
private $_decorated;

public function __construct(IPenisDecorator $decorated)
{
	$this->_decorated = $decorated;
}

public function getSize()
{
	return $this->_decorated->getSize() * 1.2;
}

public function isErect()
{
	return $this->_decorated->isErect();
}

public function getDecoratedObject()
{
	return $this->_decorated;
}
}

class Viagra implements IPenisDecorator
{
/**
 * Duration time in seconds
 * 
 * @var integer
 */
static protected $_durationTime = 7200;

/**
 * @var IPenisDecorator;
 */
private $_decorated;

private $_creationTime;

public function __construct(IPenisDecorator $decorated)
{
	$this->_decorated = $decorated;
	$this->_creationTime = time();
}

public function getSize()
{
	return $this->_decorated->getSize();
}

public function isErect()
{
	if (time() - self::$_durationTime > $this->_creationTime) {
		return true;
	}
	else {
		return $this->_decorated->isErect();
	}
}

public function getDecoratedObject()
{
	return $this->_decorated;
}
}

$penis = new PenisEnlarger(new Penis(15));
echo $penis->getSize(); // 18

Haha I knew I set myself up for that the second I clicked the submit button :) .  A while back the wife and I were looking around for inspiration for tattoos in general, as she wanted to get another tattoo.  It just came up on some website showcasing some of the freakier tattoos people got. 

 

 

My girlfriend is going to get her bellybutton pierced and one day she was on my phone looking at the website of the place where she's probably going to get it done (a tattoo/piercing place).  She goes "Look at this!"

 

And I was like "Huh?" and looked.  Some guy had a bar in the middle of his penis.  It definitely caught me off guard lol.

Does it stretch into an ugly scar?

 

 

I doubt she's thought about that.

 

 

She's 17 though, so I don't think she plans (at least I hope not!) on having kids anytime soon.  Surely if the piercing grew back before one started growing from pregnancy it wouldn't leave a nasty scar...  Maybe though.

It's not necessarily a nasty scar... but the place where the piercing was stretches out a bit and doesn't exactly go back to it's original shape.  And my wife took her belly button jewelry out before she got pregnant... so it had a chance to grow back but did not.  And age doesn't really matter.  My wife had hers done at 19 and we had our first kid when she was 25.

Dude chicks get crazy about shit like that.  You're just like "so what honey, it's no big deal," but she'll make out like it's the end of the world and shit. NOT worth it.  Especially when you already have to hear it about other things.  Scar from c-section if applicable.  Stretch marks.  Looser happy no-no spot fears. 

Well, in that metaphor, the source is the source of babies.

 

 

It all makes sense now!

 

 

It's not necessarily a nasty scar... but the place where the piercing was stretches out a bit and doesn't exactly go back to it's original shape.  And my wife took her belly button jewelry out before she got pregnant... so it had a chance to grow back but did not.  And age doesn't really matter.  My wife had hers done at 19 and we had our first kid when she was 25.

 

Hrmmm....  That kinda sucks.  Don't think it'd bother her though.  I did mention it to her yesterday though, and she said she didn't think it would scar if she took it out like 6 months before she started growing.  Maybe I should tell her it will probably do weird things regardless haha.

 

 

Dude chicks get crazy about shit like that.  You're just like "so what honey, it's no big deal," but she'll make out like it's the end of the world and shit. NOT worth it.  Especially when you already have to hear it about other things.  Scar from c-section if applicable.  Stretch marks.  Looser happy no-no spot fears. 

 

LOL!

It doesn't really matter when she takes it out.  That's not really the issue.  The issue is that there's a hole there in the first place.  If she gets a piercing, the hole will be there.  When she starts blowing up like a balloon, it will stretch.  If she takes it out before she starts expanding, she might get lucky and the hole might heal itself and therefore not stretch.  But then, it might not close at all.  It's not uncommon for people's piercings to never really close.  I had ear piercings from when I was a teenager.  I haven't worn earrings in like 12 years now, and they are still open.  And they were regular free-with-purchase-of-studs piercing you get at walmart, not those stick-a-padlock-through-your-ear sized holes.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.