summaryrefslogtreecommitdiffstats
path: root/Core/Util
diff options
context:
space:
mode:
Diffstat (limited to 'Core/Util')
-rw-r--r--Core/Util/ClassUtils.php72
-rw-r--r--Core/Util/SecureRandom.php33
-rw-r--r--Core/Util/SecureRandomInterface.php31
-rw-r--r--Core/Util/StringUtils.php70
4 files changed, 0 insertions, 206 deletions
diff --git a/Core/Util/ClassUtils.php b/Core/Util/ClassUtils.php
deleted file mode 100644
index 06186ef..0000000
--- a/Core/Util/ClassUtils.php
+++ /dev/null
@@ -1,72 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Security\Core\Util;
-
-use Symfony\Component\Security\Acl\Util\ClassUtils as AclClassUtils;
-
-@trigger_error('The '.__NAMESPACE__.'\ClassUtils class is deprecated since version 2.8, to be removed in 3.0. Use Symfony\Component\Security\Acl\Util\ClassUtils instead.', E_USER_DEPRECATED);
-
-/**
- * Class related functionality for objects that
- * might or might not be proxy objects at the moment.
- *
- * @deprecated ClassUtils is deprecated since version 2.8, to be removed in 3.0. Use Acl ClassUtils instead.
- *
- * @author Benjamin Eberlei <kontakt@beberlei.de>
- * @author Johannes Schmitt <schmittjoh@gmail.com>
- */
-class ClassUtils
-{
- /**
- * Marker for Proxy class names.
- *
- * @var string
- */
- const MARKER = '__CG__';
-
- /**
- * Length of the proxy marker.
- *
- * @var int
- */
- const MARKER_LENGTH = 6;
-
- /**
- * This class should not be instantiated.
- */
- private function __construct()
- {
- }
-
- /**
- * Gets the real class name of a class name that could be a proxy.
- *
- * @param string|object $object
- *
- * @return string
- */
- public static function getRealClass($object)
- {
- if (class_exists('Symfony\Component\Security\Acl\Util\ClassUtils')) {
- return AclClassUtils::getRealClass($object);
- }
-
- // fallback in case security-acl is not installed
- $class = is_object($object) ? get_class($object) : $object;
-
- if (false === $pos = strrpos($class, '\\'.self::MARKER.'\\')) {
- return $class;
- }
-
- return substr($class, $pos + self::MARKER_LENGTH + 2);
- }
-}
diff --git a/Core/Util/SecureRandom.php b/Core/Util/SecureRandom.php
deleted file mode 100644
index 06ed893..0000000
--- a/Core/Util/SecureRandom.php
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Security\Core\Util;
-
-@trigger_error('The '.__NAMESPACE__.'\SecureRandom class is deprecated since version 2.8 and will be removed in 3.0. Use the random_bytes() function instead.', E_USER_DEPRECATED);
-
-/**
- * A secure random number generator implementation.
- *
- * @author Fabien Potencier <fabien@symfony.com>
- * @author Johannes M. Schmitt <schmittjoh@gmail.com>
- *
- * @deprecated since version 2.8, to be removed in 3.0. Use the random_bytes function instead
- */
-final class SecureRandom implements SecureRandomInterface
-{
- /**
- * {@inheritdoc}
- */
- public function nextBytes($nbBytes)
- {
- return random_bytes($nbBytes);
- }
-}
diff --git a/Core/Util/SecureRandomInterface.php b/Core/Util/SecureRandomInterface.php
deleted file mode 100644
index df5509b..0000000
--- a/Core/Util/SecureRandomInterface.php
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Security\Core\Util;
-
-/**
- * Interface that needs to be implemented by all secure random number generators.
- *
- * @author Fabien Potencier <fabien@symfony.com>
- *
- * @deprecated since version 2.8, to be removed in 3.0. Use the random_bytes function instead
- */
-interface SecureRandomInterface
-{
- /**
- * Generates the specified number of secure random bytes.
- *
- * @param int $nbBytes
- *
- * @return string
- */
- public function nextBytes($nbBytes);
-}
diff --git a/Core/Util/StringUtils.php b/Core/Util/StringUtils.php
deleted file mode 100644
index bb0c8b2..0000000
--- a/Core/Util/StringUtils.php
+++ /dev/null
@@ -1,70 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Security\Core\Util;
-
-@trigger_error('The '.__NAMESPACE__.'\\StringUtils class is deprecated since version 2.8 and will be removed in 3.0. Use hash_equals() instead.', E_USER_DEPRECATED);
-
-use Symfony\Polyfill\Util\Binary;
-
-/**
- * String utility functions.
- *
- * @author Fabien Potencier <fabien@symfony.com>
- *
- * @deprecated since 2.8, to be removed in 3.0.
- */
-class StringUtils
-{
- /**
- * This class should not be instantiated.
- */
- private function __construct()
- {
- }
-
- /**
- * Compares two strings.
- *
- * This method implements a constant-time algorithm to compare strings.
- * Regardless of the used implementation, it will leak length information.
- *
- * @param string $knownString The string of known length to compare against
- * @param string $userInput The string that the user can control
- *
- * @return bool true if the two strings are the same, false otherwise
- */
- public static function equals($knownString, $userInput)
- {
- // Avoid making unnecessary duplications of secret data
- if (!is_string($knownString)) {
- $knownString = (string) $knownString;
- }
-
- if (!is_string($userInput)) {
- $userInput = (string) $userInput;
- }
-
- return hash_equals($knownString, $userInput);
- }
-
- /**
- * Returns the number of bytes in a string.
- *
- * @param string $string The string whose length we wish to obtain
- *
- * @return int
- */
- public static function safeStrlen($string)
- {
- return Binary::strlen($string);
- }
-}