Skip to content

Commit

Permalink
Add fully qualified names in inline code chapter
Browse files Browse the repository at this point in the history
  • Loading branch information
dingo-d committed Aug 20, 2022
1 parent 31fdb99 commit f5f0c60
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions wordpress-coding-standards/php.md
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,24 @@ $foo = new \Vendor // Source: external dependency.
$result = namespace \function_name(); // Notice the space between namespace and \function_name().
```

### Using fully qualified names in inline code

When using a fully or partially qualified name, no whitespace or comments are allowed within the name.

```php
// Correct.
$foo = new \Vendor\Domain\Foo();

$result = namespace\function_name();

// Incorrect.
$foo = new \Vendor // Source: external dependency.
\Domain
\Foo();

$result = namespace \function_name(); // Notice the space between namespace and \function_name().
```

## Object-Oriented Programming

### Only One Object Structure (Class/Interface/Trait) per File
Expand Down

0 comments on commit f5f0c60

Please sign in to comment.