Skip to content

Commit

Permalink
Merge pull request #398 from josegonzalez/fix-phpcs-violations
Browse files Browse the repository at this point in the history
Fix phpcs violations
  • Loading branch information
josegonzalez authored Jul 23, 2016
2 parents 95f310f + 07a9c14 commit 389a36e
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/File/Path/Basepath/DefaultTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public function basepath()
'{microtime}' => microtime(),
'{DS}' => DIRECTORY_SEPARATOR,
];

return str_replace(
array_keys($replacements),
array_values($replacements),
Expand Down
1 change: 1 addition & 0 deletions src/File/Path/Filename/DefaultTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public function filename()
if (is_callable($processor)) {
return $processor($this->data, $this->settings);
}

return $this->data['name'];
}
}
1 change: 1 addition & 0 deletions src/File/Writer/DefaultWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ public function writeFile(FilesystemInterface $filesystem, $file, $path)
}
$this->deletePath($filesystem, $tempPath);
fclose($stream);

return $success;
}

Expand Down
1 change: 1 addition & 0 deletions src/Model/Behavior/UploadBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ public function constructFiles(Entity $entity, $data, $field, $settings, $basepa
$transformerClass
));
}

return $results;
}
}
4 changes: 4 additions & 0 deletions src/Validation/Traits/ImageValidationTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public static function isAboveMinWidth($check, $width)
return false;
}
list($imgWidth) = getimagesize($check['tmp_name']);

return $width > 0 && $imgWidth >= $width;
}

Expand All @@ -35,6 +36,7 @@ public static function isBelowMaxWidth($check, $width)
return false;
}
list($imgWidth) = getimagesize($check['tmp_name']);

return $width > 0 && $imgWidth <= $width;
}

Expand All @@ -52,6 +54,7 @@ public static function isAboveMinHeight($check, $height)
return false;
}
list(, $imgHeight) = getimagesize($check['tmp_name']);

return $height > 0 && $imgHeight >= $height;
}

Expand All @@ -69,6 +72,7 @@ public static function isBelowMaxHeight($check, $height)
return false;
}
list(, $imgHeight) = getimagesize($check['tmp_name']);

return $height > 0 && $imgHeight <= $height;
}
}
2 changes: 2 additions & 0 deletions src/Validation/Traits/UploadValidationTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public static function isAboveMinSize($check, $size)
if (!isset($check['size']) || !strlen($check['size'])) {
return false;
}

return $check['size'] >= $size;
}

Expand All @@ -92,6 +93,7 @@ public static function isBelowMaxSize($check, $size)
if (!isset($check['size']) || !strlen($check['size'])) {
return false;
}

return $check['size'] <= $size;
}
}

0 comments on commit 389a36e

Please sign in to comment.