Skip to content

Conversation

eddiejaoude
Copy link
Contributor

Do NOT merge (yet)

  • Vagrant and Ansible

Creational

  • AbstractFactory
  • Builder
  • FactoryMethod
  • Multiton
  • Pool
  • Prototype
  • SimpleFactory
  • Singleton
  • StaticFactory

Structural

  • Adapter
  • Bridge
  • Composite
  • DataMapper
  • Decorator
  • DependencyInjection
  • Facade
  • FluentInterface
  • Proxy
  • Registry

Behavioral

  • ChainOfResponsibilities
  • Command
  • Iterator
  • Mediator
  • Memento
  • NullObject
  • Observer
  • Specification
  • State
  • Strategy
  • TemplateMethod
  • Visitor

More

  • Delegation
  • ServiceLocator
  • Repository

@eddiejaoude
Copy link
Contributor Author

How to define class variable types?

@bocharsky-bw
Copy link
Contributor

Does it possible in PHP7? I think it could to do only with annotations only

@eddiejaoude
Copy link
Contributor Author

I am not sure. I couldn't find anything on it while having a quick search. But I would have thought that if in strict mode class variables need a declared type too.

@bocharsky-bw
Copy link
Contributor

In HHVM properties declare with scalar types as:

class User {
    private string $name;
}

Could you try this syntax for PHP 7?

@eddiejaoude
Copy link
Contributor Author

@bocharsky-bw unfortunately that didn't work 😢 . Thanks though 😄

- added tests as none existed
- removed example usage as replaced by unit test
$book = clone $this->fooBookPrototype;

$this->assertInstanceOf('DesignPatterns\Creational\Prototype\FooBookPrototype', $book);
$this->assertNotSame($this->fooBookPrototype, $book);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed example usage file and replaced with test. Is this a good test, or can it be improved?


namespace DesignPatterns\Creational\FactoryMethod;

/**
* Bicycle is a bicycle
* Class Bicycle
Copy link

Choose a reason for hiding this comment

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

This type of comments is non sens. Why do you have to write Class Bicycle when is clearly that you define this class 3 lines below ?

@HassanAlthaf
Copy link
Contributor

Keep up the hard work, if you need help, feel free to inform me.

@domnikl
Copy link
Contributor

domnikl commented Sep 22, 2016

I am closing here as it is already very old and I am working on PHP7 feature usage in the php7 branch. Thanks @eddiejaoude for the hard work and @bocharsky-bw, @marius-rizac and @HassanAlthaf for the feedback, I already incorporated most of it in the php-7 branch

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.

4 participants