Missing use statement should be avoided 4

More information: https://insight.symfony.com/what-we-analyse/php.missing_use_statement

  1. }
  2. if ($this->isPublic()) {
  3. return parent::getValue($object);
  4. }
  5. if ($this->isPrivate()) {
  6. throw new Exception('Cannot return value of private property "' . $this->name . '.', 1210859206);

    The Exception class resolves to the following classes: PHPUnit\Exception or PHPUnit\Framework\Constraint\Exception or PHPUnit\Framework\Exception or PHPUnit\Framework\MockObject\Exception or PHPUnit\Framework\MockObject\Stub\Exception or PHPUnit\Runner\Exception or PharIo\Manifest\Exception or PharIo\Version\Exception or Prophecy\Exception\Exception or Romm\ConfigurationObject\Exceptions\Exception or SebastianBergmann\CodeCoverage\Exception or SebastianBergmann\Diff\Exception or SebastianBergmann\GlobalState\Exception or SebastianBergmann\ObjectEnumerator\Exception or SebastianBergmann\ObjectReflector\Exception or SebastianBergmann\RecursionContext\Exception or SebastianBergmann\Timer\Exception or Symfony\Component\Config\Definition\Exception\Exception or TYPO3Fluid\Fluid\Core\Exception or TYPO3Fluid\Fluid\Core\Parser\Exception or TYPO3Fluid\Fluid\Core\ViewHelper\Exception or TYPO3Fluid\Fluid\Exception or TYPO3Fluid\Fluid\View\Exception or TYPO3\CMS\Backend\Exception or TYPO3\CMS\Backend\Form\Exception or TYPO3\CMS\Beuser\Exception or TYPO3\CMS\Core\Cache\Exception or TYPO3\CMS\Core\Error\Exception or TYPO3\CMS\Core\Exception or TYPO3\CMS\Core\FormProtection\Exception or TYPO3\CMS\Core\Locking\Exception or TYPO3\CMS\Core\Log\Exception or TYPO3\CMS\Core\Package\Exception or TYPO3\CMS\Core\Resource\Exception or TYPO3\CMS\Core\Type\Exception or TYPO3\CMS\Extbase\Configuration\Exception or TYPO3\CMS\Extbase\Exception or TYPO3\CMS\Extbase\Mvc\Exception or TYPO3\CMS\Extbase\Object\Exception or TYPO3\CMS\Extbase\Persistence\Exception or TYPO3\CMS\Extbase\Persistence\Generic\Exception or TYPO3\CMS\Extbase\Property\Exception or TYPO3\CMS\Extbase\Reflection\Exception or TYPO3\CMS\Extbase\Security\Exception or TYPO3\CMS\Extbase\Validation\Exception or TYPO3\CMS\Fluid\Core\Widget\Exception or TYPO3\CMS\Frontend\Exception or TYPO3\PharStreamWrapper\Exception or TYPO3\TestingFramework\Core\Exception or TheSeer\Tokenizer\Exception.
    Did you forget to add a corresponding use statement for one of them?

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Romain Canon
  7. }
  8. parent::setAccessible(true);
  9. return parent::getValue($object);
  10. }
  1. foreach ($methodParameters as $parameterName => $methodParameter) {
  2. /** @var ConjunctionValidator $validatorConjunction */
  3. $validatorConjunction = $this->createValidator(ConjunctionValidator::class);
  4. if (!array_key_exists('type', $methodParameter)) {
  5. throw new Exception\InvalidTypeHintException('Missing type information, probably no @param annotation for parameter "$' . $parameterName . '" in ' . $className . '->' . $methodName . '()', 1281962564);

    The Exception\InvalidTypeHintException class resolves to the Romm\ConfigurationObject\Legacy\Validation\Exception\InvalidTypeHintException class which PHP does not seem to be able to autoload.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Romain Canon
  6. }
  7. // @todo: remove check for old underscore model name syntax once it's possible
  8. if (strpbrk($methodParameter['type'], '_\\') === false) {
  9. $typeValidator = $this->createValidator($methodParameter['type']);
  1. } elseif (strpos($annotationParameters['argumentName'], '.') !== false) {
  2. $objectPath = explode('.', $annotationParameters['argumentName']);
  3. $argumentName = array_shift($objectPath);
  4. $validatorConjunctions[$argumentName]->addValidator($this->buildSubObjectValidator($objectPath, $newValidator));
  5. } else {
  6. throw new Exception\InvalidValidationConfigurationException('Invalid validate annotation in ' . $className . '->' . $methodName . '(): Validator specified for argument name "' . $annotationParameters['argumentName'] . '", but this argument does not exist.', 1253172726);

    The Exception\InvalidValidationConfigurationException class resolves to the Romm\ConfigurationObject\Legacy\Validation\Exception\InvalidValidationConfigurationException class which PHP does not seem to be able to autoload.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Romain Canon
  7. }
  8. }
  9. return $validatorConjunctions;
  10. }
  1. foreach ($validateAnnotations as $validateAnnotation) {
  2. // @todo: Respect validationGroups
  3. $newValidator = $this->createValidator($validateAnnotation['validatorName'], $validateAnnotation['validatorOptions']);
  4. if ($newValidator === null) {
  5. throw new Exception\NoSuchValidatorException('Invalid validate annotation in ' . $targetClassName . '::' . $classPropertyName . ': Could not resolve class name for validator "' . $validateAnnotation->type . '".', 1241098027);

    The Exception\NoSuchValidatorException class resolves to the Romm\ConfigurationObject\Legacy\Validation\Exception\NoSuchValidatorException class which PHP does not seem to be able to autoload.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Romain Canon
  6. }
  7. $objectValidator->addPropertyValidator($classPropertyName, $newValidator);
  8. }
  9. }

Source code should not contain TODO comments 8

More information: https://insight.symfony.com/what-we-analyse/task_todo_comment

  1. * Returns the value of the reflected property - even if it is protected.
  2. *
  3. * @param object $object Instance of the declaring class \TYPO3\CMS\Extbase\Reflection to read the value from
  4. * @return mixed Value of the property
  5. * @throws Exception
  6. * @todo Maybe support private properties as well, as of PHP 5.3.0 we can do

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Romain Canon
  7. */
  8. public function getValue($object = null)
  9. {
  10. if (!is_object($object)) {
  11. throw new Exception('$object is of type ' . gettype($object) . ', instance of class ' . $this->class . ' expected.', 1210859212);
  1. */
  2. class ValidatorResolver implements \TYPO3\CMS\Core\SingletonInterface
  3. {
  4. /**
  5. * Match validator names and options
  6. * @todo: adjust [a-z0-9_:.\\\\] once Tx_Extbase_Foo syntax is outdated.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Romain Canon
  7. *
  8. * @var string
  9. */
  10. const PATTERN_MATCH_VALIDATORS = '/
  11. (?:^|,\s*)
  1. */
  2. public function createValidator($validatorType, array $validatorOptions = [])
  3. {
  4. try {
  5. /**
  6. * @todo remove throwing Exceptions in resolveValidatorObjectName

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Romain Canon
  7. */
  8. $validatorObjectName = $this->resolveValidatorObjectName($validatorType);
  9. $validator = $this->objectManager->get($validatorObjectName, $validatorOptions);
  1. if (!array_key_exists('type', $methodParameter)) {
  2. throw new Exception\InvalidTypeHintException('Missing type information, probably no @param annotation for parameter "$' . $parameterName . '" in ' . $className . '->' . $methodName . '()', 1281962564);
  3. }
  4. // @todo: remove check for old underscore model name syntax once it's possible

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Romain Canon
  5. if (strpbrk($methodParameter['type'], '_\\') === false) {
  6. $typeValidator = $this->createValidator($methodParameter['type']);
  7. } else {
  8. $typeValidator = null;
  9. }
  1. }
  2. }
  3. }
  4. $validateAnnotations = [];
  5. // @todo: Resolve annotations via reflectionService once its available

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Romain Canon
  6. if (isset($classPropertyTagsValues['validate']) && is_array($classPropertyTagsValues['validate'])) {
  7. foreach ($classPropertyTagsValues['validate'] as $validateValue) {
  8. $parsedAnnotations = $this->parseValidatorAnnotation($validateValue);
  9. foreach ($parsedAnnotations['validators'] as $validator) {
  1. }
  2. }
  3. }
  4. foreach ($validateAnnotations as $validateAnnotation) {
  5. // @todo: Respect validationGroups

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Romain Canon
  6. $newValidator = $this->createValidator($validateAnnotation['validatorName'], $validateAnnotation['validatorOptions']);
  7. if ($newValidator === null) {
  8. throw new Exception\NoSuchValidatorException('Invalid validate annotation in ' . $targetClassName . '::' . $classPropertyName . ': Could not resolve class name for validator "' . $validateAnnotation->type . '".', 1241098027);
  9. }
  10. $objectValidator->addPropertyValidator($classPropertyName, $newValidator);
  1. * @param ConjunctionValidator $conjunctionValidator
  2. * @return Validator\ObjectValidatorInterface|null
  3. */
  4. protected function addCustomValidators($targetClassName, ConjunctionValidator &$conjunctionValidator)
  5. {
  6. // @todo: get rid of ClassNamingUtility usage once we dropped underscored class name support

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Romain Canon
  7. $possibleValidatorClassName = ClassNamingUtility::translateModelNameToValidatorName($targetClassName);
  8. $customValidator = $this->createValidator($possibleValidatorClassName);
  9. if ($customValidator !== null) {
  10. $conjunctionValidator->addValidator($customValidator);
  1. $customValidator = $this->createValidator($possibleValidatorClassName);
  2. if ($customValidator !== null) {
  3. $conjunctionValidator->addValidator($customValidator);
  4. }
  5. // @todo: find polytype validator for class

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Romain Canon
  6. }
  7. /**
  8. * Parses the validator options given in @validate annotations.
  9. *