Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ClassMap.php

function ClassMap::getPsrViolations

Returns warning strings containing details about PSR-0/4 violations that were detected

Violations are for ex a class which is in the wrong file/directory and thus should not be found using psr-0/psr-4 autoloading but was found by the ClassMapGenerator as it scans all files.

This is only happening when scanning paths using psr-0/psr-4 autoload type. Classmap type always accepts every class as it finds it.

Return value

string[]

File

vendor/composer/class-map-generator/src/ClassMap.php, line 58

Class

ClassMap
@author Jordi Boggiano <j.boggiano@seld.be>

Namespace

Composer\ClassMapGenerator

Code

public function getPsrViolations() : array {
    if (\count($this->psrViolations) === 0) {
        return [];
    }
    return array_map(static function (array $violation) : string {
        return $violation['warning'];
    }, array_merge(...array_values($this->psrViolations)));
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal