Skip to content

Commit

Permalink
Merge branch 'release/1.1.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
hueyl77 committed May 18, 2017
2 parents 25340bc + ab4d15e commit 520cb41
Show file tree
Hide file tree
Showing 13 changed files with 85 additions and 77 deletions.
6 changes: 3 additions & 3 deletions .codeclimate.yml
@@ -1,8 +1,8 @@
engines:
phpcodesniffer:
phpmd:
enabled: true
config:
standard: "PSR1,PSR2"
config:
standard: "PSR1,PSR2"

ratings:
paths:
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,8 @@
# Filestack-php Changelog

## 1.1.2 (May 18, 2017)
- Switched to using PHPMD engine for codeclimate

## 1.1.1 (May 18, 2017)
- Integrated CodeClimate

Expand Down
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
1.1.1
1.1.2
2 changes: 1 addition & 1 deletion examples/video-audio-transcoding.php
Expand Up @@ -182,4 +182,4 @@
"timestamp":"1456384626",
"uuid":"57694303a5d29c148154d5f706b4c256"
}
*/
*/
64 changes: 32 additions & 32 deletions filestack/Filelink.php
Expand Up @@ -26,7 +26,7 @@ class Filelink
* @param string $handle Filestack file handle
* @param string $api_key Filestack API Key
*/
public function __construct($handle, $api_key='', $security=null, $http_client=null)
public function __construct($handle, $api_key = '', $security = null, $http_client = null)
{
$this->handle = $handle;
$this->api_key = $api_key;
Expand Down Expand Up @@ -69,8 +69,8 @@ public function __call($method, $args)
*
* @return Filestack/Filelink
*/
public function ascii($background='white', $colored=false,
$foreground='red', $reverse=false, $size=100)
public function ascii($background = 'white', $colored = false,
$foreground='red', $reverse = false, $size = 100)
{
$options = [
'b' => $background,
Expand Down Expand Up @@ -98,7 +98,7 @@ public function ascii($background='white', $colored=false,
*
* @return Filestack/Filelink
*/
public function blackWhite($threshold=50)
public function blackWhite($threshold = 50)
{
// call TransformationMixin function
$this->setTransformUrl('blackwhite', ['t' => $threshold]);
Expand All @@ -116,7 +116,7 @@ public function blackWhite($threshold=50)
*
* @return Filestack/Filelink
*/
public function blur($amount=2)
public function blur($amount = 2)
{
// call TransformationMixin function
$this->setTransformUrl('blur', ['a' => $amount]);
Expand All @@ -141,7 +141,7 @@ public function blur($amount=2)
*
* @return Filestack/Filelink
*/
public function border($background='white', $color='black', $width=2)
public function border($background = 'white', $color = 'black', $width=2)
{
$options = [
'b' => $background,
Expand All @@ -166,7 +166,7 @@ public function border($background='white', $color='black', $width=2)
*
* @return Filestack/Filelink
*/
public function circle($background='black')
public function circle($background = 'black')
{
// call TransformationMixin function
$this->setTransformUrl('circle', ['b' => $background]);
Expand Down Expand Up @@ -203,7 +203,7 @@ public function circle($background='black')
* @return Filestack/Filelink
*/
public function collage($files, $width, $height,
$color='white', $fit='auto', $margin=10, $auto_rotate=false)
$color = 'white', $fit = 'auto', $margin = 10, $auto_rotate = false)
{
$options = [
'f' => json_encode($files),
Expand Down Expand Up @@ -234,7 +234,7 @@ public function collage($files, $width, $height,
*
* @return Filestack/Filelink
*/
public function compress($metadata=false)
public function compress($metadata = false)
{
// call TransformationMixin function
$this->setTransformUrl('compress', ['m' => $metadata]);
Expand Down Expand Up @@ -304,7 +304,7 @@ public function compress($metadata=false)
*
* @return string (uuid of conversion task)
*/
public function convertAudio($format, $options=[])
public function convertAudio($format, $options = [])
{
$transform_tasks = [
'video_convert' => $options
Expand Down Expand Up @@ -387,7 +387,7 @@ public function convertAudio($format, $options=[])
*
* @return Filestack/Filelink
*/
public function convertFile($filetype, $options=[])
public function convertFile($filetype, $options = [])
{
$transform_tasks = [
'output' => $options
Expand Down Expand Up @@ -509,7 +509,7 @@ public function convertFile($filetype, $options=[])
*
* @return string (uuid of conversion task)
*/
public function convertVideo($format, $options=[])
public function convertVideo($format, $options = [])
{
$transform_tasks = [
'video_convert' => $options
Expand Down Expand Up @@ -576,7 +576,7 @@ public function debug()
*
* @return Filestack/Filelink
*/
public function detectFaces($color='dimgray', $export=false, $min_size=0.35, $max_size=0.35)
public function detectFaces($color='dimgray', $export = false, $min_size = 0.35, $max_size = 0.35)
{
$options = [
'c' => $color,
Expand Down Expand Up @@ -621,7 +621,7 @@ public function enhance()
*
* @return Filestack/Filelink
*/
public function modulate($brightness=100, $hue=0, $saturation=100)
public function modulate($brightness = 100, $hue = 0, $saturation = 100)
{
$options = [
'b' => $brightness,
Expand Down Expand Up @@ -675,7 +675,7 @@ public function negative()
*
* @return Filestack/Filelink
*/
public function oilPaint($amount=2)
public function oilPaint($amount = 2)
{
// call TransformationMixin function
$this->setTransformUrl('oil_paint', ['a' => $amount]);
Expand Down Expand Up @@ -705,7 +705,7 @@ public function oilPaint($amount=2)
*
* @return Filestack/Filelink
*/
public function partialBlur($amount=10, $blur=4, $objects=[], $type='rect')
public function partialBlur($amount = 10, $blur = 4, $objects = [], $type = 'rect')
{
$options = [
'a' => $amount,
Expand Down Expand Up @@ -742,7 +742,7 @@ public function partialBlur($amount=10, $blur=4, $objects=[], $type='rect')
*
* @return Filestack/Filelink
*/
public function partialPixelate($amount=10, $blur=4, $objects=[], $type='rect')
public function partialPixelate($amount = 10, $blur = 4, $objects = [], $type = 'rect')
{

// call TransformationMixin function
Expand All @@ -761,7 +761,7 @@ public function partialPixelate($amount=10, $blur=4, $objects=[], $type='rect')
*
* @return Filestack/Filelink
*/
public function pixelate($amount=2)
public function pixelate($amount = 2)
{
// call TransformationMixin function
$this->setTransformUrl('pixelate', ['a' => $amount]);
Expand All @@ -784,7 +784,7 @@ public function pixelate($amount=2)
*
* @return Filestack/Filelink
*/
public function polaroid($background='white', $color='snow', $rotate=45)
public function polaroid($background = 'white', $color = 'snow', $rotate = 45)
{
$options = [
'b' => $background,
Expand Down Expand Up @@ -871,7 +871,7 @@ public function redEye()
*
* @return Filestack/Filelink
*/
public function resize($width, $height, $fit='clip', $align='center')
public function resize($width, $height, $fit = 'clip', $align = 'center')
{
$options = [
'w' => $width,
Expand Down Expand Up @@ -901,7 +901,7 @@ public function resize($width, $height, $fit='clip', $align='center')
*
* @return Filestack/Filelink
*/
public function roundedCorners($background='white', $blur=0.3, $radius=10)
public function roundedCorners($background = 'white', $blur = 0.3, $radius = 10)
{
$options = [
'b' => $background,
Expand Down Expand Up @@ -938,7 +938,7 @@ public function roundedCorners($background='white', $blur=0.3, $radius=10)
*
* @return Filestack/Filelink
*/
public function rotate($background='white', $deg=0, $exif=false)
public function rotate($background = 'white', $deg = 0, $exif = false)
{
$options = [
'b' => $background,
Expand All @@ -962,7 +962,7 @@ public function rotate($background='white', $deg=0, $exif=false)
*
* @return Filestack/Filelink
*/
public function sepia($tone=80)
public function sepia($tone = 80)
{
// call TransformationMixin function
$this->setTransformUrl('sepia', ['t' => $tone]);
Expand All @@ -980,7 +980,7 @@ public function sepia($tone=80)
*
* @return Filestack/Filelink
*/
public function sharpen($amount=2)
public function sharpen($amount = 2)
{
// call TransformationMixin function
$this->setTransformUrl('sharpen', ['a' => $amount]);
Expand Down Expand Up @@ -1008,7 +1008,7 @@ public function sharpen($amount=2)
*
* @return Filestack/Filelink
*/
public function shadow($background='white', $blur=4, $opacity=60, $vector=[4,4])
public function shadow($background = 'white', $blur = 4, $opacity = 60, $vector = [4,4])
{
$options = [
'b' => $background,
Expand Down Expand Up @@ -1037,7 +1037,7 @@ public function shadow($background='white', $blur=4, $opacity=60, $vector=[4,4])
*
* @return Filestack/Filelink
*/
public function tornEdges($background='white', $spread=[1,10])
public function tornEdges($background = 'white', $spread = [1,10])
{
$options = [
'b' => $background,
Expand Down Expand Up @@ -1075,7 +1075,7 @@ public function tornEdges($background='white', $spread=[1,10])
*
* @return Filestack/Filelink
*/
public function upscale($noise='none', $style='photo', $upscale=true)
public function upscale($noise = 'none', $style = 'photo', $upscale = true)
{
$options = [
'n' => $noise,
Expand Down Expand Up @@ -1109,7 +1109,7 @@ public function upscale($noise='none', $style='photo', $upscale=true)
*
* @return Filestack/Filelink
*/
public function vignette($amount=20, $background='white', $blurmode='gaussian')
public function vignette($amount = 20, $background = 'white', $blurmode = 'gaussian')
{
$options = [
'a' => $amount,
Expand Down Expand Up @@ -1141,7 +1141,7 @@ public function vignette($amount=20, $background='white', $blurmode='gaussian')
*
* @return Filestack/Filelink
*/
public function watermark($file_handle, $position='center', $size=100)
public function watermark($file_handle, $position = 'center', $size = 100)
{
$options = [
'f' => $file_handle,
Expand Down Expand Up @@ -1183,7 +1183,7 @@ public function getContent()
*
* @return array
*/
public function getMetaData($fields=[])
public function getMetaData($fields = [])
{
// call CommonMixin function
$result = $this->sendGetMetaData($this->url(), $fields, $this->security);
Expand Down Expand Up @@ -1268,7 +1268,7 @@ public function resetTransform()
*
* @return Filestack\Filelink
*/
public function save($options=[])
public function save($options = [])
{
$this->initTransformUrl();
$this->transform_url = $this->insertTransformStr($this->transform_url, 'store', $options);
Expand All @@ -1289,7 +1289,7 @@ public function save($options=[])
*
* @return void
*/
public function setTransformUrl($method, $options=[])
public function setTransformUrl($method, $options = [])
{
$this->initTransformUrl();
$this->transform_url = $this->insertTransformStr($this->transform_url, $method, $options);
Expand Down
22 changes: 11 additions & 11 deletions filestack/FilestackClient.php
Expand Up @@ -26,7 +26,7 @@ class FilestackClient
* @param GuzzleHttp\Client $http_client DI http client, will instantiate
* one if not passed in
*/
public function __construct($api_key, $security=null, $http_client=null)
public function __construct($api_key, $security = null, $http_client = null)
{
$this->api_key = $api_key;
$this->security = $security;
Expand Down Expand Up @@ -95,7 +95,7 @@ public function getContent($url)
*
* @return array
*/
public function getMetaData($url, $fields=[])
public function getMetaData($url, $fields = [])
{
if (!$this->isUrl($url)) { // CommonMixin
$url = $this->getCdnUrl($url);
Expand Down Expand Up @@ -135,8 +135,8 @@ public function getMetaData($url, $fields=[])
*
* @return Filestack/Filelink or contents
*/
public function collage($sources, $width, $height, $store_options=[],
$color='white', $fit='auto', $margin=10, $auto_rotate=false)
public function collage($sources, $width, $height, $store_options = [],
$color = 'white', $fit = 'auto', $margin = 10, $auto_rotate = false)
{

// slice off first source as the filelink
Expand Down Expand Up @@ -229,7 +229,7 @@ public function collage($sources, $width, $height, $store_options=[],
*
* @return string (uuid of conversion task)
*/
public function convertAudio($resource, $format, $options=[])
public function convertAudio($resource, $format, $options = [])
{
$transform_tasks = [
'video_convert' => $options
Expand Down Expand Up @@ -313,7 +313,7 @@ public function convertAudio($resource, $format, $options=[])
*
* @return Filestack/Filelink
*/
public function convertFile($resource, $filetype, $options=[])
public function convertFile($resource, $filetype, $options = [])
{
$transform_tasks = [
'output' => $options
Expand Down Expand Up @@ -436,7 +436,7 @@ public function convertFile($resource, $filetype, $options=[])
*
* @return string (uuid of conversion task)
*/
public function convertVideo($resource, $format, $options=[])
public function convertVideo($resource, $format, $options = [])
{
$transform_tasks = [
'video_convert' => $options
Expand Down Expand Up @@ -556,8 +556,8 @@ public function overwrite($filepath, $handle)
*
* @return Filestack/Filelink
*/
public function screenshot($url, $store_options=[],
$agent='desktop', $mode='all', $width=1024, $height=768, $delay=0)
public function screenshot($url, $store_options = [],
$agent = 'desktop', $mode = 'all', $width = 1024, $height = 768, $delay = 0)
{
$process_attrs = [
'a' => $agent,
Expand Down Expand Up @@ -619,7 +619,7 @@ public function transform($url, $transform_tasks)
*
* @return Filestack\Filelink
*/
public function upload($filepath, $options=[])
public function upload($filepath, $options = [])
{
// set filename to original file if one does not exists
if (!array_key_exists('filename', $options)) {
Expand Down Expand Up @@ -649,7 +649,7 @@ public function upload($filepath, $options=[])
*
* @return Filestack/Filelink or file content
*/
public function zip($sources, $store_options=[])
public function zip($sources, $store_options = [])
{
$transform_tasks = [
'zip' => []
Expand Down

0 comments on commit 520cb41

Please sign in to comment.