Skip to content

Commit

Permalink
Declared visibility of methods where it was missing, fixing a couple …
Browse files Browse the repository at this point in the history
…of DocBlocks
  • Loading branch information
micheleangioni committed Jan 14, 2017
1 parent 8142618 commit 395c762
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public function findOrFail($id, array $with = [])
*
* @return string
*/
function getKey($id = false, array $array = [])
public function getKey($id = false, array $array = [])
{
return $this->keyManager->getKey($id, $array, $this->section, $this->modelClass);
}
Expand All @@ -164,7 +164,7 @@ function getKey($id = false, array $array = [])
*
* @return array
*/
function getTags($id = false, array $array = [])
public function getTags($id = false, array $array = [])
{
return $this->keyManager->getTags($id, $array, $this->section, $this->modelClass);
}
Expand All @@ -178,7 +178,7 @@ function getTags($id = false, array $array = [])
*
* @return string
*/
function getCustomMethodKey($customName = false, $id = false, array $array = [])
public function getCustomMethodKey($customName = false, $id = false, array $array = [])
{
return $this->keyManager->getCustomMethodKey($customName, $id, $array, $this->section, $this->modelClass);
}
Expand All @@ -192,7 +192,7 @@ function getCustomMethodKey($customName = false, $id = false, array $array = [])
*
* @return array
*/
function getCustomMethodTags($customName = false, $id = false, array $array = [])
public function getCustomMethodTags($customName = false, $id = false, array $array = [])
{
return $this->keyManager->getCustomMethodTags($customName, $id, $array, $this->section, $this->modelClass);
}
Expand Down
8 changes: 4 additions & 4 deletions src/MicheleAngioni/Support/Cache/KeyManagerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface KeyManagerInterface
*
* @return string
*/
function getKey($id = false, array $array = [], $section, $modelClass = __CLASS__);
public function getKey($id = false, array $array = [], $section, $modelClass = __CLASS__);

/**
* Return Cache tags generated by using the current active class, id and with array
Expand All @@ -25,7 +25,7 @@ function getKey($id = false, array $array = [], $section, $modelClass = __CLASS_
*
* @return array
*/
function getTags($id = false, array $array = [], $section, $modelClass = __CLASS__);
public function getTags($id = false, array $array = [], $section, $modelClass = __CLASS__);

/**
* Return a method-customized Cache key generated by using the current active class, id and $with array
Expand All @@ -39,7 +39,7 @@ function getTags($id = false, array $array = [], $section, $modelClass = __CLASS
*
* @return string
*/
function getCustomMethodKey($customName = false, $id = false, array $array = [], $section, $modelClass = __CLASS__);
public function getCustomMethodKey($customName = false, $id = false, array $array = [], $section, $modelClass = __CLASS__);

/**
* Return Cache tags generated by using the current active class, id and with array.
Expand All @@ -54,7 +54,7 @@ function getCustomMethodKey($customName = false, $id = false, array $array = [],
*
* @return array
*/
function getCustomMethodTags(
public function getCustomMethodTags(
$customName = false,
$id = false,
array $array = [],
Expand Down
32 changes: 16 additions & 16 deletions src/MicheleAngioni/Support/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Helpers
*
* @return bool
*/
static function isInt($int, $min = false, $max = false)
static public function isInt($int, $min = false, $max = false)
{
if (is_object($int) || is_array($int)) {
return false;
Expand Down Expand Up @@ -55,7 +55,7 @@ static function isInt($int, $min = false, $max = false)
*
* @return mixed
*/
static function randInArray(array $array)
static public function randInArray(array $array)
{
return $array[mt_rand(0, count($array) - 1)];
}
Expand All @@ -68,7 +68,7 @@ static function randInArray(array $array)
*
* @return bool
*/
static function checkDate($date, $format = 'Y-m-d')
static public function checkDate($date, $format = 'Y-m-d')
{
$d = DateTime::createFromFormat($format, $date);

Expand All @@ -82,7 +82,7 @@ static function checkDate($date, $format = 'Y-m-d')
*
* @return bool
*/
static function checkDatetime($datetime)
static public function checkDatetime($datetime)
{
$format = 'Y-m-d H:i:s';

Expand All @@ -100,9 +100,9 @@ static function checkDatetime($datetime)
* @param string $secondDate
* @param int $maxDifference = 0
*
* @return array
* @return array|false
*/
static function splitDates($firstDate, $secondDate, $maxDifference = 0)
static public function splitDates($firstDate, $secondDate, $maxDifference = 0)
{
if (!self::checkDate($firstDate) || !self::checkDate($secondDate)) {
return false;
Expand Down Expand Up @@ -151,7 +151,7 @@ static function splitDates($firstDate, $secondDate, $maxDifference = 0)
*
* @return int
*/
static function daysBetweenDates($date1, $date2)
static public function daysBetweenDates($date1, $date2)
{
// If input dates have datetime 'Y-m-d X' format, take only the date part
list($d1) = array_pad(explode(' ', $date1), 1, 0);
Expand All @@ -176,7 +176,7 @@ static function daysBetweenDates($date1, $date2)
*
* @return bool
*/
static function compareDates($date, $referenceDate)
static public function compareDates($date, $referenceDate)
{
$dateTimestamp = strtotime($date);
$referenceDateTimestamp = strtotime($referenceDate);
Expand All @@ -196,9 +196,9 @@ static function compareDates($date, $referenceDate)
*
* @throws InvalidArgumentException
*
* @return array
* @return Collection|false
*/
static function divideCollectionIntoGroups(Collection $collection, $groupsNumber = 2)
static public function divideCollectionIntoGroups(Collection $collection, $groupsNumber = 2)
{
if (!(Helpers::isInt($groupsNumber, 2) && !($groupsNumber % 2))) {
return false;
Expand Down Expand Up @@ -227,7 +227,7 @@ static function divideCollectionIntoGroups(Collection $collection, $groupsNumber
*
* @return string
*/
function getTodayDay()
public function getTodayDay()
{
$datetime = new \DateTime("now");

Expand All @@ -243,7 +243,7 @@ function getTodayDay()
*
* @return string
*/
function getDate($offset = 0, $format = 'Y-m-d')
public function getDate($offset = 0, $format = 'Y-m-d')
{
return date($format, strtotime($offset . ' day'));
}
Expand All @@ -257,7 +257,7 @@ function getDate($offset = 0, $format = 'Y-m-d')
*
* @return string
*/
function getTime($offset = 0, $format = 'H:i:s')
public function getTime($offset = 0, $format = 'H:i:s')
{
return date($format, strtotime($offset . ' minutes'));
}
Expand All @@ -275,7 +275,7 @@ function getTime($offset = 0, $format = 'H:i:s')
*
* @return int
*/
static function getRandomValueUrandom($min = 0, $max = 0x7FFFFFFF)
static public function getRandomValueUrandom($min = 0, $max = 0x7FFFFFFF)
{
if (!self::isInt($min) || !self::isInt($max) || $max < $min || ($max - $min) > 0x7FFFFFFF) {
return false;
Expand Down Expand Up @@ -304,9 +304,9 @@ static function getRandomValueUrandom($min = 0, $max = 0x7FFFFFFF)
* @param int $max
* @param int $quantity = 1
*
* @return array
* @return array|false
*/
function getUniqueRandomValues($min = 0, $max, $quantity = 1)
public function getUniqueRandomValues($min = 0, $max, $quantity = 1)
{
if (!self::isInt($min) || !self::isInt($max) || !self::isInt($quantity) || $quantity < 1) {
return false;
Expand Down

0 comments on commit 395c762

Please sign in to comment.