Skip to content

Commit

Permalink
CS fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nediam committed Jan 20, 2016
1 parent f95a466 commit 812a3b3
Show file tree
Hide file tree
Showing 6 changed files with 192 additions and 203 deletions.
2 changes: 1 addition & 1 deletion Events/PhraseappEvents.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ final class PhraseappEvents
* @var string
*/
const POST_DOWNLOAD = 'phraseapp.post_download';
}
}
232 changes: 116 additions & 116 deletions Events/PostDownloadEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,119 +10,119 @@

class PostDownloadEvent extends Event
{
/**
* @var array
*/
private $tempData = [];

/**
* @var null|string
*/
private $finalFilePath = null;

/**
* @var string
*/
private $locale;

/**
* @var string
*/
private $catalogue;

/**
* PostDownloadEvent constructor.
*
* @param array $tempData
* @param string $locale
* @param string $catalogue
*/
public function __construct(array $tempData, $locale, $catalogue)
{
$this->tempData = $tempData;
$this->locale = $locale;
$this->catalogue = $catalogue;
}

/**
* @return array
*/
public function getTempData()
{
return $this->tempData;
}

/**
* @param array $tempFiles
*
* @return $this
*/
public function setTempData(array $tempData)
{
$this->tempData = $tempData;

return $this;
}

/**
* @return null|string
*/
public function getFinalFilePath()
{
return $this->finalFilePath;
}

/**
* @param null|string $finalFilePath
*
* @return $this
*/
public function setFinalFilePath($finalFilePath = null)
{
$this->finalFilePath = $finalFilePath;

return $this;
}

/**
* @return string
*/
public function getLocale()
{
return $this->locale;
}

/**
* @param string $locale
*
* @return $this
*/
public function setLocale($locale)
{
$this->locale = $locale;

return $this;
}

/**
* @return string
*/
public function getCatalogue()
{
return $this->catalogue;
}

/**
* @param string $catalogue
*
* @return $this
*/
public function setCatalogue($catalogue)
{
$this->catalogue = $catalogue;

return $this;
}


}
/**
* @var array
*/
private $tempData = [];

/**
* @var null|string
*/
private $finalFilePath = null;

/**
* @var string
*/
private $locale;

/**
* @var string
*/
private $catalogue;

/**
* PostDownloadEvent constructor.
*
* @param array $tempData
* @param string $locale
* @param string $catalogue
*/
public function __construct(array $tempData, $locale, $catalogue)
{
$this->tempData = $tempData;
$this->locale = $locale;
$this->catalogue = $catalogue;
}

/**
* @return array
*/
public function getTempData()
{
return $this->tempData;
}

/**
* @param array $tempData
*
* @return $this
*/
public function setTempData(array $tempData)
{
$this->tempData = $tempData;

return $this;
}

/**
* @return null|string
*/
public function getFinalFilePath()
{
return $this->finalFilePath;
}

/**
* @param null|string $finalFilePath
*
* @return $this
*/
public function setFinalFilePath($finalFilePath = null)
{
$this->finalFilePath = $finalFilePath;

return $this;
}

/**
* @return string
*/
public function getLocale()
{
return $this->locale;
}

/**
* @param string $locale
*
* @return $this
*/
public function setLocale($locale)
{
$this->locale = $locale;

return $this;
}

/**
* @return string
*/
public function getCatalogue()
{
return $this->catalogue;
}

/**
* @param string $catalogue
*
* @return $this
*/
public function setCatalogue($catalogue)
{
$this->catalogue = $catalogue;

return $this;
}


}
56 changes: 27 additions & 29 deletions Service/FileMerger.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,33 @@

class FileMerger
{
/**
* @var MergeInterface[]
*/
private $handlers = [];
/**
* @var MergeInterface[]
*/
private $handlers = [];

/**
* FileMerger constructor.
*
* @param array $adapters
*/
public function __construct()
{
$this->handlers[] = new YamlMerger();
}
/**
* FileMerger constructor.
*/
public function __construct()
{
$this->handlers[] = new YamlMerger();
}

/**
* @param $content
* @param $format
*
* @return string
*/
public function merge($content, $format)
{
foreach ($this->handlers as $handler) {
if ($handler->canMerge($format)) {
return $handler->merge($content);
}
}
/**
* @param $content
* @param $format
*
* @return string
*/
public function merge($content, $format)
{
foreach ($this->handlers as $handler) {
if ($handler->canMerge($format)) {
return $handler->merge($content);
}
}

throw new \InvalidArgumentException('No handler for requested format');
}
}
throw new \InvalidArgumentException('No handler for requested format');
}
}
30 changes: 15 additions & 15 deletions Service/MergeStrategy/MergeInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@

interface MergeInterface
{
/**
* @param $format
*
* @return bool
*/
public function canMerge($format);
/**
* @param $format
*
* @return bool
*/
public function canMerge($format);

/**
* Megres array of jsons
*
* @param array $content
*
* @return string
*/
public function merge($content);
}
/**
* Megres array of jsons
*
* @param array $content
*
* @return string
*/
public function merge(array $content);
}
Loading

0 comments on commit 812a3b3

Please sign in to comment.