mirror of
https://github.com/wiosna-dev/common-library.git
synced 2026-03-12 09:31:51 +01:00
Update PHPDoc and comments
This commit is contained in:
@@ -530,6 +530,10 @@ class Arrays
|
||||
*/
|
||||
public static function removeElement(array $array, $item)
|
||||
{
|
||||
/*
|
||||
* No elements or the element does not exist?
|
||||
* Nothing to do
|
||||
*/
|
||||
if (empty($array) || !in_array($item, $array)) {
|
||||
return false;
|
||||
}
|
||||
@@ -626,6 +630,10 @@ class Arrays
|
||||
*/
|
||||
public static function setKeysAsValues(array $array, $ignoreDuplicatedValues = true)
|
||||
{
|
||||
/*
|
||||
* No elements?
|
||||
* Nothing to do
|
||||
*/
|
||||
if (empty($array)) {
|
||||
return [];
|
||||
}
|
||||
@@ -1083,6 +1091,10 @@ class Arrays
|
||||
*/
|
||||
public static function getAllValuesOfKey(array $array, $key)
|
||||
{
|
||||
/*
|
||||
* No elements?
|
||||
* Nothing to do
|
||||
*/
|
||||
if (empty($array)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ class Bundle
|
||||
*
|
||||
* @param string $viewPath Path of the view / template, e.g. "MyDirectory/my-template"
|
||||
* @param string $bundleName Full name of the bundle, e.g. "MyExtraBundle"
|
||||
* @param string $extension (optional) Extension of the view / template
|
||||
* @param string $extension (optional) Extension of the view / template (default: "html.twig")
|
||||
* @return string|null
|
||||
*
|
||||
* @throws IncorrectBundleNameException
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
namespace Meritoo\Common\Utilities;
|
||||
|
||||
use Gedmo\Sluggable\Util\Urlizer;
|
||||
use Meritoo\Common\Exception\Regex\IncorrectColorHexLengthException;
|
||||
use Meritoo\Common\Exception\Regex\InvalidColorHexValueException;
|
||||
use Symfony\Component\HttpFoundation\Cookie;
|
||||
use Transliterator;
|
||||
|
||||
@@ -1433,6 +1435,9 @@ class Miscellaneous
|
||||
*
|
||||
* @param string $color Hexadecimal value of color to invert (with or without hash), e.g. "dd244c" or "#22a5fe"
|
||||
* @return string
|
||||
*
|
||||
* @throws IncorrectColorHexLengthException
|
||||
* @throws InvalidColorHexValueException
|
||||
*/
|
||||
public static function getInvertedColor($color)
|
||||
{
|
||||
|
||||
@@ -35,6 +35,8 @@ class Reflection
|
||||
* @param bool $withoutInheritance (optional) If is set to true, only methods for given class are returned.
|
||||
* Otherwise - all methods, with inherited methods too.
|
||||
* @return array
|
||||
*
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
public static function getMethods($class, $withoutInheritance = false)
|
||||
{
|
||||
@@ -65,6 +67,8 @@ class Reflection
|
||||
*
|
||||
* @param object|string $class The object or name of object's class
|
||||
* @return array
|
||||
*
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
public static function getConstants($class)
|
||||
{
|
||||
@@ -79,6 +83,8 @@ class Reflection
|
||||
*
|
||||
* @param object|string $class The object or name of object's class
|
||||
* @return int|null
|
||||
*
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
public static function getMaxNumberConstant($class)
|
||||
{
|
||||
@@ -105,6 +111,8 @@ class Reflection
|
||||
* @param object|string $class The object or name of object's class
|
||||
* @param string $method Name of the method to find
|
||||
* @return bool
|
||||
*
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
public static function hasMethod($class, $method)
|
||||
{
|
||||
@@ -119,6 +127,8 @@ class Reflection
|
||||
* @param object|string $class The object or name of object's class
|
||||
* @param string $property Name of the property to find
|
||||
* @return bool
|
||||
*
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
public static function hasProperty($class, $property)
|
||||
{
|
||||
@@ -133,6 +143,8 @@ class Reflection
|
||||
* @param object|string $class The object or name of object's class
|
||||
* @param string $constant Name of the constant to find
|
||||
* @return bool
|
||||
*
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
public static function hasConstant($class, $constant)
|
||||
{
|
||||
@@ -147,6 +159,8 @@ class Reflection
|
||||
* @param object|string $class The object or name of object's class
|
||||
* @param string $constant Name of the constant that contains a value
|
||||
* @return mixed
|
||||
*
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
public static function getConstantValue($class, $constant)
|
||||
{
|
||||
@@ -169,6 +183,8 @@ class Reflection
|
||||
* @param bool $force (optional) If is set to true, try to retrieve value even if the object doesn't have
|
||||
* property. Otherwise - not.
|
||||
* @return mixed
|
||||
*
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
public static function getPropertyValue($object, $property, $force = false)
|
||||
{
|
||||
@@ -285,6 +301,8 @@ class Reflection
|
||||
* @param bool $force (optional) If is set to true, try to retrieve value even if the
|
||||
* object does not have property. Otherwise - not.
|
||||
* @return array
|
||||
*
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
public static function getPropertyValues($objects, $property, $force = false)
|
||||
{
|
||||
@@ -444,6 +462,8 @@ class Reflection
|
||||
* @param bool $includeParents (optional) If is set to true, properties of parent classes are
|
||||
* included (recursively). Otherwise - not.
|
||||
* @return array|ReflectionProperty
|
||||
*
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
public static function getProperties($source, $filter = null, $includeParents = false)
|
||||
{
|
||||
@@ -477,6 +497,8 @@ class Reflection
|
||||
*
|
||||
* @param array|object|string $source An array of objects, namespaces, object or namespace
|
||||
* @return ReflectionClass|bool
|
||||
*
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
public static function getParentClass($source)
|
||||
{
|
||||
@@ -549,6 +571,7 @@ class Reflection
|
||||
* namespaces, object or namespace.
|
||||
* @return mixed
|
||||
*
|
||||
* @throws CannotResolveClassNameException
|
||||
* @throws MissingChildClassesException
|
||||
* @throws TooManyChildClassesException
|
||||
*/
|
||||
@@ -583,6 +606,8 @@ class Reflection
|
||||
* @param int $filter (optional) Filter of properties. Uses ReflectionProperty class constants.
|
||||
* By default all properties are allowed / processed.
|
||||
* @return null|ReflectionProperty
|
||||
*
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
public static function getProperty($class, $property, $filter = null)
|
||||
{
|
||||
@@ -609,7 +634,9 @@ class Reflection
|
||||
* @param bool $verifyParents If is set to true, parent classes are verified if they use given
|
||||
* trait. Otherwise - not.
|
||||
* @return bool|null
|
||||
*
|
||||
* @throws CannotResolveClassNameException
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
public static function usesTrait($class, $trait, $verifyParents = false)
|
||||
{
|
||||
@@ -652,6 +679,8 @@ class Reflection
|
||||
*
|
||||
* @param array|object|string $class An array of objects, namespaces, object or namespace
|
||||
* @return string|null
|
||||
*
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
public static function getParentClassName($class)
|
||||
{
|
||||
|
||||
@@ -730,6 +730,10 @@ class Regex
|
||||
*/
|
||||
public static function isValidMoneyValue($value)
|
||||
{
|
||||
/*
|
||||
* Not a scalar value?
|
||||
* Nothing to do
|
||||
*/
|
||||
if (!is_scalar($value)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user