Removed unnecessary self::dependencies checks

This commit is contained in:
Tobias Reich 2016-01-30 01:06:21 +01:00
parent 4974adfed0
commit cafcc2165f
3 changed files with 4 additions and 34 deletions

View File

@ -43,15 +43,12 @@ final class Album extends Module {
} }
public static function prepareData($data) { public static function prepareData(array $data) {
# This function requires the following album-attributes and turns them # This function requires the following album-attributes and turns them
# into a front-end friendly format: id, title, public, sysstamp, password # into a front-end friendly format: id, title, public, sysstamp, password
# Note that some attributes remain unchanged # Note that some attributes remain unchanged
# Check dependencies
self::dependencies(isset($data));
# Init # Init
$album = null; $album = null;

View File

@ -28,14 +28,11 @@ final class Photo extends Module {
} }
public function add($files, $albumID = 0, $description = '', $tags = '', $returnOnError = false) { public function add(array $files, $albumID = 0, $description = '', $tags = '', $returnOnError = false) {
# Use $returnOnError if you want to handle errors by your own # Use $returnOnError if you want to handle errors by your own
# e.g. when calling this functions inside an if-condition # e.g. when calling this functions inside an if-condition
# Check dependencies
self::dependencies(isset($files));
# Check permissions # Check permissions
if (hasPermissions(LYCHEE_UPLOADS)===false|| if (hasPermissions(LYCHEE_UPLOADS)===false||
hasPermissions(LYCHEE_UPLOADS_BIG)===false|| hasPermissions(LYCHEE_UPLOADS_BIG)===false||
@ -255,9 +252,6 @@ final class Photo extends Module {
private function exists($checksum, $photoID = null) { private function exists($checksum, $photoID = null) {
# Check dependencies
self::dependencies(isset($checksum));
# Exclude $photoID from select when $photoID is set # Exclude $photoID from select when $photoID is set
if (isset($photoID)) $query = Database::prepare(Database::get(), "SELECT id, url, thumbUrl, medium FROM ? WHERE checksum = '?' AND id <> '?' LIMIT 1", array(LYCHEE_TABLE_PHOTOS, $checksum, $photoID)); if (isset($photoID)) $query = Database::prepare(Database::get(), "SELECT id, url, thumbUrl, medium FROM ? WHERE checksum = '?' AND id <> '?' LIMIT 1", array(LYCHEE_TABLE_PHOTOS, $checksum, $photoID));
else $query = Database::prepare(Database::get(), "SELECT id, url, thumbUrl, medium FROM ? WHERE checksum = '?' LIMIT 1", array(LYCHEE_TABLE_PHOTOS, $checksum)); else $query = Database::prepare(Database::get(), "SELECT id, url, thumbUrl, medium FROM ? WHERE checksum = '?' LIMIT 1", array(LYCHEE_TABLE_PHOTOS, $checksum));
@ -290,9 +284,6 @@ final class Photo extends Module {
private function createThumb($url, $filename, $type, $width, $height) { private function createThumb($url, $filename, $type, $width, $height) {
# Check dependencies
self::dependencies(isset($url, $filename, $type, $width, $height));
# Call plugins # Call plugins
Plugins::get()->activate(__METHOD__, 0, func_get_args()); Plugins::get()->activate(__METHOD__, 0, func_get_args());
@ -389,9 +380,6 @@ final class Photo extends Module {
# (boolean) true = Success # (boolean) true = Success
# (boolean) false = Failure # (boolean) false = Failure
# Check dependencies
self::dependencies(isset($url, $filename, $width, $height));
# Call plugins # Call plugins
Plugins::get()->activate(__METHOD__, 0, func_get_args()); Plugins::get()->activate(__METHOD__, 0, func_get_args());
@ -457,7 +445,7 @@ final class Photo extends Module {
} }
public function adjustFile($path, $info) { public function adjustFile($path, array $info) {
# Function rotates and flips a photo based on its EXIF orientation # Function rotates and flips a photo based on its EXIF orientation
# Excepts the following: # Excepts the following:
@ -467,9 +455,6 @@ final class Photo extends Module {
# (array) $info = ['orientation', 'width', 'height'] = Success # (array) $info = ['orientation', 'width', 'height'] = Success
# (boolean) false = Failure # (boolean) false = Failure
# Check dependencies
self::dependencies(isset($path, $info));
# Call plugins # Call plugins
Plugins::get()->activate(__METHOD__, 0, func_get_args()); Plugins::get()->activate(__METHOD__, 0, func_get_args());
@ -591,7 +576,7 @@ final class Photo extends Module {
} }
public static function prepareData($data) { public static function prepareData(array $data) {
# Function turns photo-attributes into a front-end friendly format. Note that some attributes remain unchanged. # Function turns photo-attributes into a front-end friendly format. Note that some attributes remain unchanged.
# Excepts the following: # Excepts the following:
@ -599,9 +584,6 @@ final class Photo extends Module {
# Returns the following: # Returns the following:
# (array) $photo # (array) $photo
# Check dependencies
self::dependencies(isset($data));
# Init # Init
$photo = null; $photo = null;
@ -703,9 +685,6 @@ final class Photo extends Module {
# Returns the following: # Returns the following:
# (array) $return # (array) $return
# Check dependencies
self::dependencies(isset($url));
# Call plugins # Call plugins
Plugins::get()->activate(__METHOD__, 0, func_get_args()); Plugins::get()->activate(__METHOD__, 0, func_get_args());

View File

@ -6,9 +6,6 @@ final class Session extends Module {
public function init($public) { public function init($public) {
# Check dependencies
self::dependencies(isset($public));
# Call plugins # Call plugins
Plugins::get()->activate(__METHOD__, 0, func_get_args()); Plugins::get()->activate(__METHOD__, 0, func_get_args());
@ -65,9 +62,6 @@ final class Session extends Module {
public function login($username, $password) { public function login($username, $password) {
# Check dependencies
self::dependencies(isset($username, $password));
# Call plugins # Call plugins
Plugins::get()->activate(__METHOD__, 0, func_get_args()); Plugins::get()->activate(__METHOD__, 0, func_get_args());