Cleaned up code to be consistent, inc. adding docblocs, using PSR naming conventions & typos

Docblocs benefits:
- IDE auto complete gives info on type etc
- Auto documentation on CI
This commit is contained in:
eddiejaoude
2013-09-03 08:08:19 +01:00
parent 20cfe16b12
commit cee1dd1da5
10 changed files with 109 additions and 36 deletions

View File

@@ -1,23 +1,37 @@
<?php
/*
* DesignPatternPHP
*/
namespace DesignPatterns\AbstractFactory;
/**
* Class JsonFactory
*
* JsonFactory is a factory for creating a family of JSON component
* (example for ajax)
*
* @package DesignPatterns\AbstractFactory
*/
class JsonFactory extends AbstractFactory
{
/**
* Creates a picture component
*
* @param string $path
* @param string $name
* @return Json\Picture|Picture
*/
public function createPicture($path, $name = '')
{
return new Json\Picture($path, $name);
}
/**
* Creates a text component
*
* @param string $content
* @return Json\Text|Text
*/
public function createText($content)
{
return new Json\Text($content);