Skip to content

Commit

Permalink
Issue #3050275 by Balu Ertl, borisson_: Replace remaining references …
Browse files Browse the repository at this point in the history
…of PSR-0 to PSR-4 instead
  • Loading branch information
goba committed May 15, 2019
1 parent be96960 commit 90e5675
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use Drupal\Component\Utility\Crypt;

/**
* Defines a discovery mechanism to find annotated plugins in PSR-0 namespaces.
* Defines a discovery mechanism to find annotated plugins in PSR-4 namespaces.
*/
class AnnotatedClassDiscovery implements DiscoveryInterface {

Expand Down Expand Up @@ -114,7 +114,7 @@ public function getDefinitions() {
// Register the namespaces of classes that can be used for annotations.
AnnotationRegistry::registerLoader('class_exists');

// Search for classes within all PSR-0 namespace locations.
// Search for classes within all PSR-4 namespace locations.
foreach ($this->getPluginNamespaces() as $namespace => $dirs) {
foreach ($dirs as $dir) {
if (file_exists($dir)) {
Expand Down Expand Up @@ -180,7 +180,7 @@ protected function prepareAnnotationDefinition(AnnotationInterface $annotation,
}

/**
* Gets an array of PSR-0 namespaces to search for plugin classes.
* Gets an array of PSR-4 namespaces to search for plugin classes.
*
* @return string[]
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Drupal\Component\Annotation\Plugin\Discovery\AnnotatedClassDiscovery as ComponentAnnotatedClassDiscovery;

/**
* Defines a discovery mechanism to find annotated plugins in PSR-0 namespaces.
* Defines a discovery mechanism to find annotated plugins in PSR-4 namespaces.
*/
class AnnotatedClassDiscovery extends ComponentAnnotatedClassDiscovery {

Expand Down
4 changes: 2 additions & 2 deletions core/lib/README.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
The core/lib directory is for classes provided by Drupal Core that are original
to Drupal. All Drupal-originated code must follow the PSR-0 naming convention
to Drupal. All Drupal-originated code must follow the PSR-4 naming convention
for classes and namespaces as documented here:

https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md
https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md

The vendor namespace for Drupal-originated code is "Drupal".
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function getDefinitions() {
// Register the namespaces of classes that can be used for annotations.
AnnotationRegistry::registerLoader('class_exists');

// Search for classes within all PSR-0 namespace locations.
// Search for classes within all PSR-4 namespace locations.
foreach ($this->getPluginNamespaces() as $namespace => $dirs) {
foreach ($dirs as $dir) {
if (file_exists($dir)) {
Expand Down
2 changes: 1 addition & 1 deletion core/modules/simpletest/simpletest.module
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ function simpletest_log_read($test_id, $database_prefix, $test_class) {
* Gets a list of all of the tests provided by the system.
*
* The list of test classes is loaded by searching the designated directory for
* each module for files matching the PSR-0 standard. Once loaded the test list
* each module for files matching the PSR-4 standard. Once loaded the test list
* is cached and stored in a static variable.
*
* @param string $extension
Expand Down
2 changes: 1 addition & 1 deletion core/scripts/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1094,7 +1094,7 @@ function simpletest_script_get_test_list() {
// Extract test case class names from specified directory.
// Find all tests in the PSR-X structure; Drupal\$extension\Tests\*.php
// Since we do not want to hard-code too many structural file/directory
// assumptions about PSR-0/4 files and directories, we check for the
// assumptions about PSR-4 files and directories, we check for the
// minimal conditions only; i.e., a '*.php' file that has '/Tests/' in
// its path.
// Ignore anything from third party vendors.
Expand Down

0 comments on commit 90e5675

Please sign in to comment.